Upstream version 6.35.121.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / http / tests / inspector / network / network-cyrillic-xhr.html
1 <html>
2 <head>
3 <script src="../inspector-test.js"></script>
4 <script src="../network-test.js"></script>
5 <script>
6 function test()
7 {
8     // Since this test could be run together with other inspector backend cache
9     // tests, we need to reset size limits to default ones.
10     InspectorTest.resetInspectorResourcesData(step1);
11
12     function dumpRequest(request, callback)
13     {
14         if (!request)
15             return callback();
16         InspectorTest.addResult(request.url);
17
18         function contentLoaded()
19         {
20             InspectorTest.addResult("resource.content: " + request.content);
21             callback();
22         }
23
24         request.requestContent(contentLoaded);
25     }
26
27     function step1()
28     {
29         InspectorTest.recordNetwork();
30         InspectorTest.makeSimpleXHR("GET", "resources/cyrillic.html?sync", false, firstXHRLoaded);
31
32         function firstXHRLoaded()
33         {
34             InspectorTest.makeSimpleXHR("GET", "resources/cyrillic.html?async", true, step2);
35         }
36     }
37
38     function step2()
39     {
40         var request = WebInspector.inspectorView.panel("network").requests[WebInspector.inspectorView.panel("network").requests.length - 2];
41         dumpRequest(request, step3);
42     }
43
44     function step3()
45     {
46         var request = WebInspector.inspectorView.panel("network").requests[WebInspector.inspectorView.panel("network").requests.length - 1];
47         dumpRequest(request, step4);
48     }
49
50     function step4()
51     {
52         InspectorTest.completeTest();
53     }
54 }
55 </script>
56 </head>
57 <body onload="runTest()">
58 <p> Tests cyrillic xhr content is correctly loaded in inspector.</p>
59 <a href="https://bugs.webkit.org/show_bug.cgi?id=79026">Bug 79026</a>
60 </body>
61 </html>
62