Commit 44bc7824 authored by Takayoshi Kochi's avatar Takayoshi Kochi Committed by Commit Bot

Delay the test execution to avoid flakiness

The frame's initialization code focuses the content from browser
process via an IPC (browser->renderer), but its handling in the
renderer can be delayed until after the test code script execution
is started.

This caused the test to have a race condition, that a focus event
is delivered where it is not expected, and resulted the flakiness.
The test can fail on the initial use of content_shell process.

Delay the execution of test function so that it will not be
affected by the frame initial focus event.

Bug: 863067
Change-Id: I475d912b0e9baffa3917212b2fc0735189381cb8
Reviewed-on: https://chromium-review.googlesource.com/1146523
Commit-Queue: Takayoshi Kochi <kochi@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577124}
parent e318f812
...@@ -4344,8 +4344,6 @@ crbug.com/806249 virtual/video-surface-layer/external/wpt/feature-policy/autopla ...@@ -4344,8 +4344,6 @@ crbug.com/806249 virtual/video-surface-layer/external/wpt/feature-policy/autopla
# Sheriff 2018-02-26 # Sheriff 2018-02-26
crbug.com/816475 [ Win7 Linux ] external/wpt/webrtc/RTCDTMFSender-ontonechange.https.html [ Failure Pass ] crbug.com/816475 [ Win7 Linux ] external/wpt/webrtc/RTCDTMFSender-ontonechange.https.html [ Failure Pass ]
crbug.com/816914 [ Mac ] fast/canvas/canvas-drawImage-live-video.html [ Failure Pass ] crbug.com/816914 [ Mac ] fast/canvas/canvas-drawImage-live-video.html [ Failure Pass ]
crbug.com/816766 [ Mac ] fast/dom/Window/window-focus-self.html [ Failure Pass ]
crbug.com/816766 [ Mac ] virtual/user-activation-v2/fast/dom/Window/window-focus-self.html [ Failure Pass ]
crbug.com/817167 http/tests/devtools/oopif/oopif-cookies-refresh.js [ Failure Timeout Pass ] crbug.com/817167 http/tests/devtools/oopif/oopif-cookies-refresh.js [ Failure Timeout Pass ]
# Sheriff 2018-03-02 # Sheriff 2018-03-02
...@@ -4627,9 +4625,6 @@ crbug.com/818324 [ Linux Mac Win7 ] external/wpt/content-security-policy/embedde ...@@ -4627,9 +4625,6 @@ crbug.com/818324 [ Linux Mac Win7 ] external/wpt/content-security-policy/embedde
# S13N Sheriff 2018-7-11 # S13N Sheriff 2018-7-11
crbug.com/862643 http/tests/serviceworker/navigation_preload/use-counter.html [ Failure Pass ] crbug.com/862643 http/tests/serviceworker/navigation_preload/use-counter.html [ Failure Pass ]
# Sheriff 2018-7-12
crbug.com/863067 [ Win10 ] virtual/user-activation-v2/fast/dom/Window/window-focus-self.html [ Failure Pass ]
# Sheriff 2018-7-13 # Sheriff 2018-7-13
crbug.com/863599 [ Linux Debug ] external/wpt/requestidlecallback/callback-iframe.html [ Pass Timeout ] crbug.com/863599 [ Linux Debug ] external/wpt/requestidlecallback/callback-iframe.html [ Pass Timeout ]
...@@ -4638,7 +4633,6 @@ crbug.com/864888 [ Mac ] editing/selection/offset-from-point-complex-scripts.htm ...@@ -4638,7 +4633,6 @@ crbug.com/864888 [ Mac ] editing/selection/offset-from-point-complex-scripts.htm
crbug.com/864891 [ Mac ] virtual/scroll_customization/fast/scroll-behavior/scroll-customization/scroll-customization-property.html [ Timeout Pass ] crbug.com/864891 [ Mac ] virtual/scroll_customization/fast/scroll-behavior/scroll-customization/scroll-customization-property.html [ Timeout Pass ]
# Sheriff 2018-07-18 # Sheriff 2018-07-18
crbug.com/863067 [ Win10 ] fast/dom/Window/window-focus-self.html [ Failure Pass ]
crbug.com/864994 [ Mac ] external/wpt/encoding/legacy-mb-korean/euc-kr/euckr-decode-ksc_5601.html [ Timeout Failure Pass ] crbug.com/864994 [ Mac ] external/wpt/encoding/legacy-mb-korean/euc-kr/euckr-decode-ksc_5601.html [ Timeout Failure Pass ]
crbug.com/865432 [ Linux ] external/wpt/workers/modules/dedicated-worker-import-blob-url.any.worker.html [ Timeout Pass ] crbug.com/865432 [ Linux ] external/wpt/workers/modules/dedicated-worker-import-blob-url.any.worker.html [ Timeout Pass ]
......
...@@ -7,8 +7,6 @@ function runTest() { ...@@ -7,8 +7,6 @@ function runTest() {
window.onblur = windowBlurred; window.onblur = windowBlurred;
if (window.testRunner) { if (window.testRunner) {
testRunner.waitUntilDone();
testRunner.dumpAsText();
testRunner.setWindowIsKey(false); testRunner.setWindowIsKey(false);
window.open('javascript:window.focus()', '_self', ''); window.open('javascript:window.focus()', '_self', '');
setTimeout(function() { testRunner.notifyDone(); }, 0); setTimeout(function() { testRunner.notifyDone(); }, 0);
...@@ -36,6 +34,16 @@ function windowBlurred() { ...@@ -36,6 +34,16 @@ function windowBlurred() {
<body> <body>
This tests that a window cannot focus itself by using javascript: urls. This tests that a window cannot focus itself by using javascript: urls.
<ul id="console"></ul> <ul id="console"></ul>
<script>runTest();</script> <script>
if (window.testRunner) {
testRunner.waitUntilDone();
testRunner.dumpAsText();
// If this test is run on a fresh content shell, its initial focus
// may deliver a focus event which can race with runTest() above,
// and result in false failure. Add some delay to avoid the initial
// focus event. See crbug.com/863067 for more background.
setTimeout(runTest, 100);
}
</script>
</body> </body>
</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