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

Unified Diff: third_party/WebKit/LayoutTests/compositing/overflow/opt-in-if-composited.html

Issue 2393443002: Adjust compositing tests to be SPv2-compatible. (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/compositing/overflow/opt-in-if-composited.html
diff --git a/third_party/WebKit/LayoutTests/compositing/overflow/opt-in-if-composited.html b/third_party/WebKit/LayoutTests/compositing/overflow/opt-in-if-composited.html
index b73087ddf3ad1db0a22ca943801bfef0c6d8750e..de7d1112610d46d059dcf6a66fb75619b7a82c3b 100644
--- a/third_party/WebKit/LayoutTests/compositing/overflow/opt-in-if-composited.html
+++ b/third_party/WebKit/LayoutTests/compositing/overflow/opt-in-if-composited.html
@@ -1,4 +1,5 @@
<!DOCTYPE HTML>
+<script src="resources/composited-scroll.js"></script>
<script>
if (window.internals)
window.internals.settings.setPreferCompositingToLCDTextEnabled(false);
@@ -8,24 +9,12 @@ if (window.testRunner) {
window.testRunner.waitUntilDone();
}
-function isUsingCompositedScrolling(layer) {
- if (layer.bounds[1] == 1000)
- return true;
- if (layer.children) {
- for (var i = 0; i < layer.children.length; i++) {
- if (isUsingCompositedScrolling(layer.children[i]))
- return true;
- }
- }
- return false;
-}
-
var result = "";
onload = function() {
if (window.internals) {
result += "Should not be using composited scrolling: ";
- if (!isUsingCompositedScrolling(JSON.parse(window.internals.layerTreeAsText(document))))
+ if (!isUsingCompositedScrolling(JSON.parse(window.internals.layerTreeAsText(document, window.internals.OUTPUT_CHILDREN_AS_LAYER_LIST))))
result += "Pass.\n";
else
result += "Fail.\n"
@@ -35,7 +24,7 @@ onload = function() {
requestAnimationFrame(function() {
if (window.internals) {
result += "Should be using composited scrolling (since we're compositing anyhow): ";
- if (isUsingCompositedScrolling(JSON.parse(window.internals.layerTreeAsText(document))))
+ if (isUsingCompositedScrolling(JSON.parse(window.internals.layerTreeAsText(document, window.internals.OUTPUT_CHILDREN_AS_LAYER_LIST))))
result += "Pass.\n";
else
result += "Fail.\n"
@@ -45,7 +34,7 @@ onload = function() {
requestAnimationFrame(function() {
if (window.internals) {
result += "Should not be using composited scrolling (since we've lost our direct reason): ";
- if (!isUsingCompositedScrolling(JSON.parse(window.internals.layerTreeAsText(document))))
+ if (!isUsingCompositedScrolling(JSON.parse(window.internals.layerTreeAsText(document, window.internals.OUTPUT_CHILDREN_AS_LAYER_LIST))))
result += "Pass.\n";
else
result += "Fail.\n"

Powered by Google App Engine
This is Rietveld 408576698