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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/timeline-paint-with-layout-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 display() 7 function display()
8 { 8 {
9 document.body.style.backgroundColor = "blue"; 9 document.body.style.backgroundColor = "blue";
10 document.getElementById("testElement").style.width = "100px"; 10 document.getElementById("testElement").style.width = "100px";
11 var forceLayout = document.body.offsetTop; 11 var forceLayout = document.body.offsetTop;
12 return waitForFrame(); 12 return waitForFrame();
13 } 13 }
14 14
15 function updateSubframeAndDisplay() 15 function updateSubframeAndDisplay()
16 { 16 {
17 frames[0].document.body.children[0].style.width = "200px"; 17 frames[0].document.body.children[0].style.width = "200px";
18 var forceLayout = frames[0].document.body.offsetTop; 18 var forceLayout = frames[0].document.body.offsetTop;
19 return waitForFrame(); 19 return waitForFrame();
20 } 20 }
21 21
22 function test() 22 function test()
23 { 23 {
24 Runtime.experiments.enableForTest("timelineInvalidationTracking"); 24 Runtime.experiments.enableForTest("timelineInvalidationTracking");
25 25
26 InspectorTest.runTestSuite([ 26 InspectorTest.runTestSuite([
27 function testLocalFrame(next) 27 function testLocalFrame(next)
28 { 28 {
29 InspectorTest.invokeAsyncWithTimeline("display", function() { 29 InspectorTest.invokeAsyncWithTimeline("display", function() {
30 var record = InspectorTest.findFirstTimelineRecord(WebInspector. TimelineModel.RecordType.Paint); 30 InspectorTest.dumpInvalidations(WebInspector.TimelineModel.Recor dType.Paint, 0, "paint invalidations");
31 InspectorTest.addArray(record._event.invalidationTrackingEvents, InspectorTest.InvalidationFormatters, "", "paint invalidations");
32
33 next(); 31 next();
34 }); 32 });
35 }, 33 },
36 34
37 function testSubframe(next) 35 function testSubframe(next)
38 { 36 {
39 InspectorTest.invokeAsyncWithTimeline("updateSubframeAndDisplay", fu nction() { 37 InspectorTest.invokeAsyncWithTimeline("updateSubframeAndDisplay", fu nction() {
40 // The first paint corresponds to the local frame and should hav e no invalidations. 38 // The first paint corresponds to the local frame and should hav e no invalidations.
41 var firstPaintRecord = InspectorTest.findFirstTimelineRecord(Web Inspector.TimelineModel.RecordType.Paint); 39 var firstPaintRecord = InspectorTest.findFirstTimelineRecord(Web Inspector.TimelineModel.RecordType.Paint);
42 var firstInvalidations = firstPaintRecord._event.invalidationTra ckingEvents; 40 var firstInvalidations = WebInspector.InvalidationTracker.invali dationEventsFor(firstPaintRecord._event);
43 InspectorTest.assertEquals(firstInvalidations, undefined); 41 InspectorTest.assertEquals(firstInvalidations, null);
44 42
45 // The second paint corresponds to the subframe and should have our layout/style invalidations. 43 // The second paint corresponds to the subframe and should have our layout/style invalidations.
46 var secondPaintRecord = InspectorTest.findTimelineRecord(WebInsp ector.TimelineModel.RecordType.Paint, 1); 44 InspectorTest.dumpInvalidations(WebInspector.TimelineModel.Recor dType.Paint, 1, "second paint invalidations");
47 InspectorTest.addArray(secondPaintRecord._event.invalidationTrac kingEvents, InspectorTest.InvalidationFormatters, "", "second paint invalidation s");
48
49 next(); 45 next();
50 }); 46 });
51 } 47 }
52 ]); 48 ]);
53 } 49 }
54 </script> 50 </script>
55 </head> 51 </head>
56 <body onload="runTest()"> 52 <body onload="runTest()">
57 <p>Tests the Timeline API instrumentation of paint events with layout invalidati ons.</p> 53 <p>Tests the Timeline API instrumentation of paint events with layout invalidati ons.</p>
58 <div id="testElement">PASS</div> 54 <div id="testElement">PASS</div>
59 <iframe src="../resources/timeline-iframe-paint.html" style="position: absolute; left: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe> 55 <iframe src="../resources/timeline-iframe-paint.html" style="position: absolute; left: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe>
60 </body> 56 </body>
61 </html> 57 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698