Commit 7f2dc44b authored by Alex Clarke's avatar Alex Clarke Committed by Commit Bot

Fix flake in test_enable_print_browser.html with new scheduler policy

We want to prioritize compositing and loading tasks until FCP which
causes this test to flake. The problem is the test isn't waiting for
the load event to fire whch means it's sometimes running the asset
before the style sheet has loaded.  This patch makes it wait.

Bug: 971191
Change-Id: Ic7a53b2cbd52812e31de98c567d8d399c8b445b4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1800771
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Reviewed-by: default avatarAlexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#696741}
parent 6a5c8f69
...@@ -19,8 +19,15 @@ ...@@ -19,8 +19,15 @@
<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> <script>
test(function () { var t = async_test();
assert_equals(getComputedStyle(bodyText).fontSize, "40px") // The <style> is guaranteed to be set by the time this script runs, but print
}, "Checks if we are in print mode"); // mode is set via an IPC which races with the loading task which runs this
// script. We get @media screen until that IPC is processed.
window.onload = function() {
t.step(function () {
assert_equals(getComputedStyle(bodyText).fontSize, "40px")
}, "Checks if we are in print mode");
t.done();
};
</script> </script>
</html> </html>
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