Use iframes instead of tabs in integration tests #2928
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
R: @tropicadri
I am hoping that this fixes #2755 once and for all!
The commonality between all of our flaky integration tests seems to be that they involve opening multiple tabs, in order to test behaviors related to multiple clients under the control of a service worker.
There's another way to create an additional client, though, and that's to add an
<iframe>
to the existing tab. As long as the URL of the<iframe>
is under the scope of a service worker, it will be treated the same as any top-levelWindowClient
would be.From what I can tell, switching the integration test cases to use
<iframe>
s instead of tabs ends up working fine in Firefox and Safari, including some tests that we explicitly skipped on those browsers.