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

Unified Diff: LayoutTests/paint/invalidation/spv2/resources/paint-invalidation-test.js

Issue 1340423004: Change output method of paint invalidation failure message (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/paint/invalidation/spv2/resources/paint-invalidation-test.js
diff --git a/LayoutTests/paint/invalidation/spv2/resources/paint-invalidation-test.js b/LayoutTests/paint/invalidation/spv2/resources/paint-invalidation-test.js
index efbedb7b1033476f44d1c94af8c357f83a007c80..f1e1c8d331ed87bafcde90ea426cf66cbe27a508 100644
--- a/LayoutTests/paint/invalidation/spv2/resources/paint-invalidation-test.js
+++ b/LayoutTests/paint/invalidation/spv2/resources/paint-invalidation-test.js
@@ -40,22 +40,51 @@ function finishPaintInvalidationTest()
testRunner.layoutAndPaintAsyncThen(function()
{
- document.body.offsetTop;
ojan 2015/09/19 03:15:57 Doesn't removing this make your tests flaky becaus
var paintInvalidationObjects = JSON.stringify(internals.trackedPaintInvalidationObjects());
var expectedPaintInvalidationObjects = JSON.stringify(window.expectedPaintInvalidationObjects);
internals.stopTrackingPaintInvalidationObjects();
if (paintInvalidationObjects != expectedPaintInvalidationObjects) {
- var message = 'Paint invalidation objects mismatch.'
+ testRunner.logToStderr('Paint invalidation objects mismatch.'
+ '\nExpected:\n' + expectedPaintInvalidationObjects.replace(/","/g, '",\n "')
- + '\nActual:\n' + paintInvalidationObjects.replace(/","/g, '",\n "');
- testRunner.logToStderr(message);
- while (document.body.firstChild)
- document.body.removeChild(document.body.firstChild);
- var pre = document.createElement('pre');
- pre.appendChild(document.createTextNode('(To copy results as text, see stderr.)\n\n' + message));
- document.body.appendChild(pre);
+ + '\nActual:\n' + paintInvalidationObjects.replace(/","/g, '",\n "'));
+
+ if (document.rootElement && document.rootElement.nodeName == "svg") {
+ var svgns = "http://www.w3.org/2000/svg"
+ var rect = document.createElementNS(svgns, 'rect');
+ rect.setAttribute('width', '45%');
+ rect.setAttribute('height', '10%');
+ rect.setAttribute('x', '55%');
+ rect.setAttribute('fill', 'white');
+ rect.setAttribute('stroke', 'black');
+ rect.setAttribute('stroke-width', '1px');
+ document.documentElement.appendChild(rect);
+ var text = document.createElementNS(svgns, 'text');
+ text.setAttribute('x', '100%');
+ text.setAttribute('y', '5%');
+ text.setAttribute('text-anchor', 'end');
+ text.textContent = "Paint invalidation objects mismatch. See stderr for details.";
+ document.documentElement.appendChild(text);
+ } else {
+ var div = document.createElement('div');
+ div.style.zIndex = '2147483647';
+ div.style.visibility = 'visible';
+ div.style.position = 'fixed';
+ div.style.top = '0';
+ div.style.right = '0';
+ div.style.width = '350px';
+ div.style.height = '16px';
+ div.style.color = 'black';
+ div.style.fontSize = '12px';
+ div.style.lineHeight = '14px';
+ div.style.fontFamily = 'Arial';
+ div.style.border = '1px solid black';
+ div.style.background = 'white';
+ div.appendChild(document.createTextNode('Paint invalidation objects mismatch. See stderr for details.'));
+ document.body.appendChild(div);
+ }
}
+
testRunner.notifyDone();
});
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698