Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / reveal-objects.html
blob64e6e52d71d92e9fc617b52312bfd463467f1f6b
1 <html>
2 <head>
3 <script src="../http/tests/inspector/inspector-test.js"></script>
4 <script src="../http/tests/inspector/elements-test.js"></script>
5 <script src="../http/tests/inspector/network-test.js"></script>
6 <script>
8 var initialize_TestCustom = function() {
10 InspectorTest.preloadPanel("elements");
11 InspectorTest.preloadPanel("sources");
12 InspectorTest.preloadPanel("resources");
13 InspectorTest.preloadPanel("network");
17 function loadResource(url)
19 var xhr = new XMLHttpRequest();
20 xhr.open("GET", url, false);
21 xhr.send();
24 function test() {
25 var node;
26 var resource;
27 var uiLocation;
28 var requestWithResource;
29 var requestWithoutResource;
31 InspectorTest.runTestSuite([
32 function init(next)
34 installHooks();
36 InspectorTest.resourceTreeModel.forAllResources(function(r) {
37 if (r.url.indexOf("inspector-test.js") !== -1) {
38 resource = r;
39 return true;
41 });
42 uiLocation = WebInspector.workspace.uiSourceCodeForOriginURL(resource.url).uiLocation(2, 1);
44 InspectorTest.nodeWithId("div", nodeCallback);
46 function nodeCallback(foundNode)
48 node = foundNode;
49 InspectorTest.recordNetwork();
50 InspectorTest.evaluateInPage("loadResource('../http/tests/inspector/inspector-test.js')", firstXhrCallback);
53 function firstXhrCallback()
55 requestWithResource = InspectorTest.networkLog.requestForURL(resource.url);
56 InspectorTest.evaluateInPage("loadResource('missing.js')", secondXhrCallback);
59 function secondXhrCallback()
61 var requests = InspectorTest.networkRequests();
62 for (var i = 0; i < requests.length; ++i) {
63 if (requests[i].url.indexOf("missing.js") !== -1) {
64 requestWithoutResource = requests[i];
65 break;
68 next();
72 function revealNode(next)
74 WebInspector.Revealer.revealPromise(node).then(next);
77 function revealUILocation(next)
79 WebInspector.Revealer.revealPromise(uiLocation).then(next);
82 function revealResource(next)
84 WebInspector.Revealer.revealPromise(resource).then(next);
87 function revealRequestWithResource(next)
89 WebInspector.Revealer.revealPromise(requestWithResource).then(next);
92 function revealRequestWithoutResource(next)
94 WebInspector.Revealer.revealPromise(requestWithoutResource).then(next);
96 ]);
98 function installHooks()
100 InspectorTest.addSniffer(WebInspector.ElementsPanel.prototype, "revealAndSelectNode", nodeRevealed, true);
101 InspectorTest.addSniffer(WebInspector.SourcesPanel.prototype, "showUILocation", uiLocationRevealed, true);
102 InspectorTest.addSniffer(WebInspector.ResourcesPanel.prototype, "showResource", resourceRevealed, true);
103 InspectorTest.addSniffer(WebInspector.NetworkPanel.prototype, "revealAndHighlightRequest", requestRevealed, true);
106 function nodeRevealed(node)
108 InspectorTest.addResult("Node revealed in the Elements panel");
111 function uiLocationRevealed(uiLocation)
113 InspectorTest.addResult("UILocation " + uiLocation.uiSourceCode.name() + ":" + uiLocation.lineNumber + ":" + uiLocation.columnNumber + " revealed in the Sources panel");
116 function resourceRevealed(resource, lineNumber)
118 InspectorTest.addResult("Resource " + resource.displayName + " revealed in the Resources panel");
121 function requestRevealed(request)
123 InspectorTest.addResult("Request " + new WebInspector.ParsedURL(request.url).lastPathComponent + " revealed in the Network panel");
127 </script>
128 </head>
129 <body onload="runTest()">
130 <p>Tests object revelation in the UI.</p>
131 <div id="div" />
132 </body>
133 </html>