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

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

Issue 2206153002: DevTools: make iframe nodes report correct frame they belong to (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename + test Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/elements/selected-element-changes-execution-context-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/inspector/elements/selected-element-changes-execution-context.html
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/selected-element-changes-execution-context.html b/third_party/WebKit/LayoutTests/inspector/elements/selected-element-changes-execution-context.html
index 9328ee22cf68776f9715eb8442dc152558591b30..2b4ccdc0a86c84ba1d145bfe7c9c9b678e4c59ae 100644
--- a/third_party/WebKit/LayoutTests/inspector/elements/selected-element-changes-execution-context.html
+++ b/third_party/WebKit/LayoutTests/inspector/elements/selected-element-changes-execution-context.html
@@ -5,43 +5,59 @@
<script>
function test()
{
- InspectorTest.expandElementsTree(selectNode);
- var previousContext;
+ var mainContext;
- function selectNode()
- {
- previousContext = WebInspector.context.flavor(WebInspector.ExecutionContext);
- InspectorTest.selectNodeWithId("head", iframeNodeSelected);
- }
+ InspectorTest.runTestSuite([
+ function initialize(next)
+ {
+ InspectorTest.expandElementsTree(onExpanded);
- function iframeNodeSelected()
- {
- var node = WebInspector.panels.elements.selectedDOMNode();
- var currentContext = WebInspector.context.flavor(WebInspector.ExecutionContext);
- InspectorTest.addResult("Context has changed:");
- InspectorTest.addResult(previousContext.id !== currentContext.id);
- InspectorTest.addResult("Context matches node frameId: ");
- InspectorTest.addResult(currentContext.frameId == node.frameId());
- previousContext = currentContext;
- InspectorTest.selectNodeWithId("element", elementSelected);
- }
+ function onExpanded()
+ {
+ mainContext = WebInspector.context.flavor(WebInspector.ExecutionContext);
+ dumpContextAndNext(next);
+ }
+ },
+
+ function selectIframeInnerNode(next)
+ {
+ InspectorTest.selectNodeWithId("head", dumpContextAndNext.bind(null, next));
+ },
+
+ function selectMainFrameNode(next)
+ {
+ InspectorTest.selectNodeWithId("element", dumpContextAndNext.bind(null, next));
+ },
+
+ function selectIframeNode(next)
+ {
+ InspectorTest.selectNodeWithId("iframe-per-se", dumpContextAndNext.bind(null, next));
+ },
+
+ function selectIframeImmediateChild(next)
+ {
+ var iframe = WebInspector.context.flavor(WebInspector.DOMNode);
+ var child = iframe.firstChild;
+ InspectorTest.selectNode(child).then(dumpContextAndNext.bind(null, next));
+ },
+ ]);
- function elementSelected()
+ function dumpContextAndNext(next)
{
- var node = WebInspector.panels.elements.selectedDOMNode();
- var currentContext = WebInspector.context.flavor(WebInspector.ExecutionContext);
- InspectorTest.addResult("Context has changed:");
- InspectorTest.addResult(previousContext.id !== currentContext.id);
- InspectorTest.addResult("Context matches node frameId: ");
- InspectorTest.addResult(currentContext.frameId == node.frameId());
- InspectorTest.completeTest();
+ var context = WebInspector.context.flavor(WebInspector.ExecutionContext);
+ var node = WebInspector.context.flavor(WebInspector.DOMNode);
+ var contextName = context === mainContext ? "main" : "iframe";
+ var matchesNode = context.frameId === node.frameId();
+ InspectorTest.addResult("Execution Context: " + contextName);
+ InspectorTest.addResult(" matches: " + matchesNode);
+ next();
}
}
</script>
</head>
<body>
<p>Tests that the execution context is changed to match new selected node.</p>
- <iframe src="resources/set-outer-html-body-iframe.html" onload="runTest()"></iframe>
+ <iframe id="iframe-per-se" src="resources/set-outer-html-body-iframe.html" onload="runTest()"></iframe>
<div id="element"></div>
</body>
</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/elements/selected-element-changes-execution-context-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698