| OLD | NEW |
| (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> |
| OLD | NEW |