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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/last-execution-context.html

Issue 2647153002: [DevTools] Improve context and target naming. (Closed)
Patch Set: fixed comments and sorting Created 3 years, 11 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
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> 4 <script>
5 5
6 function test() 6 function test()
7 { 7 {
8 var context = new UI.Context(); 8 var context = new UI.Context();
9 context.addFlavorChangeListener(SDK.ExecutionContext, executionContextChange d, this); 9 context.addFlavorChangeListener(SDK.ExecutionContext, executionContextChange d, this);
10 context.addFlavorChangeListener(SDK.Target, targetChanged, this); 10 context.addFlavorChangeListener(SDK.Target, targetChanged, this);
11 new Main.ExecutionContextSelector(SDK.targetManager, context); 11 new Main.ExecutionContextSelector(SDK.targetManager, context);
12 12
13 function executionContextChanged(event) 13 function executionContextChanged(event)
14 { 14 {
15 var executionContext = event.data; 15 var executionContext = event.data;
16 InspectorTest.addResult("Execution context selected: " + (executionConte xt.isDefault ? executionContext.target().name() + ":" + executionContext.frameId : executionContext.name)); 16 InspectorTest.addResult("Execution context selected: " + (executionConte xt.isDefault ? executionContext.target().name() + ":" + executionContext.frameId : executionContext.name));
17 } 17 }
18 18
19 function targetChanged(event) 19 function targetChanged(event)
20 { 20 {
21 InspectorTest.addResult("Target selected: " + event.data.name()); 21 InspectorTest.addResult("Target selected: " + event.data.name());
22 } 22 }
23 23
24 InspectorTest.runtimeModel._executionContextsCleared(); 24 InspectorTest.runtimeModel._executionContextsCleared();
25 25
26 26
27 InspectorTest.addResult(""); 27 InspectorTest.addResult("");
28 InspectorTest.addResult("Adding page target"); 28 InspectorTest.addResult("Adding page target");
29 var pageTarget = InspectorTest.createMockTarget("page-target"); 29 var pageTarget = InspectorTest.createMockTarget("page-target", SDK.Target.Ca pability.AllForTests, true /* dontAttachToMain */);
30 SDK.ResourceTreeModel.fromTarget(pageTarget)._cachedResourcesProcessed = tru e; 30 SDK.ResourceTreeModel.fromTarget(pageTarget)._frameAttached('42', '');
31 SDK.ResourceTreeModel.fromTarget(pageTarget)._frameAttached("42", 0); 31 SDK.ResourceTreeModel.fromTarget(pageTarget)._frameNavigated({id: '42', pare ntId: '', loaderId: '', name: 'mock-frame', url: 'mock-url.com/frame.html', secu rityOrigin: 'mock-security-origin', mineType: 'mimeType'});
32 pageTarget.runtimeModel._executionContextCreated({id: "cs1", auxData: { isDe fault: false, frameId: "42" }, origin: "origin", name: "contentScript1"}); 32 pageTarget.runtimeModel._executionContextCreated({id: "cs1", auxData: { isDe fault: false, frameId: "42" }, origin: "origin", name: "contentScript1"});
33 pageTarget.runtimeModel._executionContextCreated({id: "if1", auxData: { isDe fault: true, frameId: "iframe1" }, origin: "origin", name: "iframeContext1"}); 33 pageTarget.runtimeModel._executionContextCreated({id: "if1", auxData: { isDe fault: true, frameId: "iframe1" }, origin: "origin", name: "iframeContext1"});
34 pageTarget.runtimeModel._executionContextCreated({id: "p1", auxData: { isDef ault: true, frameId: "42" }, origin: "origin", name: "pageContext1Name"}); 34 pageTarget.runtimeModel._executionContextCreated({id: "p1", auxData: { isDef ault: true, frameId: "42" }, origin: "origin", name: "pageContext1Name"});
35 35
36 InspectorTest.addResult(""); 36 InspectorTest.addResult("");
37 InspectorTest.addResult("Adding sw target"); 37 InspectorTest.addResult("Adding sw target");
38 var swTarget = InspectorTest.createMockTarget("sw-target", SDK.Target.Capabi lity.Network | SDK.Target.Capability.Worker); 38 var swTarget = InspectorTest.createMockTarget("sw-target", SDK.Target.Capabi lity.Network | SDK.Target.Capability.Worker);
39 swTarget.runtimeModel._executionContextCreated({id: "sw1", auxData: { isDefa ult: true, frameId: "" }, origin: "origin", name: "swContext1Name"}); 39 swTarget.runtimeModel._executionContextCreated({id: "sw1", auxData: { isDefa ult: true, frameId: "" }, origin: "origin", name: "swContext1Name"});
40 40
41 InspectorTest.addResult(""); 41 InspectorTest.addResult("");
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 </script> 96 </script>
97 </head> 97 </head>
98 98
99 <body onload="runTest()"> 99 <body onload="runTest()">
100 <p> 100 <p>
101 Tests how execution context and target are selected. 101 Tests how execution context and target are selected.
102 </p> 102 </p>
103 103
104 </body> 104 </body>
105 </html> 105 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698