| <html> |
| <head> |
| <script src="../../http/tests/inspector/inspector-test.js"></script> |
| <script src="../../http/tests/inspector/debugger-test.js"></script> |
| <script src="../../http/tests/inspector/workspace-test.js"></script> |
| |
| <script> |
| function test() |
| { |
| WebInspector.showPanel("scripts"); |
| InspectorTest.createWorkspace(true); |
| var panel = new WebInspector.ScriptsPanel(InspectorTest.testWorkspace); |
| var navigator = panel._navigator; |
| |
| var uiSourceCodes = []; |
| function addUISourceCode(url, isContentScript) |
| { |
| var contentProvider = new WebInspector.StaticContentProvider(WebInspector.resourceTypes.Script, "", "text/javascript"); |
| var uiSourceCode = InspectorTest.testNetworkWorkspaceProvider.addFileForURL(url, contentProvider, false, isContentScript); |
| uiSourceCodes.push(uiSourceCode); |
| } |
| |
| function dumpScriptsList() |
| { |
| InspectorTest.addResult(""); |
| InspectorTest.dumpScriptsNavigator(navigator); |
| navigator.revealUISourceCode(uiSourceCodes[0]); |
| InspectorTest.dumpScriptsNavigator(navigator); |
| for (var i = 0; i < uiSourceCodes.length; ++i) |
| navigator.revealUISourceCode(uiSourceCodes[i]); |
| InspectorTest.dumpScriptsNavigator(navigator); |
| } |
| |
| var scripts = [ |
| "block.js?block=foo", |
| "ga.js", |
| "lenta.ban?pg=4883&ifr=1", |
| "lenta.ban?pg=5309&ifr=1", |
| "top100.jcn?80674", |
| "_js/production/motor.js?1308927432", |
| "i/xgemius.js", |
| "i/js/jquery-1.5.1.min.js", |
| "i/js/jquery.cookie.js", |
| "foo/path/bar.js?file=bar/zzz.js", |
| "foo/path/foo.js?file=bar/aaa.js" ]; |
| for (var i = 0; i < scripts.length; ++i) |
| addUISourceCode("http://foo.com/" + scripts[i]); |
| |
| var scripts2 = [ |
| "foo/path/bar.js?file=bar/zzz.js", |
| "foo/path/foo.js?file=bar/aaa.js" ]; |
| for (var i = 0; i < scripts2.length; ++i) |
| addUISourceCode("http://bar.com/" + scripts2[i]); |
| addUISourceCode("*Non*URL*path"); |
| |
| var extensions = [ |
| "extension-schema://extension-name/bar.js", |
| "extension-schema://extension-name/folder/baz.js" ]; |
| for (var i = 0; i < extensions.length; ++i) |
| addUISourceCode(extensions[i], true); |
| addUISourceCode("*Another*Non*URL*path", true); |
| dumpScriptsList(); |
| InspectorTest.completeTest(); |
| } |
| </script> |
| |
| </head> |
| <body onload="runTest()"> |
| <p> |
| Tests scripts sorting in the scripts panel. |
| </p> |
| </body> |
| |
| </html> |