Initialize Tizen 2.3
[framework/web/webkit-efl.git] / LayoutTests / inspector / timeline / timeline-decode-resize.html
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/timeline-test.js"></script>
5 <script>
6
7 function addImage(src, width, height, callback)
8 {
9     var img = document.createElement("img");
10     img.width = width;
11     img.height = height;
12     img.onload = callback;
13     img.src = src;
14     document.body.appendChild(img);
15 }
16
17 function addImage1() { addImage("resources/test.bmp", "25", "25", addImage2); }
18 function addImage2() { addImage("resources/test.gif", "25", "25", addImage3); }
19 function addImage3() { addImage("resources/test.ico", "25", "25", addImage4); }
20 function addImage4() { addImage("resources/test.jpg", "25", "25", addImage5); }
21 function addImage5() { addImage("resources/test.png", "25", "25", addImage6); }
22 function addImage6() { addImage("resources/test.webp", "25", "25", addImage7); }
23 function addImage7() { addImage("resources/big.png", "5000", "5000", displayPage); }
24
25 function displayPage()
26 {
27     if (window.testRunner) {
28         testRunner.display();
29         testRunner.waitUntilDone();
30     }
31     testRunner.evaluateInWebInspector(0, "window.step2()");
32 }
33
34 function test()
35 {
36     InspectorTest.startTimeline(step1);
37
38     function step1()
39     {
40         InspectorTest.evaluateInPage("addImage1()");
41     }
42
43     window.step2 = function()
44     {
45         InspectorTest.stopTimeline(step3);
46     }
47
48     function step3(records)
49     {
50         for (var i = 0; i < records.length; ++i) {
51             var record = records[i];
52             if (record.type === WebInspector.TimelineModel.RecordType.DecodeImage || record.type === WebInspector.TimelineModel.RecordType.ResizeImage)
53                 InspectorTest.printTimelineRecordProperties(record);
54         }
55         InspectorTest.completeTest();
56     }
57 }
58
59 </script>
60 </head>
61
62 <body onload="runTest()">
63 <p>
64 Tests the Timeline API instrumentation of a DecodeImage and ResizeImage events
65 </p>
66
67 </body>
68 </html>