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

Unified Diff: LayoutTests/inspector/tracing/layer-tree.html

Issue 717243002: Timeline: do not imply event.thread.target is the main target (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: avoid keep stale model in TimelineFrameModel Created 6 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/inspector/tracing/layer-tree.html
diff --git a/LayoutTests/inspector/layers/tracing-layer-tree.html b/LayoutTests/inspector/tracing/layer-tree.html
similarity index 58%
rename from LayoutTests/inspector/layers/tracing-layer-tree.html
rename to LayoutTests/inspector/tracing/layer-tree.html
index b90e11223fd91e03111cf915c5c10b24e2e45003..381e24bf74a832f18c8647abd6a1e2d1a4d6204b 100644
--- a/LayoutTests/inspector/layers/tracing-layer-tree.html
+++ b/LayoutTests/inspector/tracing/layer-tree.html
@@ -1,6 +1,7 @@
<html>
<head>
<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../http/tests/inspector/timeline-test.js"></script>
<script src="../../http/tests/inspector/layers-test.js"></script>
<script src="../tracing-test.js"></script>
@@ -20,36 +21,32 @@ function doActions(callback)
callback();
return;
}
- testRunner.displayAsyncThen(callback);
+ var pendingFrames = 3;
+ makeFrame();
+ function makeFrame()
+ {
+ if (!--pendingFrames) {
+ callback();
+ return;
+ }
+ testRunner.displayAsyncThen(requestAnimationFrame.bind(window, makeFrame));
+ }
}
function test()
{
- InspectorTest.invokeWithTracing("doActions", onTracingComplete);
-
- var target = /** @type {!WebInspector.Target} */ (WebInspector.targetManager.mainTarget());
- var layerTree = new WebInspector.TracingLayerTree(target);
-
- function onTracingComplete()
- {
- var events = InspectorTest.tracingTimelineModel().inspectedTargetEvents();
- for (var i = events.length - 1; i >= 0; --i) {
- if (events[i].phase === WebInspector.TracingModel.Phase.SnapshotObject && events[i].name === "cc::LayerTreeHostImpl") {
- var rootLayer = events[i].args["snapshot"]["active_tree"]["root_layer"];
- dumpLayerTreeSnapshot(rootLayer);
- return;
- }
- }
- InspectorTest.addResult("FAIL: cc::LayerTreeHostImpl snapshot not found");
- InspectorTest.completeTest();
- }
+ WebInspector.panels.timeline._captureLayersAndPicturesSetting.set(true);
- function dumpLayerTreeSnapshot(rootLayer)
+ InspectorTest.invokeAsyncWithTimeline("doActions", step1);
+ function step1()
{
- layerTree.setLayers(rootLayer, onLayersSet);
+ var frames = InspectorTest.timelineFrameModel().frames();
+ var lastFrame = InspectorTest.timelineFrameModel().frames().peekLast();
+ var deferredLayerTree = lastFrame.layerTree;
+ deferredLayerTree.resolve(InspectorTest.safeWrap(layerTreeResolved));
}
- function onLayersSet()
+ function layerTreeResolved(layerTree)
{
InspectorTest.layerTreeModel.setLayerTree(layerTree);
InspectorTest.dumpLayerTree();
« no previous file with comments | « LayoutTests/inspector/tracing/frame-model.html ('k') | LayoutTests/inspector/tracing/layer-tree-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698