| 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> | |
| 6 | 5 |
| 7 <script> | 6 <script> |
| 8 function test() | 7 function test() |
| 9 { | 8 { |
| 10 var target = InspectorTest.createWorkspaceWithTarget(true); | 9 var networkProject1 = Bindings.NetworkProject.forTarget(InspectorTest.mainTa
rget); |
| 11 target.resourceTreeModel._frameAttached(239, target.resourceTreeModel.mainFr
ame.id); | 10 networkProject1._reset(); |
| 12 var mainFrame = target.resourceTreeModel.mainFrame; | 11 var target2 = InspectorTest.createMockTarget("mock-target-100"); |
| 13 target.resourceTreeModel._frameNavigated({id: 239, parentId: mainFrame.id, u
rl:"iframeurl.html", name: "childframe"}); | 12 SDK.ResourceTreeModel.fromTarget(target2)._cachedResourcesProcessed = true; |
| 14 var networkProject1 = InspectorTest.testNetworkProject; | 13 SDK.ResourceTreeModel.fromTarget(target2)._frameAttached("42", 0); |
| 15 | 14 var networkProject2 = Bindings.NetworkProject.forTarget(target2); |
| 16 var subframe = target.resourceTreeModel.frameForId(239); | 15 var subframe = InspectorTest.mainFrame().childFrames[0]; |
| 17 SDK.targetManager = InspectorTest.testTargetManager; | |
| 18 | |
| 19 target2 = InspectorTest.createMockTarget(100); | |
| 20 var networkProject2 = InspectorTest.testNetworkProject; | |
| 21 | 16 |
| 22 var sourcesNavigatorView = new Sources.SourcesNavigatorView(); | 17 var sourcesNavigatorView = new Sources.SourcesNavigatorView(); |
| 23 sourcesNavigatorView._resetWorkspace(InspectorTest.testWorkspace); | |
| 24 sourcesNavigatorView.show(UI.inspectorView.element); | 18 sourcesNavigatorView.show(UI.inspectorView.element); |
| 25 var contentScriptsNavigatorView = new Sources.ContentScriptsNavigatorView(); | 19 var contentScriptsNavigatorView = new Sources.ContentScriptsNavigatorView(); |
| 26 contentScriptsNavigatorView._resetWorkspace(InspectorTest.testWorkspace); | |
| 27 contentScriptsNavigatorView.show(UI.inspectorView.element); | 20 contentScriptsNavigatorView.show(UI.inspectorView.element); |
| 28 | 21 |
| 29 var uiSourceCodes = []; | 22 var uiSourceCodes = []; |
| 30 function addUISourceCode(url, isContentScript, frame) | 23 function addUISourceCode(url, isContentScript, frame) |
| 31 { | 24 { |
| 32 var contentProvider = Common.StaticContentProvider.fromString(url, Commo
n.resourceTypes.Script, ""); | 25 var contentProvider = Common.StaticContentProvider.fromString(url, Commo
n.resourceTypes.Script, ""); |
| 33 var uiSourceCode = networkProject1.addFile(contentProvider, frame || mai
nFrame); | 26 var uiSourceCode = networkProject1.addFile(contentProvider, frame || Ins
pectorTest.mainFrame()); |
| 34 uiSourceCodes.push(uiSourceCode); | 27 uiSourceCodes.push(uiSourceCode); |
| 35 } | 28 } |
| 36 | 29 |
| 37 function addUISourceCode2(url, isContentScript) | 30 function addUISourceCode2(url, isContentScript) |
| 38 { | 31 { |
| 39 var contentProvider = Common.StaticContentProvider.fromString(url, Commo
n.resourceTypes.Script, ""); | 32 var contentProvider = Common.StaticContentProvider.fromString(url, Commo
n.resourceTypes.Script, ""); |
| 40 var uiSourceCode = networkProject2.addFile(contentProvider, target2.reso
urceTreeModel.mainFrame); | 33 var uiSourceCode = networkProject2.addFile(contentProvider, SDK.Resource
TreeModel.fromTarget(target2).mainFrame); |
| 41 uiSourceCodes.push(uiSourceCode); | 34 uiSourceCodes.push(uiSourceCode); |
| 42 } | 35 } |
| 43 | 36 |
| 44 function revealUISourceCode(uiSourceCode) | 37 function revealUISourceCode(uiSourceCode) |
| 45 { | 38 { |
| 46 sourcesNavigatorView.revealUISourceCode(uiSourceCode); | 39 sourcesNavigatorView.revealUISourceCode(uiSourceCode); |
| 47 contentScriptsNavigatorView.revealUISourceCode(uiSourceCode); | 40 contentScriptsNavigatorView.revealUISourceCode(uiSourceCode); |
| 48 } | 41 } |
| 49 | 42 |
| 50 var rootURL = "http://localhost:8080/LayoutTests/inspector/debugger/"; | 43 var rootURL = "http://localhost:8080/LayoutTests/inspector/debugger/"; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 112 |
| 120 InspectorTest.addResult("\n\n===============================================
="); | 113 InspectorTest.addResult("\n\n===============================================
="); |
| 121 InspectorTest.addResult("Revealing all resources:"); | 114 InspectorTest.addResult("Revealing all resources:"); |
| 122 for (var i = 0; i < uiSourceCodes.length; ++i) | 115 for (var i = 0; i < uiSourceCodes.length; ++i) |
| 123 revealUISourceCode(uiSourceCodes[i]); | 116 revealUISourceCode(uiSourceCodes[i]); |
| 124 InspectorTest.dumpNavigatorViewInAllModes(sourcesNavigatorView); | 117 InspectorTest.dumpNavigatorViewInAllModes(sourcesNavigatorView); |
| 125 InspectorTest.dumpNavigatorViewInAllModes(contentScriptsNavigatorView); | 118 InspectorTest.dumpNavigatorViewInAllModes(contentScriptsNavigatorView); |
| 126 | 119 |
| 127 InspectorTest.addResult("\n\n===============================================
="); | 120 InspectorTest.addResult("\n\n===============================================
="); |
| 128 InspectorTest.addResult("Removing all resources:"); | 121 InspectorTest.addResult("Removing all resources:"); |
| 129 InspectorTest.testNetworkProject._reset(target); | 122 networkProject2._reset(); |
| 130 InspectorTest.dumpNavigatorViewInAllModes(sourcesNavigatorView); | 123 InspectorTest.dumpNavigatorViewInAllModes(sourcesNavigatorView); |
| 131 InspectorTest.dumpNavigatorViewInAllModes(contentScriptsNavigatorView); | 124 InspectorTest.dumpNavigatorViewInAllModes(contentScriptsNavigatorView); |
| 132 | 125 |
| 133 InspectorTest.completeTest(); | 126 InspectorTest.completeTest(); |
| 134 } | 127 } |
| 135 </script> | 128 </script> |
| 136 | 129 |
| 137 </head> | 130 </head> |
| 138 <body onload="runTest()"> | 131 <body> |
| 139 <p> | 132 <p> |
| 140 Tests scripts panel file selectors. | 133 Tests scripts panel file selectors. |
| 141 </p> | 134 </p> |
| 135 <iframe src="resources/post-message-listener.html" name="childframe" onload="run
Test()"></iframe> |
| 142 </body> | 136 </body> |
| 143 | 137 |
| 144 </html> | 138 </html> |
| OLD | NEW |