Commit 5ee14a91 authored by David Bokan's avatar David Bokan Committed by Commit Bot

Deflake set-rootscroller-before-load.html

Additional test to chcanges landed in r531871

Bug: 804813
Change-Id: I9684318423e2e00ee20a4f5504e0420ecf8d080c
Reviewed-on: https://chromium-review.googlesource.com/886561Reviewed-by: default avatarXianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#531938}
parent 49c5cc87
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<link rel=match href=set-root-scroller-before-load.html> <link rel=match href=set-root-scroller-before-load.html>
<script src="../resources/testharness.js"></script> <script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script> <script src="../resources/testharnessreport.js"></script>
<script src="../resources/run-after-layout-and-paint.js"></script>
<script> <script>
// Set the browser controls to be 100px and hidden. // Set the browser controls to be 100px and hidden.
// NOTE: It is important that this test be run with the Android viewport // NOTE: It is important that this test be run with the Android viewport
...@@ -10,7 +11,6 @@ ...@@ -10,7 +11,6 @@
if (window.internals) { if (window.internals) {
window.internals.setBrowserControlsState(100, 0, false); window.internals.setBrowserControlsState(100, 0, false);
testRunner.setShouldGeneratePixelResults(true); testRunner.setShouldGeneratePixelResults(true);
testRunner.waitUntilDone();
} }
addEventListener("load", function() { addEventListener("load", function() {
...@@ -18,15 +18,14 @@ ...@@ -18,15 +18,14 @@
const scroller = iframe.contentDocument.getElementById("scroller"); const scroller = iframe.contentDocument.getElementById("scroller");
document.rootScroller = iframe; document.rootScroller = iframe;
iframe.contentDocument.rootScroller = scroller; iframe.contentDocument.rootScroller = scroller;
requestAnimationFrame(() => { runAfterLayoutAndPaint(() => {
assert_equals( assert_equals(
internals.effectiveRootScroller(document), iframe, internals.effectiveRootScroller(document), iframe,
"rootScroller in main document should be iframe."); "rootScroller in main document should be iframe.");
assert_equals( assert_equals(
internals.effectiveRootScroller(iframe.contentDocument), scroller, internals.effectiveRootScroller(iframe.contentDocument), scroller,
"rootScroller in iframe should be scroller element."); "rootScroller in iframe should be scroller element.");
testRunner.notifyDone(); }, true);
});
}); });
</script> </script>
<style> <style>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment