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

Unified Diff: LayoutTests/fast/repaint/resources/text-based-repaint.js

Issue 205263004: Convert svg repaint tests to pixel test only repaint (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove fixedpos Created 6 years, 9 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/fast/repaint/resources/text-based-repaint.js
diff --git a/LayoutTests/fast/repaint/resources/text-based-repaint.js b/LayoutTests/fast/repaint/resources/text-based-repaint.js
index 5b3a3eb1c14dfebe5844def361c57640816df4ee..c9526652ffb5a46476707a6f2f0a0a4c4c977fa2 100644
--- a/LayoutTests/fast/repaint/resources/text-based-repaint.js
+++ b/LayoutTests/fast/repaint/resources/text-based-repaint.js
@@ -1,5 +1,6 @@
// Asynchronous tests should manually call finishRepaintTest at the appropriate time.
window.testIsAsync = false;
+window.outputRepaintRects = true;
function runRepaintTest()
{
@@ -26,6 +27,13 @@ function runRepaintTest()
finishRepaintTest();
}
+function runRepaintAndPixelTest()
+{
+ window.enablePixelTesting = true;
+ window.outputRepaintRects = false;
+ runRepaintTest();
+}
+
function forceStyleRecalc()
{
if (document.body)
@@ -43,10 +51,20 @@ function finishRepaintTest()
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) {
+ if (document.body) {
+ var root = document.body;
+ } else if (document.documentElement) {
+ var root = document.createElementNS('http://www.w3.org/2000/svg', 'foreignObject');
+ document.documentElement.appendChild(root);
+ }
+ var pre = document.createElementNS('http://www.w3.org/1999/xhtml', 'pre');
+ // Make this element appear in text dumps, but try to avoid affecting
+ // output pixels (being visible, creating overflow, &c).
+ pre.style.opacity = 0;
+ pre.textContent += repaintRects;
+ root.appendChild(pre);
+ }
if (window.afterTest)
window.afterTest();
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/svg/as-background-image/svg-background-partial-redraw.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698