OLD | NEW |
---|---|
1 // Asynchronous tests should manually call finishPaintInvalidationTest at the ap propriate time. | 1 // Asynchronous tests should manually call finishPaintInvalidationTest at the ap propriate time. |
2 window.testIsAsync = false; | 2 window.testIsAsync = false; |
3 | 3 |
4 // All paint invalidation tests are asynchronous from test-runner's point of vie w. | 4 // All paint invalidation tests are asynchronous from test-runner's point of vie w. |
5 if (window.testRunner) | 5 if (window.testRunner) |
6 testRunner.waitUntilDone(); | 6 testRunner.waitUntilDone(); |
7 | 7 |
8 function runPaintInvalidationTest() | 8 function runPaintInvalidationTest() |
9 { | 9 { |
10 if (!window.testRunner || !window.internals) { | 10 if (!window.testRunner || !window.internals) { |
(...skipping 28 matching lines...) Expand all Loading... | |
39 return; | 39 return; |
40 | 40 |
41 testRunner.layoutAndPaintAsyncThen(function() | 41 testRunner.layoutAndPaintAsyncThen(function() |
42 { | 42 { |
43 document.body.offsetTop; | 43 document.body.offsetTop; |
44 var paintInvalidationObjects = JSON.stringify(internals.trackedPaintInva lidationObjects()); | 44 var paintInvalidationObjects = JSON.stringify(internals.trackedPaintInva lidationObjects()); |
45 var expectedPaintInvalidationObjects = JSON.stringify(window.expectedPai ntInvalidationObjects); | 45 var expectedPaintInvalidationObjects = JSON.stringify(window.expectedPai ntInvalidationObjects); |
46 internals.stopTrackingPaintInvalidationObjects(); | 46 internals.stopTrackingPaintInvalidationObjects(); |
47 | 47 |
48 if (paintInvalidationObjects != expectedPaintInvalidationObjects) { | 48 if (paintInvalidationObjects != expectedPaintInvalidationObjects) { |
49 // TODO(wangxianzhu): The following works for HTML only. Should supp ort SVG. | |
pdr.
2015/09/16 21:27:02
Lets support SVG:
function finishPaintInvalidatio
| |
49 var message = 'Paint invalidation objects mismatch.' | 50 var message = 'Paint invalidation objects mismatch.' |
50 + '\nExpected:\n' + expectedPaintInvalidationObjects.replace(/", "/g, '",\n "') | 51 + '\nExpected:\n' + expectedPaintInvalidationObjects.replace(/", "/g, '",\n "') |
51 + '\nActual:\n' + paintInvalidationObjects.replace(/","/g, '",\n "'); | 52 + '\nActual:\n' + paintInvalidationObjects.replace(/","/g, '",\n "'); |
52 testRunner.logToStderr(message); | 53 testRunner.logToStderr(message); |
53 while (document.body.firstChild) | 54 |
54 document.body.removeChild(document.body.firstChild); | 55 var div = document.createElement('div'); |
55 var pre = document.createElement('pre'); | 56 div.style.zIndex = '2147483647'; |
56 pre.appendChild(document.createTextNode('(To copy results as text, s ee stderr.)\n\n' + message)); | 57 div.style.visibility = 'visible'; |
57 document.body.appendChild(pre); | 58 div.style.position = 'fixed'; |
59 div.style.top = '0'; | |
60 div.style.right = '0'; | |
61 div.style.width = '300px'; | |
62 div.style.height = '36px'; | |
63 div.style.color = 'red'; | |
64 div.style.fontSize = '14px'; | |
65 div.style.lineHeight = '16px'; | |
66 div.style.fontFamily = 'Arial'; | |
67 div.style.border = '1px solid red'; | |
68 div.style.background = 'none'; | |
pdr.
2015/09/16 21:27:02
Lets set the backgroundColor to white so the text
| |
69 div.appendChild(document.createTextNode('Paint invalidation objects mismatch.')); | |
70 div.appendChild(document.createElement('br')); | |
71 div.appendChild(document.createTextNode('See stderr for details.')); | |
72 document.body.appendChild(div); | |
58 } | 73 } |
59 testRunner.notifyDone(); | 74 testRunner.notifyDone(); |
60 }); | 75 }); |
61 } | 76 } |
OLD | NEW |