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

Unified Diff: LayoutTests/inspector/tracing/paint-profiler-update.html

Issue 1162223002: DevTools: properly update paint profiler upon new event being set (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: skip the test under virtual/deferred Created 5 years, 6 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
« no previous file with comments | « LayoutTests/NeverFixTests ('k') | LayoutTests/inspector/tracing/paint-profiler-update-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/inspector/tracing/paint-profiler-update.html
diff --git a/LayoutTests/inspector/tracing/paint-profiler-update.html b/LayoutTests/inspector/tracing/paint-profiler-update.html
new file mode 100644
index 0000000000000000000000000000000000000000..1dfcf2d348102f8e557b93ead0c6806814408f7b
--- /dev/null
+++ b/LayoutTests/inspector/tracing/paint-profiler-update.html
@@ -0,0 +1,86 @@
+<html>
+<head>
+<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../http/tests/inspector/timeline-test.js"></script>
+<script src="../tracing-test.js"></script>
+<script>
+function performActions(callback)
+{
+ var square = document.getElementById("square");
+ step1();
+
+ function step1()
+ {
+ square.style.backgroundColor = "red";
+ testRunner.layoutAndPaintAsyncThen(step2);
+ }
+
+ function step2()
+ {
+ square.style.backgroundColor = "black";
+ testRunner.layoutAndPaintAsyncThen(callback);
+ }
+}
+
+function test()
+{
+ var panel = WebInspector.panels.timeline;
+
+ panel._captureLayersAndPicturesSetting.set(true);
+ panel._flameChartEnabledSetting.set(true);
+ panel._onModeChanged();
+
+ InspectorTest.invokeAsyncWithTimeline("performActions", onRecordingDone);
+ var paintEvents = [];
+ function onRecordingDone()
+ {
+ var events = InspectorTest.tracingTimelineModel()._mainThreadEvents;
+ for (var event of events) {
+ if (event.name === WebInspector.TimelineModel.RecordType.Paint) {
+ paintEvents.push(event);
+ if (!event.picture)
+ InspectorTest.addResult("Event without picture at " + paintEvents.length);
+ }
+ }
+
+ if (paintEvents.length < 2)
+ throw new Error("FAIL: Expect at least two paint events");
+
+ InspectorTest.addSniffer(panel, "_appendDetailsTabsForTraceEventAndShowDetails", onRecordDetailsReady, false);
+ panel.select(WebInspector.TimelineSelection.fromTraceEvent(paintEvents[0]), WebInspector.TimelinePanel.DetailsTab.PaintProfiler);
+ }
+
+ function onRecordDetailsReady()
+ {
+ var updateCount = 0;
+ var paintProfilerView = panel._lazyPaintProfilerView._paintProfilerView;
+ InspectorTest.addSniffer(paintProfilerView, "_update", onPaintProfilerUpdate, true);
+
+ function onPaintProfilerUpdate()
+ {
+ // No snapshot, not a real update yet -- wait for another update!
+ if (!paintProfilerView._snapshot)
+ return;
+ var logSize = paintProfilerView._log && paintProfilerView._log.length ? ">0" : "0";
+ InspectorTest.addResult("Paint " + updateCount + " log size: " + logSize);
+ if (updateCount++)
+ InspectorTest.completeTest();
+ else
+ panel.select(WebInspector.TimelineSelection.fromTraceEvent(paintEvents[1]), WebInspector.TimelinePanel.DetailsTab.PaintProfiler);
+ }
+ }
+
+}
+
+</script>
+</head>
+
+<body onload="runTest()">
+<p>
+Tests that paint profiler is properly update when an event is selected in Flame Chart
+</p>
+
+<div id="square" style="width: 40px; height: 40px"></div>
+
+</body>
+</html>
« no previous file with comments | « LayoutTests/NeverFixTests ('k') | LayoutTests/inspector/tracing/paint-profiler-update-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698