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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/CompositorProxy/proxy-forces-layer.html

Issue 2397333002: Change layerTreeAsText to default to layer lists. (Closed)
Patch Set: none Created 4 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: third_party/WebKit/LayoutTests/fast/dom/CompositorProxy/proxy-forces-layer.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/CompositorProxy/proxy-forces-layer.html b/third_party/WebKit/LayoutTests/fast/dom/CompositorProxy/proxy-forces-layer.html
index 254bf74871619cba0f852e3ce85771b7a93691e2..02698c55655914ca083b39ad37f9463a566cfef6 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/CompositorProxy/proxy-forces-layer.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/CompositorProxy/proxy-forces-layer.html
@@ -9,35 +9,31 @@ async_test(function(test) {
window.addEventListener('load', function() {
// The container should not have a layer.
var container = document.getElementById('container');
- var docLayer = JSON.parse(window.internals.layerTreeAsText(document));
- assert_equals(1, docLayer.children.length);
- assert_equals('undefined', typeof docLayer.children[0].children);
+ var layers = JSON.parse(window.internals.layerTreeAsText(document))["layers"];
+ assert_equals(1, layers.length);
// Creating a proxy should force the container to have a layer.
var proxy = new CompositorProxy(container, ['opacity']);
- docLayer = JSON.parse(window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_COMPOSITING_REASONS));
- assert_equals(1, docLayer.children.length);
- assert_equals(1, docLayer.children[0].children.length);
- assert_in_array('compositorProxy', docLayer.children[0].children[0].compositingReasons);
+ layers = JSON.parse(window.internals.layerTreeAsText(document,
+ internals.LAYER_TREE_INCLUDES_COMPOSITING_REASONS))["layers"];
+ assert_equals(2, layers.length);
+ assert_in_array('compositorProxy', layers[1].compositingReasons);
// Detach the element from the document. The corresponding layer should be removed.
container.parentNode.removeChild(container);
- docLayer = JSON.parse(window.internals.layerTreeAsText(document));
- assert_equals(1, docLayer.children.length);
- assert_equals('undefined', typeof docLayer.children[0].children);
+ layers = JSON.parse(window.internals.layerTreeAsText(document))["layers"];
+ assert_equals(1, layers.length);
// Add the element back to the document. The corresponding layer should reappear.
document.body.appendChild(container);
- docLayer = JSON.parse(window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_COMPOSITING_REASONS));
- assert_equals(1, docLayer.children.length);
- assert_equals(1, docLayer.children[0].children.length);
- assert_in_array('compositorProxy', docLayer.children[0].children[0].compositingReasons);
+ layers = JSON.parse(window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_COMPOSITING_REASONS))["layers"];
+ assert_equals(2, layers.length);
+ assert_in_array('compositorProxy', layers[1].compositingReasons);
// Disconnecting the proxy should also remove the layer.
proxy.disconnect();
- docLayer = JSON.parse(window.internals.layerTreeAsText(document));
- assert_equals(1, docLayer.children.length);
- assert_equals('undefined', typeof docLayer.children[0].children);
+ layers = JSON.parse(window.internals.layerTreeAsText(document))["layers"];
+ assert_equals(1, layers.length);
test.done();
});

Powered by Google App Engine
This is Rietveld 408576698