3 <script src="../inspector-test.js"></script>
4 <script src="../network-test.js"></script>
6 function scheduleScriptLoad() {
7 window.setTimeout(loadScript, 0);
10 function loadScript() {
11 var script = document.createElement("script");
12 script.type = "text/javascript";
13 script.src = "resources/random-script.php";
14 document.head.appendChild(script);
23 function loadScriptAndGetContent(callback)
25 InspectorTest.recordNetwork();
26 InspectorTest.addConsoleSniffer(scriptLoaded);
27 InspectorTest.evaluateInPage("scheduleScriptLoad()");
29 function scriptLoaded()
31 var request = InspectorTest.networkRequests().pop();
32 request.requestContent(contentLoaded);
35 function contentLoaded()
37 var request = InspectorTest.networkRequests().pop();
38 callback(request.content);
42 loadScriptAndGetContent(step1);
44 function step1(content)
47 InspectorTest.reloadPage(step2);
52 loadScriptAndGetContent(step3);
55 function step3(content)
58 NetworkAgent.setCacheDisabled(true, step4);
63 InspectorTest.reloadPage(step5);
68 loadScriptAndGetContent(step6);
71 function step6(content)
75 InspectorTest.assertTrue(content1 === content2, "First and second scripts should be equal.");
76 InspectorTest.assertTrue(content2 !== content3, "Second and third scripts should differ.");
77 NetworkAgent.setCacheDisabled(false, step7);
82 InspectorTest.completeTest();
87 <body onload="runTest()">
88 <p>Tests disabling cache from inspector.</p>