Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/elements/selected-element-changes-execution-context.html

Issue 1668603003: Devtools: Switch JS execution context to match inspected node (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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>
6 function test()
7 {
8 InspectorTest.expandElementsTree(selectNode);
9 var previousContext;
10
11 function selectNode()
12 {
13 previousContext = WebInspector.context.flavor(WebInspector.ExecutionCont ext);
14 InspectorTest.selectNodeWithId("head", iframeNodeSelected);
15 }
16
17 function iframeNodeSelected()
18 {
19 var node = WebInspector.panels.elements.selectedDOMNode();
20 var currentContext = WebInspector.context.flavor(WebInspector.ExecutionC ontext);
21 InspectorTest.addResult("Context has changed:");
22 InspectorTest.addResult(previousContext.id !== currentContext.id);
23 InspectorTest.addResult("Context matches node frameId: ");
24 InspectorTest.addResult(currentContext.frameId == node.frameId());
25 previousContext = currentContext;
26 InspectorTest.selectNodeWithId("element", elementSelected);
27 }
28
29 function elementSelected()
30 {
31 var node = WebInspector.panels.elements.selectedDOMNode();
32 var currentContext = WebInspector.context.flavor(WebInspector.ExecutionC ontext);
33 InspectorTest.addResult("Context has changed:");
34 InspectorTest.addResult(previousContext.id !== currentContext.id);
35 InspectorTest.addResult("Context matches node frameId: ");
36 InspectorTest.addResult(currentContext.frameId == node.frameId());
37 InspectorTest.completeTest();
38 }
39 }
40 </script>
41 </head>
42 <body>
43 <p>Tests that the execution context is changed to match new selected node.</ p>
44 <iframe src="resources/set-outer-html-body-iframe.html" onload="runTest()">< /iframe>
45 <div id="element"></div>
46 </body>
47 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698