| <html> |
| <head> |
| <script src="../inspector-test.js"></script> |
| <script src="../resources-test.js"></script> |
| <script src="resource-tree-test.js"></script> |
| <link rel="stylesheet" href="resources/styles-initial.css"> |
| <script> |
| function createScriptTag() |
| { |
| var scriptElement = document.createElement("script"); |
| scriptElement.src = "resources/dynamic-script.js"; |
| document.head.appendChild(scriptElement); |
| } |
| |
| function test() |
| { |
| InspectorTest.addResult("Adding dynamic script: "); |
| InspectorTest.evaluateInPage("createScriptTag()", step2); |
| |
| function step2() |
| { |
| InspectorTest.addResult("Waiting for script request to finish: "); |
| InspectorTest.runAfterResourcesAreFinished(["dynamic-script.js"], step3) |
| } |
| |
| function step3() |
| { |
| InspectorTest.addResult("Clearing memory cache: "); |
| NetworkAgent.setCacheDisabled(true, step4); |
| } |
| |
| function step4() |
| { |
| NetworkAgent.setCacheDisabled(false, step5); |
| } |
| |
| var resource; |
| function step5() |
| { |
| InspectorTest.addResult("Requesting content: "); |
| resource = InspectorTest.resourceMatchingURL("dynamic-script.js"); |
| resource.requestContent(step6); |
| } |
| |
| function step6(content) |
| { |
| InspectorTest.assertTrue(!!content, "No content available."); |
| InspectorTest.addResult("Resource url: " + resource.url); |
| InspectorTest.addResult("Resource content: " + content); |
| InspectorTest.completeTest(); |
| } |
| } |
| </script> |
| </head> |
| <body onload="runTest()"> |
| <p>Tests resource content is correctly loaded if Resource.requestContent was called before network request was finished.</p> |
| <a href="https://bugs.webkit.org/show_bug.cgi?id=90153">Bug 90153</a> |
| </body> |
| </html> |