| 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/elements-test.js"></script> | 4 <script src="../http/tests/inspector/elements-test.js"></script> |
| 5 <script src="../http/tests/inspector/network-test.js"></script> | 5 <script src="../http/tests/inspector/network-test.js"></script> |
| 6 <script> | 6 <script> |
| 7 | 7 |
| 8 var initialize_TestCustom = function() { | 8 var initialize_TestCustom = function() { |
| 9 | 9 |
| 10 InspectorTest.preloadPanel("elements"); | 10 InspectorTest.preloadPanel("elements"); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 function init(next) | 32 function init(next) |
| 33 { | 33 { |
| 34 installHooks(); | 34 installHooks(); |
| 35 | 35 |
| 36 InspectorTest.resourceTreeModel.forAllResources(function(r) { | 36 InspectorTest.resourceTreeModel.forAllResources(function(r) { |
| 37 if (r.url.indexOf("inspector-test.js") !== -1) { | 37 if (r.url.indexOf("inspector-test.js") !== -1) { |
| 38 resource = r; | 38 resource = r; |
| 39 return true; | 39 return true; |
| 40 } | 40 } |
| 41 }); | 41 }); |
| 42 uiLocation = WebInspector.workspace.uiSourceCodeForURL(resource.url)
.uiLocation(2, 1); | 42 uiLocation = Workspace.workspace.uiSourceCodeForURL(resource.url).ui
Location(2, 1); |
| 43 | 43 |
| 44 InspectorTest.nodeWithId("div", nodeCallback); | 44 InspectorTest.nodeWithId("div", nodeCallback); |
| 45 | 45 |
| 46 function nodeCallback(foundNode) | 46 function nodeCallback(foundNode) |
| 47 { | 47 { |
| 48 node = foundNode; | 48 node = foundNode; |
| 49 InspectorTest.recordNetwork(); | 49 InspectorTest.recordNetwork(); |
| 50 InspectorTest.evaluateInPage("loadResource('../http/tests/inspec
tor/inspector-test.js')", firstXhrCallback); | 50 InspectorTest.evaluateInPage("loadResource('../http/tests/inspec
tor/inspector-test.js')", firstXhrCallback); |
| 51 } | 51 } |
| 52 | 52 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 64 requestWithoutResource = requests[i]; | 64 requestWithoutResource = requests[i]; |
| 65 break; | 65 break; |
| 66 } | 66 } |
| 67 } | 67 } |
| 68 next(); | 68 next(); |
| 69 } | 69 } |
| 70 }, | 70 }, |
| 71 | 71 |
| 72 function revealNode(next) | 72 function revealNode(next) |
| 73 { | 73 { |
| 74 WebInspector.Revealer.revealPromise(node).then(next); | 74 Common.Revealer.revealPromise(node).then(next); |
| 75 }, | 75 }, |
| 76 | 76 |
| 77 function revealUILocation(next) | 77 function revealUILocation(next) |
| 78 { | 78 { |
| 79 WebInspector.Revealer.revealPromise(uiLocation).then(next); | 79 Common.Revealer.revealPromise(uiLocation).then(next); |
| 80 }, | 80 }, |
| 81 | 81 |
| 82 function revealResource(next) | 82 function revealResource(next) |
| 83 { | 83 { |
| 84 WebInspector.Revealer.revealPromise(resource).then(next); | 84 Common.Revealer.revealPromise(resource).then(next); |
| 85 }, | 85 }, |
| 86 | 86 |
| 87 function revealRequestWithResource(next) | 87 function revealRequestWithResource(next) |
| 88 { | 88 { |
| 89 WebInspector.Revealer.revealPromise(requestWithResource).then(next); | 89 Common.Revealer.revealPromise(requestWithResource).then(next); |
| 90 }, | 90 }, |
| 91 | 91 |
| 92 function revealRequestWithoutResource(next) | 92 function revealRequestWithoutResource(next) |
| 93 { | 93 { |
| 94 WebInspector.Revealer.revealPromise(requestWithoutResource).then(nex
t); | 94 Common.Revealer.revealPromise(requestWithoutResource).then(next); |
| 95 } | 95 } |
| 96 ]); | 96 ]); |
| 97 | 97 |
| 98 function installHooks() | 98 function installHooks() |
| 99 { | 99 { |
| 100 InspectorTest.addSniffer(WebInspector.ElementsPanel.prototype, "revealAn
dSelectNode", nodeRevealed, true); | 100 InspectorTest.addSniffer(Elements.ElementsPanel.prototype, "revealAndSel
ectNode", nodeRevealed, true); |
| 101 InspectorTest.addSniffer(WebInspector.SourcesPanel.prototype, "showUILoc
ation", uiLocationRevealed, true); | 101 InspectorTest.addSniffer(Sources.SourcesPanel.prototype, "showUILocation
", uiLocationRevealed, true); |
| 102 InspectorTest.addSniffer(WebInspector.ResourcesPanel.prototype, "showRes
ource", resourceRevealed, true); | 102 InspectorTest.addSniffer(Resources.ResourcesPanel.prototype, "showResour
ce", resourceRevealed, true); |
| 103 InspectorTest.addSniffer(WebInspector.NetworkPanel.prototype, "revealAnd
HighlightRequest", revealed, true); | 103 InspectorTest.addSniffer(Network.NetworkPanel.prototype, "revealAndHighl
ightRequest", revealed, true); |
| 104 } | 104 } |
| 105 | 105 |
| 106 function nodeRevealed(node) | 106 function nodeRevealed(node) |
| 107 { | 107 { |
| 108 InspectorTest.addResult("Node revealed in the Elements panel"); | 108 InspectorTest.addResult("Node revealed in the Elements panel"); |
| 109 } | 109 } |
| 110 | 110 |
| 111 function uiLocationRevealed(uiLocation) | 111 function uiLocationRevealed(uiLocation) |
| 112 { | 112 { |
| 113 InspectorTest.addResult("UILocation " + uiLocation.uiSourceCode.name() +
":" + uiLocation.lineNumber + ":" + uiLocation.columnNumber + " revealed in the
Sources panel"); | 113 InspectorTest.addResult("UILocation " + uiLocation.uiSourceCode.name() +
":" + uiLocation.lineNumber + ":" + uiLocation.columnNumber + " revealed in the
Sources panel"); |
| 114 } | 114 } |
| 115 | 115 |
| 116 function resourceRevealed(resource, lineNumber) | 116 function resourceRevealed(resource, lineNumber) |
| 117 { | 117 { |
| 118 InspectorTest.addResult("Resource " + resource.displayName + " revealed
in the Resources panel"); | 118 InspectorTest.addResult("Resource " + resource.displayName + " revealed
in the Resources panel"); |
| 119 } | 119 } |
| 120 | 120 |
| 121 function revealed(request) | 121 function revealed(request) |
| 122 { | 122 { |
| 123 InspectorTest.addResult("Request " + new WebInspector.ParsedURL(request.
url).lastPathComponent + " revealed in the Network panel"); | 123 InspectorTest.addResult("Request " + new Common.ParsedURL(request.url).l
astPathComponent + " revealed in the Network panel"); |
| 124 } | 124 } |
| 125 } | 125 } |
| 126 | 126 |
| 127 </script> | 127 </script> |
| 128 </head> | 128 </head> |
| 129 <body onload="runTest()"> | 129 <body onload="runTest()"> |
| 130 <p>Tests object revelation in the UI.</p> | 130 <p>Tests object revelation in the UI.</p> |
| 131 <div id="div" /> | 131 <div id="div" /> |
| 132 </body> | 132 </body> |
| 133 </html> | 133 </html> |
| OLD | NEW |