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

Unified Diff: third_party/WebKit/LayoutTests/fast/events/touch/touch-rect-crash-on-unpromote-layer.html

Issue 2609923002: Use runAfterLayoutAndPaint instead of requestAnimationFrame and (Closed)
Patch Set: update comment Created 3 years, 11 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: third_party/WebKit/LayoutTests/fast/events/touch/touch-rect-crash-on-unpromote-layer.html
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/touch-rect-crash-on-unpromote-layer.html b/third_party/WebKit/LayoutTests/fast/events/touch/touch-rect-crash-on-unpromote-layer.html
index 3779f3cda128cf0a7ad687050714352ce469a51b..a9926ceb75066d395dfc448007dad44ab09aa0a0 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/touch-rect-crash-on-unpromote-layer.html
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/touch-rect-crash-on-unpromote-layer.html
@@ -18,6 +18,7 @@
<div id="console"></div>
<script src="../../../resources/js-test.js"></script>
+<script src="../../../resources/run-after-layout-and-paint.js"></script>
<script>
jsTestIsAsync = true;
description("Make sure we don't crash when a layer with a touch event handler becomes non-composited");
@@ -38,17 +39,15 @@
// Make the layer non-composited
layer.className = '';
- // Verify we now have a hit rect on the document after waiting a frame.
- setTimeout(function() {
- window.requestAnimationFrame(function() {
- if (window.internals) {
- rects = window.internals.touchEventTargetLayerRects(document);
- shouldBe("rects.length", "1");
- shouldBeEqualToString("rects[0].layerAssociatedNode.nodeName", "#document");
- }
- finishJSTest();
- });
- }, 0);
+ // Verify we now have a hit rect on the document after layout and paint.
+ runAfterLayoutAndPaint(function() {
+ if (window.internals) {
+ rects = window.internals.touchEventTargetLayerRects(document);
+ shouldBe("rects.length", "1");
+ shouldBeEqualToString("rects[0].layerAssociatedNode.nodeName", "#document");
+ }
+ finishJSTest();
+ });
</script>
</body>
</html>
« 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