OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../inspector-test.js"></script> | 3 <script src="../inspector-test.js"></script> |
4 <script src="../network-test.js"></script> | 4 <script src="../network-test.js"></script> |
5 <script> | 5 <script> |
6 function test() | 6 function test() |
7 { | 7 { |
8 // Since this test could be run together with other inspector backend cache | 8 // Since this test could be run together with other inspector backend cache |
9 // tests, we need to reset size limits to default ones. | 9 // tests, we need to reset size limits to default ones. |
10 InspectorTest.resetInspectorResourcesData(step1); | 10 InspectorTest.resetInspectorResourcesData(step1); |
11 | 11 |
12 function step1() | 12 function step1() |
13 { | 13 { |
14 InspectorTest.makeXHR("GET", "resources/resource.php", true, undefined,
undefined, [], false, undefined, 'blob', step2); | 14 InspectorTest.makeXHR("GET", "resources/resource.php", true, undefined,
undefined, [], false, undefined, 'blob', step2); |
15 } | 15 } |
16 | 16 |
17 function step2() | 17 function step2() |
18 { | 18 { |
19 var request1 = WebInspector.panel("network").requests[WebInspector.panel
("network").requests.length - 1]; | 19 var request1 = WebInspector.panel("network").requests[WebInspector.panel
("network").requests.length - 1]; |
20 InspectorTest.addResult(request1.url); | 20 InspectorTest.addResult(request1.url); |
21 InspectorTest.addResult("resource.type: " + request1.type); | 21 InspectorTest.addResult("resource.type: " + request1.type); |
22 InspectorTest.addResult("resource.size: " + request1.resourceSize); | 22 InspectorTest.addResult("resource.size: " + request1.resourceSize); |
| 23 InspectorTest.addResult("resource.content before requesting content: " +
request1.content); |
23 InspectorTest.assertTrue(!request1.failed, "Resource loading failed."); | 24 InspectorTest.assertTrue(!request1.failed, "Resource loading failed."); |
| 25 request1.requestContent(step3); |
| 26 } |
| 27 |
| 28 function step3() |
| 29 { |
| 30 var request1 = WebInspector.panel("network").requests[WebInspector.panel
("network").requests.length - 1]; |
| 31 InspectorTest.addResult("resource.content after requesting content: " +
request1.content); |
| 32 |
24 InspectorTest.completeTest(); | 33 InspectorTest.completeTest(); |
25 } | 34 } |
26 } | 35 } |
27 </script> | 36 </script> |
28 </head> | 37 </head> |
29 <body onload="runTest()"> | 38 <body onload="runTest()"> |
30 <p> | 39 <p> |
31 Tests XHR network resource type and size for asynchronous requests when 'blob'
is specified as the response type. | 40 Tests XHR network resource type and size for asynchronous requests when 'blob'
is specified as the response type. |
32 </p> | 41 </p> |
33 </body> | 42 </body> |
34 </html> | 43 </html> |
OLD | NEW |