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> | 5 <script> |
6 function test() | 6 function test() |
7 { | 7 { |
8 function dumpNavigator(sourcesNavigatorView) | 8 function dumpNavigator(sourcesNavigatorView) |
9 { | 9 { |
10 InspectorTest.addResult("Navigator:"); | 10 InspectorTest.addResult("Navigator:"); |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 function addNetworkFile(url) | 32 function addNetworkFile(url) |
33 { | 33 { |
34 var networkProject = Bindings.NetworkProject.forTarget(InspectorTest.mai
nTarget); | 34 var networkProject = Bindings.NetworkProject.forTarget(InspectorTest.mai
nTarget); |
35 return networkProject.addFile(createContentProvider(url), InspectorTest.
mainFrame()); | 35 return networkProject.addFile(createContentProvider(url), InspectorTest.
mainFrame()); |
36 } | 36 } |
37 | 37 |
38 InspectorTest.runTestSuite([ | 38 InspectorTest.runTestSuite([ |
39 function testInitialLoad(next) | 39 function testInitialLoad(next) |
40 { | 40 { |
41 Bindings.NetworkProject.forTarget(InspectorTest.mainTarget)._reset()
; | 41 InspectorTest.resetNetworkProject(Bindings.NetworkProject.forTarget(
InspectorTest.mainTarget)); |
42 addNetworkFile("foobar.js"); | 42 addNetworkFile("foobar.js"); |
43 | 43 |
44 var sourcesNavigatorView = createNavigatorView(); | 44 var sourcesNavigatorView = createNavigatorView(); |
45 | 45 |
46 addNetworkFile("foo.js"); | 46 addNetworkFile("foo.js"); |
47 addNetworkFile("bar.js"); | 47 addNetworkFile("bar.js"); |
48 var uiSourceCode = addNetworkFile("baz.js"); | 48 var uiSourceCode = addNetworkFile("baz.js"); |
49 sourcesNavigatorView.revealUISourceCode(uiSourceCode); | 49 sourcesNavigatorView.revealUISourceCode(uiSourceCode); |
50 | 50 |
51 dumpNavigator(sourcesNavigatorView); | 51 dumpNavigator(sourcesNavigatorView); |
52 next(); | 52 next(); |
53 }, | 53 }, |
54 | 54 |
55 function testReset(next) | 55 function testReset(next) |
56 { | 56 { |
57 Bindings.NetworkProject.forTarget(InspectorTest.mainTarget)._reset()
; | 57 InspectorTest.resetNetworkProject(Bindings.NetworkProject.forTarget(
InspectorTest.mainTarget)); |
58 var sourcesNavigatorView = createNavigatorView(); | 58 var sourcesNavigatorView = createNavigatorView(); |
59 | 59 |
60 var uiSourceCode = addNetworkFile("foo.js"); | 60 var uiSourceCode = addNetworkFile("foo.js"); |
61 addNetworkFile("bar.js"); | 61 addNetworkFile("bar.js"); |
62 addNetworkFile("baz.js"); | 62 addNetworkFile("baz.js"); |
63 | 63 |
64 dumpNavigator(sourcesNavigatorView); | 64 dumpNavigator(sourcesNavigatorView); |
65 InspectorTest.addResult("Revealing in navigator."); | 65 InspectorTest.addResult("Revealing in navigator."); |
66 sourcesNavigatorView.revealUISourceCode(uiSourceCode); | 66 sourcesNavigatorView.revealUISourceCode(uiSourceCode); |
67 dumpNavigator(sourcesNavigatorView); | 67 dumpNavigator(sourcesNavigatorView); |
68 | 68 |
69 Bindings.NetworkProject.forTarget(InspectorTest.mainTarget)._reset()
; | 69 InspectorTest.resetNetworkProject(Bindings.NetworkProject.forTarget(
InspectorTest.mainTarget)); |
70 dumpNavigator(sourcesNavigatorView); | 70 dumpNavigator(sourcesNavigatorView); |
71 uiSourceCode = addNetworkFile("bar.js"); | 71 uiSourceCode = addNetworkFile("bar.js"); |
72 sourcesNavigatorView.revealUISourceCode(uiSourceCode); | 72 sourcesNavigatorView.revealUISourceCode(uiSourceCode); |
73 dumpNavigator(sourcesNavigatorView); | 73 dumpNavigator(sourcesNavigatorView); |
74 | 74 |
75 next(); | 75 next(); |
76 }, | 76 }, |
77 | 77 |
78 function testDebuggerUISourceCodeAddedAndRemoved(next) | 78 function testDebuggerUISourceCodeAddedAndRemoved(next) |
79 { | 79 { |
80 Bindings.NetworkProject.forTarget(InspectorTest.mainTarget)._reset()
; | 80 InspectorTest.resetNetworkProject(Bindings.NetworkProject.forTarget(
InspectorTest.mainTarget)); |
81 var sourcesNavigatorView = createNavigatorView(); | 81 var sourcesNavigatorView = createNavigatorView(); |
82 | 82 |
83 var uiSourceCode = addNetworkFile("foo.js"); | 83 var uiSourceCode = addNetworkFile("foo.js"); |
84 InspectorTest.waitForUISourceCode().then(onUISourceCode); | 84 InspectorTest.waitForUISourceCode().then(onUISourceCode); |
85 InspectorTest.evaluateInPage("function foo() {}"); | 85 InspectorTest.evaluateInPage("function foo() {}"); |
86 | 86 |
87 function onUISourceCode(debuggerUISourceCode) | 87 function onUISourceCode(debuggerUISourceCode) |
88 { | 88 { |
89 sourcesNavigatorView.revealUISourceCode(uiSourceCode); | 89 sourcesNavigatorView.revealUISourceCode(uiSourceCode); |
90 sourcesNavigatorView.revealUISourceCode(debuggerUISourceCode); | 90 sourcesNavigatorView.revealUISourceCode(debuggerUISourceCode); |
91 dumpNavigator(sourcesNavigatorView); | 91 dumpNavigator(sourcesNavigatorView); |
92 | 92 |
93 // Plug compiler source mapping. | 93 // Plug compiler source mapping. |
94 addNetworkFile("source.js"); | 94 addNetworkFile("source.js"); |
95 | 95 |
96 dumpNavigator(sourcesNavigatorView); | 96 dumpNavigator(sourcesNavigatorView); |
97 next(); | 97 next(); |
98 } | 98 } |
99 } | 99 } |
100 ]); | 100 ]); |
101 }; | 101 }; |
102 </script> | 102 </script> |
103 </head> | 103 </head> |
104 <body onload="runTest()"> | 104 <body onload="runTest()"> |
105 <p>Tests that scripts panel UI elements work as intended.</p> | 105 <p>Tests that scripts panel UI elements work as intended.</p> |
106 </body> | 106 </body> |
107 </html> | 107 </html> |
OLD | NEW |