| 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 function dumpNavigator(sourcesNavigatorView) | 9 function dumpNavigator(sourcesNavigatorView) |
| 10 { | 10 { |
| 11 InspectorTest.addResult("Navigator:"); | 11 InspectorTest.addResult("Navigator:"); |
| 12 InspectorTest.dumpNavigatorView(sourcesNavigatorView); | 12 InspectorTest.dumpNavigatorView(sourcesNavigatorView); |
| 13 } | 13 } |
| 14 | 14 |
| 15 function createNavigatorView() | 15 function createNavigatorView() |
| 16 { | 16 { |
| 17 var workspace = WebInspector.workspace; | 17 var workspace = Workspace.workspace; |
| 18 WebInspector.workspace = InspectorTest.testWorkspace; | 18 Workspace.workspace = InspectorTest.testWorkspace; |
| 19 var navigatorView = new WebInspector.SourcesNavigatorView(); | 19 var navigatorView = new Sources.SourcesNavigatorView(); |
| 20 WebInspector.workspace = workspace; | 20 Workspace.workspace = workspace; |
| 21 navigatorView.show(WebInspector.inspectorView.element); | 21 navigatorView.show(UI.inspectorView.element); |
| 22 return navigatorView; | 22 return navigatorView; |
| 23 } | 23 } |
| 24 | 24 |
| 25 function createContentProvider(url) | 25 function createContentProvider(url) |
| 26 { | 26 { |
| 27 var contentProvider = WebInspector.StaticContentProvider.fromString(url,
WebInspector.resourceTypes.Script, ""); | 27 var contentProvider = Common.StaticContentProvider.fromString(url, Commo
n.resourceTypes.Script, ""); |
| 28 contentProvider.requestContent = function() | 28 contentProvider.requestContent = function() |
| 29 { | 29 { |
| 30 InspectorTest.addResult("Source requested for " + url); | 30 InspectorTest.addResult("Source requested for " + url); |
| 31 return Promise.resolve(""); | 31 return Promise.resolve(""); |
| 32 }; | 32 }; |
| 33 return contentProvider; | 33 return contentProvider; |
| 34 } | 34 } |
| 35 | 35 |
| 36 function createMockWorkspace() | 36 function createMockWorkspace() |
| 37 { | 37 { |
| 38 InspectorTest.createWorkspaceWithTarget(true); | 38 InspectorTest.createWorkspaceWithTarget(true); |
| 39 InspectorTest.testDebuggerProject = new WebInspector.ContentProviderBase
dProject(InspectorTest.testWorkspace, "", WebInspector.projectTypes.Debugger, ""
); | 39 InspectorTest.testDebuggerProject = new Bindings.ContentProviderBasedPro
ject(InspectorTest.testWorkspace, "", Workspace.projectTypes.Debugger, ""); |
| 40 return InspectorTest.testWorkspace; | 40 return InspectorTest.testWorkspace; |
| 41 } | 41 } |
| 42 | 42 |
| 43 function addNetworkFile(workspace, url) | 43 function addNetworkFile(workspace, url) |
| 44 { | 44 { |
| 45 return InspectorTest.testNetworkProject.addFile(createContentProvider(ur
l), InspectorTest.mainFrame()); | 45 return InspectorTest.testNetworkProject.addFile(createContentProvider(ur
l), InspectorTest.mainFrame()); |
| 46 } | 46 } |
| 47 | 47 |
| 48 function addDebuggerFile(workspace, url) | 48 function addDebuggerFile(workspace, url) |
| 49 { | 49 { |
| 50 var uiSourceCode = InspectorTest.testDebuggerProject.createUISourceCode(
url, WebInspector.resourceTypes.Script); | 50 var uiSourceCode = InspectorTest.testDebuggerProject.createUISourceCode(
url, Common.resourceTypes.Script); |
| 51 InspectorTest.testDebuggerProject.addUISourceCodeWithProvider(uiSourceCo
de, createContentProvider(url)); | 51 InspectorTest.testDebuggerProject.addUISourceCodeWithProvider(uiSourceCo
de, createContentProvider(url)); |
| 52 return uiSourceCode; | 52 return uiSourceCode; |
| 53 } | 53 } |
| 54 | 54 |
| 55 InspectorTest.runTestSuite([ | 55 InspectorTest.runTestSuite([ |
| 56 function testInitialLoad(next) | 56 function testInitialLoad(next) |
| 57 { | 57 { |
| 58 var workspace = createMockWorkspace(); | 58 var workspace = createMockWorkspace(); |
| 59 | 59 |
| 60 addNetworkFile(workspace, "foobar.js"); | 60 addNetworkFile(workspace, "foobar.js"); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 next(); | 111 next(); |
| 112 } | 112 } |
| 113 ]); | 113 ]); |
| 114 }; | 114 }; |
| 115 </script> | 115 </script> |
| 116 </head> | 116 </head> |
| 117 <body onload="runTest()"> | 117 <body onload="runTest()"> |
| 118 <p>Tests that scripts panel UI elements work as intended.</p> | 118 <p>Tests that scripts panel UI elements work as intended.</p> |
| 119 </body> | 119 </body> |
| 120 </html> | 120 </html> |
| OLD | NEW |