Open Bug 1203917 Opened 4 years ago Updated 4 years ago
.html test unstable on linux/e10s
Disabled for now
I see focus and I immediately think of you, Neil :). Can you please take a look at this e10s-only failure?
Probably because the test framework isn't waiting for the window to be focused before running the test. I know nothing of these tests so I can't really be much help.
James, can you please answer Neil's question about how the harness ensures that the tests have focus while running?
Note that the test here runs without waiting for the page to load either. Depending on the way the window/frame is already focused, the focus event may be delayed until after the page show.
It could be getting that wrong indeed. What's the correct way to ensure that the window is focused before running the test?
Generally, you want to ensure that the content area is focused when loading the test page by calling focus() on its window. If you have access to the browser chrome and are opening a new tab, there is a TabOpen event fired on the tab itself. I don't know how this test framework works so I don't really know how to give a specific answer as to how you should be doing that. If you could point to where the test opens the test page I might be able to give some general pointers.
We have a window, into which the following script (with placeholders substituted) is executed: https://dxr.mozilla.org/mozilla-central/source/testing/web-platform/harness/wptrunner/executors/testharness_marionette.js That causes the test to load in a new window. In the test window, the following script is run (after the harness loads, but before any tests have run): https://dxr.mozilla.org/mozilla-central/source/testing/web-platform/harness/wptrunner/testharnessreport.js We can add script to either of those places. Ideally it would run in content scope, but it may be possible to run in Chrome scope with some effort. It's also possible to make it conditional on a property being set in the test manifest, if required, although if we can avoid that without serious cost, that would be better.
Flags: needinfo?(james) → needinfo?(enndeakin)
So I see no code in there that waits for the window to be focused. You could always check by adding a listener for the "focus" event to the opened window and check if it fires after the test has run. If so, then this is the problem here. In mochitests we use waitForFocus (in SimpleTest.js) to handle waiting for a window to be both loaded and focused. It's possible it could be adpated for these tests.
You need to log in before you can comment on or make changes to this bug.