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

Unified Diff: LayoutTests/inspector/sources/debugger-ui/last-execution-context.html

Issue 1171753002: DevTools console context defaults to the Service Worker, should not. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 | LayoutTests/inspector/sources/debugger-ui/last-execution-context-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/inspector/sources/debugger-ui/last-execution-context.html
diff --git a/LayoutTests/inspector/sources/debugger-ui/last-execution-context.html b/LayoutTests/inspector/sources/debugger-ui/last-execution-context.html
new file mode 100644
index 0000000000000000000000000000000000000000..93b2b35045ab33d23f50945028c398d612473a4c
--- /dev/null
+++ b/LayoutTests/inspector/sources/debugger-ui/last-execution-context.html
@@ -0,0 +1,56 @@
+<html>
+<head>
+<script src="../../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../../http/tests/inspector/workspace-test.js"></script>
+<script>
+
+function test()
+{
+ InspectorTest.createWorkspace(true);
+ var context = new WebInspector.Context();
+ context.addFlavorChangeListener(WebInspector.ExecutionContext, executionContextChanged, this);
+ context.addFlavorChangeListener(WebInspector.Target, targetChanged, this);
+ new WebInspector.ExecutionContextSelector(InspectorTest.testTargetManager, context);
+
+ function executionContextChanged(event)
+ {
+ var executionContext = event.data;
+ InspectorTest.addResult("Execution context selected: " + (executionContext.isMainWorldContext ? executionContext.target().name() + ":" + executionContext.frameId : ""));
+ }
+
+ function targetChanged(event)
+ {
+ InspectorTest.addResult("Target selected: " + event.data.name());
+ }
+
+
+ InspectorTest.addResult("Adding page target:");
+ var pageTarget = InspectorTest.createMockTarget("page-target");
+ pageTarget.runtimeModel._executionContextCreated({id: "p1", name: "pageContext1", isPageContext: true, origin: "origin", name: "pageContext1Name", frameId: "pageFrame1"});
+ InspectorTest.addResult("");
+
+ InspectorTest.addResult("Adding sw target:");
+ var swTarget = InspectorTest.createMockTarget("sw-target");
+ swTarget.runtimeModel._executionContextCreated({id: "sw1", name: "swContext1", isPageContext: true, origin: "origin", name: "swContext1Name", frameId: ""});
+
+ InspectorTest.addResult("");
+ InspectorTest.addResult("Removing page target:");
+ pageTarget.runtimeModel._executionContextDestroyed("p1");
+
+ InspectorTest.addResult("");
+ InspectorTest.addResult("Readding page target:");
+ pageTarget.runtimeModel._executionContextCreated({id: "p2", name: "", isPageContext: true, origin: "", name: "", frameId: "pageFrame1"});
+
+ InspectorTest.completeTest();
+}
+
+</script>
+</head>
+
+<body onload="runTest()">
+<p>
+Tests that re-adding a removed target restores the last selected execution context.
+</p>
+
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/inspector/sources/debugger-ui/last-execution-context-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698