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

Side by Side Diff: LayoutTests/inspector/tracing/timeline-paint-with-layout-invalidations-on-deleted-node.html

Issue 671913005: Implement layout invalidation tracking in devtools (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 months 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 | Annotate | Revision Log
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(callback) 7 function display(callback)
8 { 8 {
9 requestAnimationFrame(function() { 9 requestAnimationFrame(function() {
10 document.body.style.backgroundColor = "blue"; 10 document.body.style.backgroundColor = "blue";
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 InspectorTest.assertGreaterOrEqual(invalidations[2].stackTrace.l ength, 1); 51 InspectorTest.assertGreaterOrEqual(invalidations[2].stackTrace.l ength, 1);
52 InspectorTest.assertEquals(invalidations[3].type, WebInspector.T racingTimelineModel.RecordType.LayoutInvalidationTracking); 52 InspectorTest.assertEquals(invalidations[3].type, WebInspector.T racingTimelineModel.RecordType.LayoutInvalidationTracking);
53 InspectorTest.assertEquals(invalidations[3].nodeName, "DIV id='t estElement'"); 53 InspectorTest.assertEquals(invalidations[3].nodeName, "DIV id='t estElement'");
54 InspectorTest.assertGreaterOrEqual(invalidations[3].stackTrace.l ength, 1); 54 InspectorTest.assertGreaterOrEqual(invalidations[3].stackTrace.l ength, 1);
55 InspectorTest.invokeAsyncWithTimeline("updateSubframeAndDisplay" , next); 55 InspectorTest.invokeAsyncWithTimeline("updateSubframeAndDisplay" , next);
56 }); 56 });
57 }, 57 },
58 58
59 function testSubframe(next) 59 function testSubframe(next)
60 { 60 {
61 // The first paint corresponds to the local frame and should have no invalidations.
61 var firstPaintRecord = InspectorTest.findFirstTimelineRecord(WebInsp ector.TimelineModel.RecordType.Paint); 62 var firstPaintRecord = InspectorTest.findFirstTimelineRecord(WebInsp ector.TimelineModel.RecordType.Paint);
62 var secondPaintRecord = undefined;
63
64 function findSecondPaint(record)
65 {
66 if (record.type() !== WebInspector.TimelineModel.RecordType.Pain t)
67 return false;
68 if (record === firstPaintRecord)
69 return false;
70 secondPaintRecord = record;
71 return true;
72 }
73 InspectorTest.timelineModel().forAllRecords(findSecondPaint);
74
75 // The first paint corresponds to the local frame and should have no invalidations.
76 var firstInvalidations = firstPaintRecord._event.invalidationTrackin gEvents; 63 var firstInvalidations = firstPaintRecord._event.invalidationTrackin gEvents;
77 InspectorTest.assertEquals(firstInvalidations, undefined); 64 InspectorTest.assertEquals(firstInvalidations, undefined);
78 65
79 // The second paint corresponds to the subframe and should have our layout/style invalidations. 66 // The second paint corresponds to the subframe and should have our layout/style invalidations.
67 var secondPaintRecord = InspectorTest.findTimelineRecord(WebInspecto r.TimelineModel.RecordType.Paint, 1);
80 var secondInvalidations = secondPaintRecord._event.invalidationTrack ingEvents; 68 var secondInvalidations = secondPaintRecord._event.invalidationTrack ingEvents;
81 InspectorTest.assertEquals(secondInvalidations.length, 3); 69 InspectorTest.assertEquals(secondInvalidations.length, 3);
82 InspectorTest.assertEquals(secondInvalidations[0].type, WebInspector .TracingTimelineModel.RecordType.StyleRecalcInvalidationTracking); 70 InspectorTest.assertEquals(secondInvalidations[0].type, WebInspector .TracingTimelineModel.RecordType.StyleRecalcInvalidationTracking);
83 InspectorTest.assertEquals(secondInvalidations[0].nodeName, "DIV"); 71 InspectorTest.assertEquals(secondInvalidations[0].nodeName, "DIV");
84 InspectorTest.assertEquals(secondInvalidations[1].type, WebInspector .TracingTimelineModel.RecordType.LayoutInvalidationTracking); 72 InspectorTest.assertEquals(secondInvalidations[1].type, WebInspector .TracingTimelineModel.RecordType.LayoutInvalidationTracking);
85 InspectorTest.assertEquals(secondInvalidations[1].nodeName, "DIV"); 73 InspectorTest.assertEquals(secondInvalidations[1].nodeName, "DIV");
86 InspectorTest.assertGreaterOrEqual(secondInvalidations[1].stackTrace .length, 1); 74 InspectorTest.assertGreaterOrEqual(secondInvalidations[1].stackTrace .length, 1);
87 InspectorTest.assertEquals(secondInvalidations[2].type, WebInspector .TracingTimelineModel.RecordType.LayoutInvalidationTracking); 75 InspectorTest.assertEquals(secondInvalidations[2].type, WebInspector .TracingTimelineModel.RecordType.LayoutInvalidationTracking);
88 InspectorTest.assertEquals(secondInvalidations[2].nodeName, "DIV"); 76 InspectorTest.assertEquals(secondInvalidations[2].nodeName, "DIV");
89 InspectorTest.assertGreaterOrEqual(secondInvalidations[2].stackTrace .length, 1); 77 InspectorTest.assertGreaterOrEqual(secondInvalidations[2].stackTrace .length, 1);
90 next(); 78 next();
91 } 79 }
92 ]); 80 ]);
93 } 81 }
94 </script> 82 </script>
95 </head> 83 </head>
96 <body onload="runTest()"> 84 <body onload="runTest()">
97 <p>Tests the Timeline API instrumentation of layout invalidations on a deleted n ode.</p> 85 <p>Tests the Timeline API instrumentation of layout invalidations on a deleted n ode.</p>
98 <div id="testElement">FAIL - this should not be present when the test finishes.< /div> 86 <div id="testElement">FAIL - this should not be present when the test finishes.< /div>
99 <iframe src="resources/timeline-iframe-paint.html" style="position: absolute; le ft: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe> 87 <iframe src="resources/timeline-iframe-paint.html" style="position: absolute; le ft: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe>
100 </body> 88 </body>
101 </html> 89 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698