| 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 src="../../http/tests/inspector/elements-test.js"></script> | 4 <script src="../../http/tests/inspector/elements-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 function test() | 7 function test() |
| 8 { | 8 { |
| 9 InspectorTest.selectNodeWithId("test-topic", step1); | 9 InspectorTest.selectNodeWithId("test-topic", step1); |
| 10 | 10 |
| 11 function step1() | 11 function step1() |
| 12 { | 12 { |
| 13 InspectorTest.reloadPage(step2); | 13 InspectorTest.reloadPage(step2); |
| 14 } | 14 } |
| 15 | 15 |
| 16 function step2() | 16 function step2() |
| 17 { | 17 { |
| 18 InspectorTest.runAfterPendingDispatches(step3); | 18 InspectorTest.deprecatedRunAfterPendingDispatches(step3); |
| 19 } | 19 } |
| 20 | 20 |
| 21 function step3() | 21 function step3() |
| 22 { | 22 { |
| 23 // We should have "test-topic" element selected after refresh. | 23 // We should have "test-topic" element selected after refresh. |
| 24 var selectedElement = InspectorTest.firstElementsTreeOutline().selectedT
reeElement; | 24 var selectedElement = InspectorTest.firstElementsTreeOutline().selectedT
reeElement; |
| 25 var nodeName = selectedElement ? selectedElement.node().nodeName() : "nu
ll"; | 25 var nodeName = selectedElement ? selectedElement.node().nodeName() : "nu
ll"; |
| 26 InspectorTest.addResult("Selected element should be 'P', was: '" + nodeN
ame + "'"); | 26 InspectorTest.addResult("Selected element should be 'P', was: '" + nodeN
ame + "'"); |
| 27 InspectorTest.completeTest(); | 27 InspectorTest.completeTest(); |
| 28 } | 28 } |
| 29 } | 29 } |
| 30 | 30 |
| 31 </script> | 31 </script> |
| 32 </head> | 32 </head> |
| 33 | 33 |
| 34 <body onload="runTest()"> | 34 <body onload="runTest()"> |
| 35 <p id="test-topic"> | 35 <p id="test-topic"> |
| 36 Tests that elements panel preserves selected node on page refresh. | 36 Tests that elements panel preserves selected node on page refresh. |
| 37 </p> | 37 </p> |
| 38 | 38 |
| 39 </body> | 39 </body> |
| 40 </html> | 40 </html> |
| OLD | NEW |