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>
9 if (window
.testRunner
) {
10 testRunner
.waitUntilDone();
11 testRunner
.showWebInspector();
18 InspectorTest
.runAfterResourcesAreFinished(["main-resource-content-frame-utf8.php", "main-resource-content-frame.html"], 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();
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>
53 Tests main resource content is correctly loaded and decoded using correct encoding.