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 var payload = "\u201AFoo\u201B"; | 8 var payload = "\u201AFoo\u201B"; |
9 | 9 |
10 InspectorTest.recordNetwork(); | 10 InspectorTest.recordNetwork(); |
11 InspectorTest.makeSimpleXHRWithPayload("POST", "resources/resource.php?foo",
true, payload, step2); | 11 InspectorTest.makeFetch("resources/resource.php?foo", {method: "POST", body:
payload}, step2); |
12 | 12 |
13 function step2() | 13 function step2() |
14 { | 14 { |
15 var request = InspectorTest.networkRequests().pop(); | 15 var request = InspectorTest.networkRequests().pop(); |
16 InspectorTest.addResult(request.url); | 16 InspectorTest.addResult(request.url); |
17 InspectorTest.assertEquals("foo", request.queryString(), "Unexpected res
ource query."); | 17 InspectorTest.assertEquals("foo", request.queryString(), "Unexpected res
ource query."); |
18 InspectorTest.assertEquals(payload, request.requestFormData, "Payload co
rrupted."); | 18 InspectorTest.assertEquals(payload, request.requestFormData, "Payload co
rrupted."); |
19 InspectorTest.completeTest(); | 19 InspectorTest.completeTest(); |
20 } | 20 } |
21 } | 21 } |
22 </script> | 22 </script> |
23 </head> | 23 </head> |
24 <body onload="runTest()"> | 24 <body onload="runTest()"> |
25 <p>Tests XHR network resource payload is not corrupted by transcoding.</p> | 25 <p>Tests fetch() network resource payload is not corrupted by transcoding.</p> |
26 </body> | 26 </body> |
27 </html> | 27 </html> |
OLD | NEW |