Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/timeline-paint-and-multiple-style-invalidations.html

Issue 2486853002: Timeline: remove TimelineModel inferred properties from TracingModel.Event (Closed)
Patch Set: addressed comments and rebased Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../../http/tests/inspector/inspector-test.js"></script> 4 <script src="../../../http/tests/inspector/inspector-test.js"></script>
5 <script src="../../../http/tests/inspector/timeline-test.js"></script> 5 <script src="../../../http/tests/inspector/timeline-test.js"></script>
6 <script> 6 <script>
7 function multipleStyleRecalcsAndDisplay() 7 function multipleStyleRecalcsAndDisplay()
8 { 8 {
9 document.getElementById("testElementOne").className = "red"; 9 document.getElementById("testElementOne").className = "red";
10 var forceStyleRecalc1 = document.body.offsetTop; 10 var forceStyleRecalc1 = document.body.offsetTop;
11 document.getElementById("testElementOne").className = "snow"; 11 document.getElementById("testElementOne").className = "snow";
12 var forceStyleRecalc2 = document.body.offsetTop; 12 var forceStyleRecalc2 = document.body.offsetTop;
13 return waitForFrame(); 13 return waitForFrame();
14 } 14 }
15 15
16 16
17 function test() 17 function test()
18 { 18 {
19 Runtime.experiments.enableForTest("timelineInvalidationTracking"); 19 Runtime.experiments.enableForTest("timelineInvalidationTracking");
20 InspectorTest.invokeAsyncWithTimeline("multipleStyleRecalcsAndDisplay", test MultipleStyleRecalcs); 20 InspectorTest.invokeAsyncWithTimeline("multipleStyleRecalcsAndDisplay", test MultipleStyleRecalcs);
21 21
22 function testMultipleStyleRecalcs() 22 function testMultipleStyleRecalcs()
23 { 23 {
24 var firstRecalc = InspectorTest.findTimelineRecord(WebInspector.Timeline Model.RecordType.UpdateLayoutTree, 0); 24 InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.Up dateLayoutTree, 0, "first style recalc");
25 InspectorTest.addArray(firstRecalc._event.invalidationTrackingEvents, In spectorTest.InvalidationFormatters, "", "first style recalc"); 25 InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.Up dateLayoutTree, 1, "second style recalc");
26 var secondRecalc = InspectorTest.findTimelineRecord(WebInspector.Timelin eModel.RecordType.UpdateLayoutTree, 1); 26 InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.Pa int, 0, "first paint");
27 InspectorTest.addArray(secondRecalc._event.invalidationTrackingEvents, I nspectorTest.InvalidationFormatters, "", "second style recalc");
28 var firstPaint = InspectorTest.findTimelineRecord(WebInspector.TimelineM odel.RecordType.Paint, 0);
29 InspectorTest.addArray(firstPaint._event.invalidationTrackingEvents, Ins pectorTest.InvalidationFormatters, "", "first paint");
30 27
31 var thirdRecalc = InspectorTest.findTimelineRecord(WebInspector.Timeline Model.RecordType.UpdateLayoutTree, 2); 28 var thirdRecalc = InspectorTest.findTimelineRecord(WebInspector.Timeline Model.RecordType.UpdateLayoutTree, 2);
32 InspectorTest.assertTrue(thirdRecalc === undefined, "There should be no additional style recalc records."); 29 InspectorTest.assertTrue(thirdRecalc === undefined, "There should be no additional style recalc records.");
33 var secondPaint = InspectorTest.findTimelineRecord(WebInspector.Timeline Model.RecordType.Paint, 1); 30 var secondPaint = InspectorTest.findTimelineRecord(WebInspector.Timeline Model.RecordType.Paint, 1);
34 InspectorTest.assertTrue(secondPaint === undefined, "There should be no additional paint records."); 31 InspectorTest.assertTrue(secondPaint === undefined, "There should be no additional paint records.");
35 InspectorTest.completeTest(); 32 InspectorTest.completeTest();
36 } 33 }
37 } 34 }
38 </script> 35 </script>
39 <style> 36 <style>
40 .testHolder > .red { background-color: red; } 37 .testHolder > .red { background-color: red; }
41 .testHolder > .green { background-color: green; } 38 .testHolder > .green { background-color: green; }
42 .testHolder > .blue { background-color: blue; } 39 .testHolder > .blue { background-color: blue; }
43 .testHolder > .snow { background-color: snow; } 40 .testHolder > .snow { background-color: snow; }
44 .testHolder > .red .dummy { } 41 .testHolder > .red .dummy { }
45 .testHolder > .green .dummy { } 42 .testHolder > .green .dummy { }
46 .testHolder > .blue .dummy { } 43 .testHolder > .blue .dummy { }
47 .testHolder > .snow .dummy { } 44 .testHolder > .snow .dummy { }
48 </style> 45 </style>
49 </head> 46 </head>
50 <body onload="runTest()"> 47 <body onload="runTest()">
51 <p>Tests the Timeline API instrumentation of multiple style recalc invalidations and ensures they are all collected on the paint event.</p> 48 <p>Tests the Timeline API instrumentation of multiple style recalc invalidations and ensures they are all collected on the paint event.</p>
52 <div class="testHolder"> 49 <div class="testHolder">
53 <div id="testElementOne">PASS</div><div id="testElementTwo">PASS</div><div id="t estElementThree">PASS</div> 50 <div id="testElementOne">PASS</div><div id="testElementTwo">PASS</div><div id="t estElementThree">PASS</div>
54 </div> 51 </div>
55 </body> 52 </body>
56 </html> 53 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698