Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/repaint/obscured-background-no-repaint.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/repaint/obscured-background-no-repaint.html b/third_party/WebKit/LayoutTests/fast/repaint/obscured-background-no-repaint.html |
| index d3728103ff1fcabf5e1d74f14f883cdd7d05b0c2..2988fb9a85c44deb80af64e14448329f88c369cd 100644 |
| --- a/third_party/WebKit/LayoutTests/fast/repaint/obscured-background-no-repaint.html |
| +++ b/third_party/WebKit/LayoutTests/fast/repaint/obscured-background-no-repaint.html |
| @@ -1,6 +1,5 @@ |
| <html> |
| <head> |
| -<script src="../../resources/run-after-layout-and-paint.js"></script> |
| <style type="text/css"> |
| #test1 div { |
| height: 100px; |
| @@ -59,21 +58,19 @@ |
| var layerTree = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_PAINT_INVALIDATIONS); |
| var invalidations = JSON.parse(layerTree).objectPaintInvalidations; |
| // Passes if there is no invalidations, |
| - // or only invalidations because of background obscuration change. |
| - // This is because before the delayed image decoder finishes decoding the image, |
| - // we first assume the image is not opaque. If the image is found actually opaque |
| - // after decoding, the background obscuration status of covered elements will |
| - // change and cause paint invalidation. |
| + // or only invalidations because of background obscuration change. |
| + // This is because before the delayed image decoder finishes decoding the image, |
| + // we first assume the image is not opaque. If the image is found actually opaque |
| + // after decoding, the background obscuration status of covered elements will |
| + // change and cause paint invalidation. |
| var invalidatedObjects = {}; |
| - for (var i = 0; i < invalidations.length; ++i) { |
| - var object = invalidations[i].object; |
| - // Paint invalidation of target3 and target4 depends on opaqueness of the foreground image (apple.jpg). |
| - // Because of delayed image decoding, we may get actual opaqueness of the image after the test is started. |
| - // Omit paint invalidations so far if we see 'background obscuration change' for these targets. |
| - if ((object.indexOf('target3') != -1 || object.indexOf('target4') != -1) && invalidations[i].reason == 'background obscuration change') |
| - delete invalidatedObjects[object]; |
| - else |
| + if (invalidations) { |
|
chrishtr
2016/08/11 17:33:44
Why would |invalidations| sometimes be false in a
Xianzhu
2016/08/11 18:10:07
It will be undefined if there is no invalidations.
|
| + for (var i = 0; i < invalidations.length; ++i) { |
| + var object = invalidations[i].object; |
| + if ((object.indexOf('target3') != -1 || object.indexOf('target4') != -1) && invalidations[i].reason == 'background obscuration change') |
| + continue; |
| invalidatedObjects[object] = true; |
| + } |
| } |
| if (Object.keys(invalidatedObjects).length) |
| @@ -87,7 +84,8 @@ |
| if (!window.testRunner || !window.internals) |
| return; |
| - runAfterLayoutAndPaint(function() { |
| + // Ensure the deferred decoder has decoded resources/apple.jpg. |
| + testRunner.capturePixelsAsyncThen(function() { |
| internals.startTrackingRepaints(document); |
| // Wait a while to let the animated gif advance frames. |
| setTimeout(finish, 300); |
|
chrishtr
2016/08/11 17:33:44
Use internals.advanceTimeForImage for this.
Xianzhu
2016/08/11 18:10:07
Tried it in the latest patch set, and modified cod
Xianzhu
2016/08/11 18:16:25
Never mind. I can reproduce the bug with internal.
|