3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/timeline-test.js"></script>
13 function updateSubframeAndDisplay()
15 frames[0].document.body.children[0].style.backgroundColor = "green";
16 if (window.testRunner)
17 testRunner.displayInvalidatedRegion();
26 InspectorTest.evaluateWithTimeline("display()", step2);
29 function step2(records)
31 for (var i = 0; i < records.length; ++i) {
32 var record = records[i];
33 if (record.type === WebInspector.TimelineModel.RecordType.Paint) {
34 InspectorTest.printTimelineRecordProperties(record);
38 InspectorTest.evaluateWithTimeline("updateSubframeAndDisplay()", step3);
41 function step3(records)
44 for (var i = 0; i < records.length; ++i) {
45 var record = records[i];
46 if (record.type === WebInspector.TimelineModel.RecordType.Paint && record.children && record.children.length) {
51 InspectorTest.assertTrue(paintRecord, "Paint record with subframe paint not found");
52 var topQuad = paintRecord.data.clip;
53 var subframePaint = paintRecord.children[0];
54 var subframeQuad = subframePaint.data.clip;
55 InspectorTest.assertEquals(8, topQuad.length);
56 InspectorTest.assertEquals(8, subframeQuad.length);
57 InspectorTest.assertGreaterOrEqual(subframeQuad[0], topQuad[0]);
58 InspectorTest.assertGreaterOrEqual(subframeQuad[1], topQuad[1]);
59 InspectorTest.assertGreaterOrEqual(topQuad[2], subframeQuad[2]);
60 InspectorTest.assertGreaterOrEqual(subframeQuad[3], topQuad[3]);
61 InspectorTest.assertGreaterOrEqual(topQuad[4], subframeQuad[4]);
62 InspectorTest.assertGreaterOrEqual(topQuad[5], subframeQuad[5]);
63 InspectorTest.assertGreaterOrEqual(subframeQuad[6], topQuad[6]);
64 InspectorTest.assertGreaterOrEqual(topQuad[7], subframeQuad[7]);
66 InspectorTest.completeTest();
73 <body onload="runTest()">
75 Tests the Timeline API instrumentation of a paint event
77 <iframe src="resources/timeline-iframe-paint.html" style="position: absolute; left: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe>