Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / inspector-enabled / resource-tree / main-resource-content.html
blob95ca63bd2d82f4e49a065cdfc6af6f3252994978
1 <html>
2 <head>
3 <script src="../../inspector/inspector-test.js"></script>
4 <script src="../../inspector/resources-test.js"></script>
5 <script src="../../inspector/resource-tree/resource-tree-test.js"></script>
6 <script>
7 function onload()
9 if (window.testRunner) {
10 testRunner.waitUntilDone();
11 testRunner.showWebInspector();
13 runTest();
16 function test()
18 InspectorTest.runAfterResourcesAreFinished(["main-resource-content-frame-utf8.php", "main-resource-content-frame.html"], step2)
20 var resource;
21 function step2()
23 InspectorTest.addResult("Requesting content: ");
24 resource = InspectorTest.resourceMatchingURL("main-resource-content-frame.html");
25 InspectorTest.PageAgent.getResourceContent(resource.frameId, resource.url, step3);
28 function step3(error, content)
30 InspectorTest.assertTrue(!!content, "No content available.");
31 InspectorTest.addResult("Resource url: " + resource.url);
32 InspectorTest.addResult("Resource content: " + content);
34 InspectorTest.addResult("Requesting utf8 content: ");
35 resource = InspectorTest.resourceMatchingURL("main-resource-content-frame-utf8.php");
36 InspectorTest.PageAgent.getResourceContent(resource.frameId, resource.url, step4);
39 function step4(error, content)
41 InspectorTest.assertTrue(!!content, "No content available.");
42 InspectorTest.addResult("Resource url: " + resource.url);
43 InspectorTest.addResult("Resource content: " + content);
44 InspectorTest.completeTest();
47 </script>
48 </head>
49 <body onload="onload()">
50 <iframe src="resources/main-resource-content-frame.html"></iframe>
51 <iframe src="resources/main-resource-content-frame-utf8.php"></iframe>
52 <p>
53 Tests main resource content is correctly loaded and decoded using correct encoding.
54 </p>
55 </body>
56 </html>