Commit 4e492136 authored by Rune Lillesveen's avatar Rune Lillesveen Committed by Commit Bot

Deflake isolatedWorld media-query test.

The setTimeout with 0 delay caused notifyDone() to sometimes be called
too early. Instead add an event listener in the non-isolated world that
should be triggered when the media query changes and add an extra rAF()
in case the event listener is called first for the non-isolated world
handler.

The test still fails though, so the *expected.txt, which is now the same
for all platforms, needs to be kept.

The tests were marked with Timeout. If it turns out it is still slow on
some bots, we can add it to SlowTests.

The media query event handler argument had changed since the test was
written, so fixed the test itself as well.

Bug: 390452
Change-Id: I31c370601d932152adeb16bdffc59e4b68a2907d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2041476Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#739087}
parent 92461a00
......@@ -1962,8 +1962,6 @@ crbug.com/410974 virtual/threaded-prefer-compositing/fast/scroll-behavior/scroll
crbug.com/410974 virtual/threaded-prefer-compositing/fast/scroll-behavior/scroll-customization/scrollstate-distribute-to-scroll-chain-descendant.html [ Pass Failure ]
crbug.com/410974 virtual/threaded-prefer-compositing/fast/scroll-behavior/scroll-customization/touch-scroll-customization.html [ Pass Failure ]
crbug.com/390452 http/tests/security/isolatedWorld/media-query-wrapper-leaks.html [ Failure Pass Timeout ]
crbug.com/390452 virtual/isolated_world_csp/http/tests/security/isolatedWorld/media-query-wrapper-leaks.html [ Failure Pass Timeout ]
crbug.com/518987 http/tests/xmlhttprequest/navigation-abort-detaches-frame.html [ Pass Timeout ]
# These performance-sensitive user-timing tests are flaky in debug on all platforms, and flaky on all configurations of windows.
......
MediaQueryListener should be triggered in the isolated world that created the MediaQueryListener.
FAIL
PASS
......@@ -12,13 +12,13 @@ if (window.testRunner) {
testRunner.evaluateScriptInIsolatedWorld(1,
'var query = window.matchMedia("(-webkit-min-device-pixel-ratio: 3)");'+
'query.expando = "nyan";'+
'query.addListener(function (query) {'+
' document.querySelector("#result").innerHTML = query.expando === "nyan" ? "PASS" : "FAIL";'+
'query.addListener(function (event) {'+
' document.querySelector("#result").innerHTML = event.target.expando === "nyan" ? "PASS" : "FAIL";'+
'});');
let query = window.matchMedia("print");
query.addListener(() => requestAnimationFrame(() => testRunner.notifyDone()));
internals.settings.setMediaTypeOverride("print");
setTimeout(function () { testRunner.notifyDone(); }, 0);
</script>
</body>
</html>
MediaQueryListener should be triggered in the isolated world that created the MediaQueryListener.
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