Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / repaint / resources / text-based-repaint.js
index 5b3a3eb..d838ec3 100644 (file)
@@ -1,5 +1,9 @@
 // Asynchronous tests should manually call finishRepaintTest at the appropriate time.
 window.testIsAsync = false;
+window.outputRepaintRects = true;
+
+if (window.internals)
+    window.internals.settings.setForceCompositingMode(true)
 
 function runRepaintTest()
 {
@@ -26,6 +30,12 @@ function runRepaintTest()
         finishRepaintTest();
 }
 
+function runRepaintAndPixelTest()
+{
+    window.enablePixelTesting = true;
+    runRepaintTest();
+}
+
 function forceStyleRecalc()
 {
     if (document.body)
@@ -39,14 +49,12 @@ function finishRepaintTest()
     // Force a style recalc.
     forceStyleRecalc();
 
-    var repaintRects = window.internals.repaintRectsAsText(document);
+    var repaintRects = window.internals.layerTreeAsText(document, window.internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
 
     internals.stopTrackingRepaints(document);
 
-    var pre = document.createElement('pre');
-    pre.style.opacity = 0;  // appear in text dumps, but not images
-    document.body.appendChild(pre);
-    pre.textContent += repaintRects;
+    if (window.outputRepaintRects)
+        testRunner.setCustomTextOutput(repaintRects);
 
     if (window.afterTest)
         window.afterTest();