| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../inspector/inspector-test.js"></script> | 3 <script src="../inspector/inspector-test.js"></script> |
| 4 <script src="../inspector/console-test.js"></script> | 4 <script src="../inspector/console-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 function openWebInspector() | 7 function openWebInspector() |
| 8 { | 8 { |
| 9 if (window.testRunner) { | 9 if (window.testRunner) { |
| 10 testRunner.waitUntilDone(); | 10 testRunner.waitUntilDone(); |
| 11 testRunner.showWebInspector(); | 11 testRunner.showWebInspector(); |
| 12 runTest(); | 12 runTest(); |
| 13 } | 13 } |
| 14 } | 14 } |
| 15 | 15 |
| 16 function reopenWebInspector(objectId) | 16 function reopenWebInspector(objectId) |
| 17 { | 17 { |
| 18 window.objectId = unescape(objectId); | 18 window.objectId = unescape(objectId); |
| 19 testRunner.closeWebInspector(); | 19 testRunner.closeWebInspector(); |
| 20 setTimeout(function() { | 20 setTimeout(function() { |
| 21 testRunner.showWebInspector(); | 21 testRunner.showWebInspector(); |
| 22 runTest(); | 22 runTest(); |
| 23 }, 0); | 23 }, 0); |
| 24 } | 24 } |
| 25 | 25 |
| 26 function test() | 26 function test() |
| 27 { | 27 { |
| 28 InspectorTest.RuntimeAgent.evaluate("window.objectId", dispatch); | 28 InspectorTest.RuntimeAgent.evaluate("window.objectId", dispatch); |
| 29 | 29 |
| 30 function dispatch(error, result, wasThrown) | 30 function dispatch(error, result, exceptionDetails) |
| 31 { | 31 { |
| 32 if (result.type !== "string") { | 32 if (result.type !== "string") { |
| 33 InspectorTest.evaluateInPage("console.log('Opening front-end for the
first time')"); | 33 InspectorTest.evaluateInPage("console.log('Opening front-end for the
first time')"); |
| 34 installHandleInInjectedScript(); | 34 installHandleInInjectedScript(); |
| 35 } else { | 35 } else { |
| 36 InspectorTest.evaluateInPage("console.log('Opening front-end second
time')"); | 36 InspectorTest.evaluateInPage("console.log('Opening front-end second
time')"); |
| 37 checkHandleInInjectedScript(result.value, InspectorTest.completeTest
); | 37 checkHandleInInjectedScript(result.value, InspectorTest.completeTest
); |
| 38 } | 38 } |
| 39 } | 39 } |
| 40 | 40 |
| 41 function installHandleInInjectedScript() | 41 function installHandleInInjectedScript() |
| 42 { | 42 { |
| 43 InspectorTest.RuntimeAgent.evaluate("({ handle : \"handle\" })", storeId
InTargetWindow); | 43 InspectorTest.RuntimeAgent.evaluate("({ handle : \"handle\" })", storeId
InTargetWindow); |
| 44 | 44 |
| 45 function storeIdInTargetWindow(error, result, wasThrown) | 45 function storeIdInTargetWindow(error, result, exceptionDetails) |
| 46 { | 46 { |
| 47 checkHandleInInjectedScript(result.objectId, reopenInspector); | 47 checkHandleInInjectedScript(result.objectId, reopenInspector); |
| 48 | 48 |
| 49 function reopenInspector() | 49 function reopenInspector() |
| 50 { | 50 { |
| 51 InspectorTest.evaluateInPage("reopenWebInspector('" + escape(res
ult.objectId) + "')"); | 51 InspectorTest.evaluateInPage("reopenWebInspector('" + escape(res
ult.objectId) + "')"); |
| 52 } | 52 } |
| 53 } | 53 } |
| 54 } | 54 } |
| 55 | 55 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 66 | 66 |
| 67 </script> | 67 </script> |
| 68 </head> | 68 </head> |
| 69 <body onload="openWebInspector()"> | 69 <body onload="openWebInspector()"> |
| 70 <p> | 70 <p> |
| 71 Tests that injected script is discarded upon front-end close. | 71 Tests that injected script is discarded upon front-end close. |
| 72 </p> | 72 </p> |
| 73 <div id="container"/> | 73 <div id="container"/> |
| 74 </body> | 74 </body> |
| 75 </html> | 75 </html> |
| OLD | NEW |