Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / sources / debugger / debugger-scripts-reload.html
blob46ea3b8e0ed43fa472e8d10e2850ec53e5954a80
1 <html>
2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/debugger-test.js"></script>
6 <script>
8 function test()
10 InspectorTest.evaluateInPage("function foo() {} //# sourceURL=dummyScript.js", step1);
12 function step1()
14 InspectorTest.startDebuggerTest(step2);
17 function step2()
19 InspectorTest.queryScripts(function(script) { step3({ data: script }) });
20 InspectorTest.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.ParsedScriptSource, step3);
23 function step3(event)
25 var script = event.data;
26 if (script.sourceURL.indexOf("dummyScript.js") !== -1) {
27 InspectorTest.addResult("Dummy script found: " + script.sourceURL);
28 // Let scripts dispatch and reload.
29 setTimeout(InspectorTest.reloadPage.bind(InspectorTest, afterReload), 0);
33 function afterReload()
35 var scripts = InspectorTest.queryScripts();
36 for (var i = 0; i < scripts.length; ++i) {
37 if (scripts[i].sourceURL.indexOf("dummyScript.js") !== -1)
38 InspectorTest.addResult("FAILED: dummy script found after navigation");
40 InspectorTest.completeDebuggerTest();
44 </script>
45 </head>
46 <body onload="runTest()">
47 <p>
48 Tests that scripts list is cleared upon page reload.
49 </p>
50 </body>
51 </html>