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

Unified Diff: LayoutTests/compositing/sticky-compositing.html

Issue 24210010: Add layout test to verify that compositing is sticky. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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/compositing/sticky-compositing.html
diff --git a/LayoutTests/compositing/sticky-compositing.html b/LayoutTests/compositing/sticky-compositing.html
new file mode 100644
index 0000000000000000000000000000000000000000..9b5d2679fff5b7887d8781b3a2ae86cc7e1ac858
--- /dev/null
+++ b/LayoutTests/compositing/sticky-compositing.html
@@ -0,0 +1,36 @@
+<body>
+ <p>First layer tree:</p>
+ <p id='tree1'></p>
+ <p>Second layer tree:</p>
+ <p id='tree2'></p>
+ <p>Third layer tree:</p>
+ <p id='tree3'></p>
+ <script>
+ testRunner.dumpAsText();
+
+ // Dump the tree (should be empty because compositing hasn't been triggered)
+ if (window.testRunner)
+ document.getElementById('tree1').innerHTML = window.internals.layerTreeAsText(document);
+
+ // Trigger compositing by adding a div with translateZ(0)
+ var compositing_div = document.createElement("div");
+ compositing_div.id = "compositing_div";
+ compositing_div.style.webkitTransform = "translateZ(0)";
+ compositing_div.innerText = "compositing trigger";
+ document.body.appendChild(compositing_div);
+
+ // Dump the tree (should be filled because compositing is triggered)
+ if (window.testRunner)
+ document.getElementById('tree2').innerHTML = window.internals.layerTreeAsText(document);
+
+ // Remove the compositing trigger.
+ document.body.removeChild(compositing_div);
+ delete compositing_div;
+
+ // Dump the tree (should stay filled because compositing is sticky, even though the trigger is gone.)
+ if (window.testRunner) {
+ document.getElementById('tree3').innerHTML = window.internals.layerTreeAsText(document);
+ testRunner.notifyDone();
+ }
+ </script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698