3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/timeline-test.js"></script>
7 function addImage(src, width, height, callback)
9 var img = document.createElement("img");
12 img.onload = callback;
14 document.body.appendChild(img);
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); }
25 function displayPage()
27 if (window.testRunner) {
29 testRunner.waitUntilDone();
31 testRunner.evaluateInWebInspector(0, "window.step2()");
36 InspectorTest.startTimeline(step1);
40 InspectorTest.evaluateInPage("addImage1()");
43 window.step2 = function()
45 InspectorTest.stopTimeline(step3);
48 function step3(records)
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);
55 InspectorTest.completeTest();
62 <body onload="runTest()">
64 Tests the Timeline API instrumentation of a DecodeImage and ResizeImage events