Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / tracing / timeline-paint-with-layout-invalidations.html
blob3cfe6749929d895ef038d022125af9f77633b86d
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <script src="../../http/tests/inspector/inspector-test.js"></script>
5 <script src="../../http/tests/inspector/timeline-test.js"></script>
6 <script>
7 function display(callback)
9 requestAnimationFrame(function() {
10 document.body.style.backgroundColor = "blue";
11 document.getElementById("testElement").style.width = "100px";
12 var forceLayout = document.body.offsetTop;
13 if (window.testRunner)
14 testRunner.layoutAndPaintAsyncThen(callback);
15 });
18 function updateSubframeAndDisplay(callback)
20 requestAnimationFrame(function() {
21 frames[0].document.body.children[0].style.width = "200px";
22 var forceLayout = frames[0].document.body.offsetTop;
23 if (window.testRunner)
24 testRunner.layoutAndPaintAsyncThen(callback);
25 });
28 function test()
30 var currentPanel = WebInspector.inspectorView.currentPanel();
31 InspectorTest.assertEquals(currentPanel._panelName, "timeline", "Current panel should be the timeline.");
32 Runtime.experiments.enableForTest("timelineInvalidationTracking");
34 InspectorTest.runTestSuite([
35 function testLocalFrame(next)
37 InspectorTest.invokeAsyncWithTimeline("display", function() {
38 var record = InspectorTest.findFirstTimelineRecord(WebInspector.TimelineModel.RecordType.Paint);
39 InspectorTest.addArray(record._event.invalidationTrackingEvents, InspectorTest.InvalidationFormatters, "", "paint invalidations");
41 next();
42 });
45 function testSubframe(next)
47 InspectorTest.invokeAsyncWithTimeline("updateSubframeAndDisplay", function() {
48 // The first paint corresponds to the local frame and should have no invalidations.
49 var firstPaintRecord = InspectorTest.findFirstTimelineRecord(WebInspector.TimelineModel.RecordType.Paint);
50 var firstInvalidations = firstPaintRecord._event.invalidationTrackingEvents;
51 InspectorTest.assertEquals(firstInvalidations, undefined);
53 // The second paint corresponds to the subframe and should have our layout/style invalidations.
54 var secondPaintRecord = InspectorTest.findTimelineRecord(WebInspector.TimelineModel.RecordType.Paint, 1);
55 InspectorTest.addArray(secondPaintRecord._event.invalidationTrackingEvents, InspectorTest.InvalidationFormatters, "", "second paint invalidations");
57 next();
58 });
60 ]);
62 </script>
63 </head>
64 <body onload="runTest()">
65 <p>Tests the Timeline API instrumentation of paint events with layout invalidations.</p>
66 <div id="testElement">PASS</div>
67 <iframe src="resources/timeline-iframe-paint.html" style="position: absolute; left: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe>
68 </body>
69 </html>