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

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

Issue 1060973003: compositor-worker: Force elements to grow a layer when a CompositorProxy is created. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: tot-merge Created 5 years, 8 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/fast/compositorworker/resources/proxy-idle.js ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/CompositorProxy/proxy-forces-layer.html
diff --git a/LayoutTests/fast/dom/CompositorProxy/proxy-forces-layer.html b/LayoutTests/fast/dom/CompositorProxy/proxy-forces-layer.html
new file mode 100644
index 0000000000000000000000000000000000000000..4ecbf97fc7f542c0eeca61f1f566935de83c4aeb
--- /dev/null
+++ b/LayoutTests/fast/dom/CompositorProxy/proxy-forces-layer.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<div id="container"></div>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script>
+async_test(function(test) {
+ if (!window.internals)
+ return;
+ 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);
+
+ // Creating a proxy should force the container to have a layer.
+ var proxy = new CompositorProxy(container, ['opacity']);
+ docLayer = JSON.parse(window.internals.layerTreeAsText(document));
+ assert_equals(1, docLayer.children.length);
+ assert_equals(1, docLayer.children[0].children.length);
+
+ // 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);
+
+ // Add the element back to the document. The corresponding layer should reappear.
+ document.body.appendChild(container);
+ docLayer = JSON.parse(window.internals.layerTreeAsText(document));
+ assert_equals(1, docLayer.children.length);
+ assert_equals(1, docLayer.children[0].children.length);
+
+ // 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);
+
+ test.done();
+ });
+}, "This test checks that creating a CompositorProxy forces the element to have a layer");
+</script>
« no previous file with comments | « LayoutTests/fast/compositorworker/resources/proxy-idle.js ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698