| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../http/tests/inspector/debugger-test.js"></script> | 4 <script src="../../http/tests/inspector/debugger-test.js"></script> |
| 5 <script src="../../http/tests/inspector/workspace-test.js"></script> | 5 <script src="../../http/tests/inspector/workspace-test.js"></script> |
| 6 <script> | 6 <script> |
| 7 function test() | 7 function test() |
| 8 { | 8 { |
| 9 WebInspector.showPanel("scripts"); | 9 WebInspector.showPanel("sources"); |
| 10 InspectorTest.createWorkspace(true); | 10 InspectorTest.createWorkspace(true); |
| 11 | 11 |
| 12 function createContentProvider(url) | 12 function createContentProvider(url) |
| 13 { | 13 { |
| 14 var contentProvider = new WebInspector.StaticContentProvider(WebInspecto
r.resourceTypes.Script, "", "text/javascript"); | 14 var contentProvider = new WebInspector.StaticContentProvider(WebInspecto
r.resourceTypes.Script, "", "text/javascript"); |
| 15 contentProvider.requestContent = function(callback) | 15 contentProvider.requestContent = function(callback) |
| 16 { | 16 { |
| 17 InspectorTest.addResult("Source requested for " + url); | 17 InspectorTest.addResult("Source requested for " + url); |
| 18 callback(""); | 18 callback(""); |
| 19 }; | 19 }; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 37 return InspectorTest.testDebuggerWorkspaceProvider.addFileForURL(url, cr
eateContentProvider(url), false); | 37 return InspectorTest.testDebuggerWorkspaceProvider.addFileForURL(url, cr
eateContentProvider(url), false); |
| 38 } | 38 } |
| 39 | 39 |
| 40 InspectorTest.runTestSuite([ | 40 InspectorTest.runTestSuite([ |
| 41 function testInitialLoad(next) | 41 function testInitialLoad(next) |
| 42 { | 42 { |
| 43 var workspace = createMockWorkspace(); | 43 var workspace = createMockWorkspace(); |
| 44 | 44 |
| 45 addNetworkFile(workspace, "foobar.js"); | 45 addNetworkFile(workspace, "foobar.js"); |
| 46 | 46 |
| 47 var panel = new WebInspector.ScriptsPanel(workspace); | 47 var panel = new WebInspector.SourcesPanel(workspace); |
| 48 panel.show(); | 48 panel.show(); |
| 49 | 49 |
| 50 addNetworkFile(workspace, "foo.js"); | 50 addNetworkFile(workspace, "foo.js"); |
| 51 addNetworkFile(workspace, "bar.js"); | 51 addNetworkFile(workspace, "bar.js"); |
| 52 var uiSourceCode = addNetworkFile(workspace, "baz.js"); | 52 var uiSourceCode = addNetworkFile(workspace, "baz.js"); |
| 53 panel._navigator.revealUISourceCode(uiSourceCode); | 53 panel._navigator.revealUISourceCode(uiSourceCode); |
| 54 | 54 |
| 55 InspectorTest.dumpScriptsNavigator(panel._navigator); | 55 InspectorTest.dumpScriptsNavigator(panel._navigator); |
| 56 | 56 |
| 57 // Select "baz.js". | 57 // Select "baz.js". |
| 58 panel._showFile(workspace.uiSourceCodeForOriginURL("baz.js")); | 58 panel._showFile(workspace.uiSourceCodeForOriginURL("baz.js")); |
| 59 panel.detach(); | 59 panel.detach(); |
| 60 | 60 |
| 61 next(); | 61 next(); |
| 62 }, | 62 }, |
| 63 | 63 |
| 64 function testReset(next) | 64 function testReset(next) |
| 65 { | 65 { |
| 66 var workspace = createMockWorkspace(); | 66 var workspace = createMockWorkspace(); |
| 67 var workspaceController = new WebInspector.WorkspaceController(works
pace); | 67 var workspaceController = new WebInspector.WorkspaceController(works
pace); |
| 68 var panel = new WebInspector.ScriptsPanel(workspace); | 68 var panel = new WebInspector.SourcesPanel(workspace); |
| 69 panel.show(); | 69 panel.show(); |
| 70 | 70 |
| 71 addNetworkFile(workspace, "foo.js"); | 71 addNetworkFile(workspace, "foo.js"); |
| 72 addNetworkFile(workspace, "bar.js"); | 72 addNetworkFile(workspace, "bar.js"); |
| 73 addNetworkFile(workspace, "baz.js"); | 73 addNetworkFile(workspace, "baz.js"); |
| 74 | 74 |
| 75 InspectorTest.dumpScriptsNavigator(panel._navigator); | 75 InspectorTest.dumpScriptsNavigator(panel._navigator); |
| 76 | 76 |
| 77 InspectorTest.testNetworkWorkspaceProvider.reset(); | 77 InspectorTest.testNetworkWorkspaceProvider.reset(); |
| 78 InspectorTest.dumpScriptsNavigator(panel._navigator); | 78 InspectorTest.dumpScriptsNavigator(panel._navigator); |
| 79 var uiSourceCode = addNetworkFile(workspace, "bar.js"); | 79 var uiSourceCode = addNetworkFile(workspace, "bar.js"); |
| 80 panel._navigator.revealUISourceCode(uiSourceCode); | 80 panel._navigator.revealUISourceCode(uiSourceCode); |
| 81 InspectorTest.dumpScriptsNavigator(panel._navigator); | 81 InspectorTest.dumpScriptsNavigator(panel._navigator); |
| 82 | 82 |
| 83 panel.detach(); | 83 panel.detach(); |
| 84 next(); | 84 next(); |
| 85 }, | 85 }, |
| 86 | 86 |
| 87 function testDebuggerUISourceCodeAddedAndRemoved(next) | 87 function testDebuggerUISourceCodeAddedAndRemoved(next) |
| 88 { | 88 { |
| 89 var workspace = createMockWorkspace(); | 89 var workspace = createMockWorkspace(); |
| 90 var panel = new WebInspector.ScriptsPanel(workspace); | 90 var panel = new WebInspector.SourcesPanel(workspace); |
| 91 panel.show(); | 91 panel.show(); |
| 92 | 92 |
| 93 var uiSourceCode = addNetworkFile(workspace, "foo.js"); | 93 var uiSourceCode = addNetworkFile(workspace, "foo.js"); |
| 94 var debuggerUISourceCode = addDebuggerFile(workspace, "compiled.js")
; | 94 var debuggerUISourceCode = addDebuggerFile(workspace, "compiled.js")
; |
| 95 panel._navigator.revealUISourceCode(uiSourceCode); | 95 panel._navigator.revealUISourceCode(uiSourceCode); |
| 96 panel._navigator.revealUISourceCode(debuggerUISourceCode); | 96 panel._navigator.revealUISourceCode(debuggerUISourceCode); |
| 97 InspectorTest.dumpScriptsNavigator(panel._navigator); | 97 InspectorTest.dumpScriptsNavigator(panel._navigator); |
| 98 | 98 |
| 99 // Plug compiler source mapping. | 99 // Plug compiler source mapping. |
| 100 addNetworkFile(workspace, "source.js"); | 100 addNetworkFile(workspace, "source.js"); |
| 101 | 101 |
| 102 InspectorTest.dumpScriptsNavigator(panel._navigator); | 102 InspectorTest.dumpScriptsNavigator(panel._navigator); |
| 103 next(); | 103 next(); |
| 104 } | 104 } |
| 105 ]); | 105 ]); |
| 106 }; | 106 }; |
| 107 </script> | 107 </script> |
| 108 </head> | 108 </head> |
| 109 <body onload="runTest()"> | 109 <body onload="runTest()"> |
| 110 <p>Tests that scripts panel UI elements work as intended.</p> | 110 <p>Tests that scripts panel UI elements work as intended.</p> |
| 111 </body> | 111 </body> |
| 112 </html> | 112 </html> |
| OLD | NEW |