OLD | NEW |
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 mockTargetId = 1; | 8 var mockTargetId = 1; |
9 function createMockTarget(name, capabilities, dontAttachToMain) | 9 function createMockTarget(name, capabilities, dontAttachToMain) |
10 { | 10 { |
11 return SDK.targetManager.createTarget('mock-target-' + mockTargetId++, n
ame, capabilities, params => new SDK.StubConnection(params), dontAttachToMain ?
null : InspectorTest.mainTarget); | 11 var dispatcher = new Protocol.Dispatcher(params => new SDK.StubConnectio
n(params)); |
| 12 return SDK.targetManager.createTarget('mock-target-' + mockTargetId++, n
ame, capabilities, dispatcher, dontAttachToMain ? null : InspectorTest.mainTarge
t); |
12 } | 13 } |
13 | 14 |
14 var context = new UI.Context(); | 15 var context = new UI.Context(); |
15 context.addFlavorChangeListener(SDK.ExecutionContext, executionContextChange
d, this); | 16 context.addFlavorChangeListener(SDK.ExecutionContext, executionContextChange
d, this); |
16 context.addFlavorChangeListener(SDK.Target, targetChanged, this); | 17 context.addFlavorChangeListener(SDK.Target, targetChanged, this); |
17 new Main.ExecutionContextSelector(SDK.targetManager, context); | 18 new Main.ExecutionContextSelector(SDK.targetManager, context); |
18 | 19 |
19 function executionContextChanged(event) | 20 function executionContextChanged(event) |
20 { | 21 { |
21 var executionContext = event.data; | 22 var executionContext = event.data; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 </script> | 104 </script> |
104 </head> | 105 </head> |
105 | 106 |
106 <body onload="runTest()"> | 107 <body onload="runTest()"> |
107 <p> | 108 <p> |
108 Tests how execution context and target are selected. | 109 Tests how execution context and target are selected. |
109 </p> | 110 </p> |
110 | 111 |
111 </body> | 112 </body> |
112 </html> | 113 </html> |
OLD | NEW |