Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / http / tests / inspector / tracing / timeline-xhr-response-type-blob-event.html
1 <html>
2 <head>
3 <script src="../inspector-test.js"></script>
4 <script src="../timeline-test.js"></script>
5 <script src="../network-test.js"></script>
6 <script>
7
8 function performActions(callback)
9 {
10     var xhr = new XMLHttpRequest();
11     xhr.responseType = "blob";
12     xhr.open("GET", "network/resources/resource.php", true);
13     xhr.onload = function() { };  // This is necessary for XHRLoad event.
14     // assigning callback to onload doesn't work here due to exception in responseXML handling for blob response type.
15     xhr.onreadystatechange = done;
16     function done()
17     {
18         if (xhr.readyState === 4)
19             callback();
20     }
21     xhr.send(null);
22 }
23
24 function test()
25 {
26     InspectorTest.resetInspectorResourcesData(step1);
27     function step1()
28     {
29         InspectorTest.invokeAsyncWithTimeline("performActions", finish);
30
31         function finish()
32         {
33             InspectorTest.printTimelineRecords("XHRReadyStateChange");
34             InspectorTest.printTimelineRecords("XHRLoad");
35             InspectorTest.completeTest();
36         }
37     }
38 }
39
40 </script>
41 </head>
42
43 <body onload="runTest()">
44 <p>
45 Tests the Timeline events for XMLHttpReqeust with responseType="blob"
46 </p>
47
48 </body>
49 </html>