| <html> |
| <head> |
| <script src="../../http/tests/inspector/inspector-test.js"></script> |
| <script src="../../http/tests/inspector/extensions-test.js"></script> |
| <script type="text/javascript"> |
| |
| window.bar = "foo = " + window.foo; |
| |
| function extension_testReloadInjectsCode(nextTest) |
| { |
| var valueWithInjectedCode; |
| |
| function onPageWithInjectedCodeLoaded() |
| { |
| webInspector.inspectedWindow.eval("window.bar", function(value) { |
| valueWithInjectedCode = value; |
| evaluateOnFrontend("InspectorTest.runWhenPageLoads(reply)", onPageWithoutInjectedCodeLoaded); |
| webInspector.inspectedWindow.reload(); |
| }); |
| } |
| function onPageWithoutInjectedCodeLoaded() |
| { |
| webInspector.inspectedWindow.eval("window.bar", function(value) { |
| output("With injected code: " + valueWithInjectedCode); |
| output("Without injected code: " + value); |
| nextTest(); |
| }); |
| } |
| evaluateOnFrontend("InspectorTest.runWhenPageLoads(reply)", onPageWithInjectedCodeLoaded); |
| webInspector.inspectedWindow.reload({ |
| injectedScript: "window.foo = 42;" |
| }); |
| } |
| |
| </script> |
| </head> |
| <body onload="runTest()"> |
| <p>Tests that webInspector.inspectedWindow.reload() successfully injects user's code upon reload</p> |
| </body> |
| </html> |