| 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/extensions-test.js"></script> | 4 <script src="../../http/tests/inspector/extensions-test.js"></script> |
| 5 <script src="../../http/tests/inspector/debugger-test.js"></script> | 5 <script src="../../http/tests/inspector/debugger-test.js"></script> |
| 6 <script src="../sources/debugger/resources/edit-me.js"></script> | 6 <script src="../sources/debugger/resources/edit-me.js"></script> |
| 7 <script type="text/javascript"> | 7 <script type="text/javascript"> |
| 8 | 8 |
| 9 function initialize_extensionsSidebarTest() | 9 function initialize_extensionsSidebarTest() |
| 10 { | 10 { |
| 11 InspectorTest.expandSidebar = function(callback) | 11 InspectorTest.expandSidebar = function(callback) |
| 12 { | 12 { |
| 13 var sidebar = InspectorTest._extensionSidebar(); | 13 var sidebar = InspectorTest._extensionSidebar(); |
| 14 InspectorTest.runAfterPendingDispatches(function() { | 14 InspectorTest.runAfterPendingDispatches(function() { |
| 15 sidebar.expand(); | 15 sidebar.expand(); |
| 16 callback(); | 16 callback(); |
| 17 }); | 17 }); |
| 18 } | 18 } |
| 19 | 19 |
| 20 InspectorTest._extensionSidebar = function() | 20 InspectorTest._extensionSidebar = function() |
| 21 { | 21 { |
| 22 return WebInspector.panels.elements._extensionSidebarPanes[0]; | 22 return WebInspector.extensionServer.sidebarPanes()[0]; |
| 23 } | 23 } |
| 24 } | 24 } |
| 25 | 25 |
| 26 function extension_expandSidebar(callback) | 26 function extension_expandSidebar(callback) |
| 27 { | 27 { |
| 28 evaluateOnFrontend("InspectorTest.expandSidebar(reply);", callback); | 28 evaluateOnFrontend("InspectorTest.expandSidebar(reply);", callback); |
| 29 } | 29 } |
| 30 | 30 |
| 31 function extension_testOnSelectionChanged(nextTest) | 31 function extension_testOnSelectionChanged(nextTest) |
| 32 { | 32 { |
| 33 function onSelectionChanged() | 33 function onSelectionChanged() |
| 34 { | 34 { |
| 35 webInspector.panels.elements.onSelectionChanged.removeListener(onSelecti
onChanged); | 35 webInspector.panels.elements.onSelectionChanged.removeListener(onSelecti
onChanged); |
| 36 output("onSelectionChanged fired"); | 36 output("onSelectionChanged fired"); |
| 37 nextTest(); | 37 nextTest(); |
| 38 } | 38 } |
| 39 webInspector.panels.elements.onSelectionChanged.addListener(onSelectionChang
ed); | 39 webInspector.panels.elements.onSelectionChanged.addListener(onSelectionChang
ed); |
| 40 webInspector.inspectedWindow.eval("inspect(document.body.children[0]), 0"); | 40 webInspector.inspectedWindow.eval("inspect(document.body.children[0]), 0"); |
| 41 } | 41 } |
| 42 | 42 |
| 43 function extension_testSourcesOnSelectionChanged(nextTest) | |
| 44 { | |
| 45 function onSelectionChanged(selectionInfo) | |
| 46 { | |
| 47 webInspector.panels.sources.onSelectionChanged.removeListener(onSelectio
nChanged); | |
| 48 output("sources onSelectionChanged fired, selectionInfo:"); | |
| 49 dumpObject(selectionInfo, {url: "url"}); | |
| 50 nextTest(); | |
| 51 } | |
| 52 webInspector.panels.sources.onSelectionChanged.addListener(onSelectionChange
d); | |
| 53 evaluateOnFrontend("InspectorTest.showScriptSource(\"edit-me.js\")"); | |
| 54 } | |
| 55 | |
| 56 function extension_testOnRequestFinished(nextTest) | 43 function extension_testOnRequestFinished(nextTest) |
| 57 { | 44 { |
| 58 function onRequestFinished() | 45 function onRequestFinished() |
| 59 { | 46 { |
| 60 webInspector.network.onRequestFinished.removeListener(onRequestFinished)
; | 47 webInspector.network.onRequestFinished.removeListener(onRequestFinished)
; |
| 61 output("onRequestFinished fired"); | 48 output("onRequestFinished fired"); |
| 62 nextTest(); | 49 nextTest(); |
| 63 } | 50 } |
| 64 webInspector.network.onRequestFinished.addListener(onRequestFinished); | 51 webInspector.network.onRequestFinished.addListener(onRequestFinished); |
| 65 webInspector.inspectedWindow.eval("var xhr = new XMLHttpRequest(); xhr.open(
'GET', '" + location.href + "', false); xhr.send(null);"); | 52 webInspector.inspectedWindow.eval("var xhr = new XMLHttpRequest(); xhr.open(
'GET', '" + location.href + "', false); xhr.send(null);"); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 } | 138 } |
| 152 webInspector.panels.elements.createSidebarPane("Test Sidebar", onSidebarCrea
ted); | 139 webInspector.panels.elements.createSidebarPane("Test Sidebar", onSidebarCrea
ted); |
| 153 } | 140 } |
| 154 | 141 |
| 155 </script> | 142 </script> |
| 156 </head> | 143 </head> |
| 157 <body onload="runTest()"> | 144 <body onload="runTest()"> |
| 158 <p>Tests WebInspector extension API</p> | 145 <p>Tests WebInspector extension API</p> |
| 159 </body> | 146 </body> |
| 160 </html> | 147 </html> |
| OLD | NEW |