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

Unified Diff: LayoutTests/inspector/tracing/timeline-layout-invalidations.html

Issue 653283005: Implement style recalc invalidation tracking in devtools (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix minor typeo: _addInvalidationTrackingEvent 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/inspector/tracing/timeline-layout-invalidations.html
diff --git a/LayoutTests/inspector/tracing/timeline-layout-invalidations.html b/LayoutTests/inspector/tracing/timeline-layout-invalidations.html
deleted file mode 100644
index 4a6173418a725670a8fe526c09ec3225304b5740..0000000000000000000000000000000000000000
--- a/LayoutTests/inspector/tracing/timeline-layout-invalidations.html
+++ /dev/null
@@ -1,94 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<script src="../../http/tests/inspector/inspector-test.js"></script>
-<script src="../../http/tests/inspector/timeline-test.js"></script>
-<script>
-function display(callback)
-{
- requestAnimationFrame(function() {
- document.body.style.backgroundColor = "blue";
- document.getElementById("testElement").style.width = "100px";
- var forceLayout = document.body.offsetTop;
- if (window.testRunner)
- testRunner.displayAsyncThen(callback);
- });
-}
-
-function updateSubframeAndDisplay(callback)
-{
- requestAnimationFrame(function() {
- frames[0].document.body.children[0].style.width = "200px";
- var forceLayout = frames[0].document.body.offsetTop;
- if (window.testRunner)
- testRunner.displayAsyncThen(callback);
- });
-}
-
-function test()
-{
- var currentPanel = WebInspector.inspectorView.currentPanel();
- InspectorTest.assertEquals(currentPanel._panelName, "timeline", "Current panel should be the timeline.");
- Runtime.experiments.enableForTest("timelineInvalidationTracking");
-
- InspectorTest.runTestSuite([
- function testLocalFrame(next)
- {
- InspectorTest.invokeAsyncWithTimeline("display", function() {
- var record = InspectorTest.findFirstTimelineRecord(WebInspector.TimelineModel.RecordType.Paint);
- var invalidations = record._event.invalidationTrackingEvents;
- InspectorTest.assertEquals(invalidations.length, 3);
- InspectorTest.assertEquals(invalidations[0].type, WebInspector.TracingTimelineModel.RecordType.StyleRecalcInvalidationTracking);
- InspectorTest.assertEquals(invalidations[0].nodeName, "BODY");
- InspectorTest.assertEquals(invalidations[1].type, WebInspector.TracingTimelineModel.RecordType.StyleRecalcInvalidationTracking);
- InspectorTest.assertEquals(invalidations[1].nodeName, "DIV id='testElement'");
- InspectorTest.assertEquals(invalidations[2].type, WebInspector.TracingTimelineModel.RecordType.LayoutInvalidationTracking);
- InspectorTest.assertEquals(invalidations[2].nodeName, "DIV id='testElement'");
- InspectorTest.assertGreaterOrEqual(invalidations[2].stackTrace.length, 1);
- InspectorTest.invokeAsyncWithTimeline("updateSubframeAndDisplay", next);
- });
- },
-
- function testSubframe(next)
- {
- var firstPaintRecord = InspectorTest.findFirstTimelineRecord(WebInspector.TimelineModel.RecordType.Paint);
- var secondPaintRecord = undefined;
-
- function findSecondPaint(record)
- {
- if (record.type() !== WebInspector.TimelineModel.RecordType.Paint)
- return false;
- if (record === firstPaintRecord)
- return false;
- secondPaintRecord = record;
- return true;
- }
- InspectorTest.timelineModel().forAllRecords(findSecondPaint);
-
- // The first paint corresponds to the local frame and should have no invalidations.
- var firstInvalidations = firstPaintRecord._event.invalidationTrackingEvents;
- InspectorTest.assertEquals(firstInvalidations, undefined);
-
- // The second paint corresponds to the subframe and should have our layout/style invalidations.
- var secondInvalidations = secondPaintRecord._event.invalidationTrackingEvents;
- InspectorTest.assertEquals(secondInvalidations.length, 3);
- InspectorTest.assertEquals(secondInvalidations[0].type, WebInspector.TracingTimelineModel.RecordType.StyleRecalcInvalidationTracking);
- InspectorTest.assertEquals(secondInvalidations[0].nodeName, "DIV");
- InspectorTest.assertEquals(secondInvalidations[1].type, WebInspector.TracingTimelineModel.RecordType.LayoutInvalidationTracking);
- InspectorTest.assertEquals(secondInvalidations[1].nodeName, "DIV");
- InspectorTest.assertGreaterOrEqual(secondInvalidations[1].stackTrace.length, 1);
- InspectorTest.assertEquals(secondInvalidations[2].type, WebInspector.TracingTimelineModel.RecordType.LayoutInvalidationTracking);
- InspectorTest.assertEquals(secondInvalidations[2].nodeName, "#document");
- InspectorTest.assertGreaterOrEqual(secondInvalidations[2].stackTrace.length, 1);
- next();
- }
- ]);
-}
-</script>
-</head>
-<body onload="runTest()">
-<p>Tests the Timeline API instrumentation of layout invalidations.</p>
-<div id="testElement">PASS</div>
-<iframe src="resources/timeline-iframe-paint.html" style="position: absolute; left: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698