Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / tracing / timeline-paint.html
blob0557b71b91de9e9d659372be1c37615398e25015
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>
7 function display(callback)
9 requestAnimationFrame(function() {
10 document.body.style.backgroundColor = "blue";
11 if (window.testRunner)
12 testRunner.layoutAndPaintAsyncThen(callback);
13 });
16 function updateSubframeAndDisplay(callback)
18 requestAnimationFrame(function() {
19 frames[0].document.body.children[0].style.backgroundColor = "green";
20 if (window.testRunner)
21 testRunner.layoutAndPaintAsyncThen(callback);
22 });
25 function test()
27 InspectorTest.invokeAsyncWithTimeline("display", step1);
29 function step1(records)
31 var record = InspectorTest.findFirstTimelineRecord(WebInspector.TimelineModel.RecordType.Paint);
32 if (record)
33 InspectorTest.printTimelineRecordProperties(record);
34 else
35 InspectorTest.addResult("FAIL: no paint record found");
36 InspectorTest.invokeAsyncWithTimeline("updateSubframeAndDisplay", step3);
39 function step3(records)
41 var paintRecord = InspectorTest.findFirstTimelineRecord(WebInspector.TimelineModel.RecordType.Paint);
42 InspectorTest.assertTrue(paintRecord, "Paint record with subframe paint not found");
43 var topQuad = paintRecord.traceEvent().args["data"].clip;
44 var subframePaint = paintRecord.children()[0];
45 var subframeQuad = subframePaint.traceEvent().args["data"].clip;
46 InspectorTest.assertEquals(8, topQuad.length);
47 InspectorTest.assertEquals(8, subframeQuad.length);
48 InspectorTest.assertGreaterOrEqual(subframeQuad[0], topQuad[0]);
49 InspectorTest.assertGreaterOrEqual(subframeQuad[1], topQuad[1]);
50 InspectorTest.assertGreaterOrEqual(topQuad[2], subframeQuad[2]);
51 InspectorTest.assertGreaterOrEqual(subframeQuad[3], topQuad[3]);
52 InspectorTest.assertGreaterOrEqual(topQuad[4], subframeQuad[4]);
53 InspectorTest.assertGreaterOrEqual(topQuad[5], subframeQuad[5]);
54 InspectorTest.assertGreaterOrEqual(subframeQuad[6], topQuad[6]);
55 InspectorTest.assertGreaterOrEqual(topQuad[7], subframeQuad[7]);
57 InspectorTest.completeTest();
61 </script>
62 </head>
64 <body onload="runTest()">
65 <p>
66 Tests the Timeline API instrumentation of a paint event
67 </p>
68 <iframe src="resources/timeline-iframe-paint.html" style="position: absolute; left: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe>
69 </body>
70 </html>