Closed Bug 1728920 Opened 3 years ago Closed 3 years ago

[wpt-sync] Sync PR 30320 - [Storage Access API] Fix anomalous behavior with tests that use iframes

Categories

(Testing :: web-platform-tests, task, P4)

task

Tracking

(firefox95 fixed)

RESOLVED FIXED
95 Branch
Tracking Status
firefox95 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 30320 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/30320
Details from upstream follow.

b'Andreu Botella <abb@randomunok.com>' wrote:

[Storage Access API] Fix anomalous behavior with tests that use iframes

The tests for hasStorageAccess and requestStorageAccess need to test in different browsing contexts, with different relationships to the top-level browsing context, and both same-origin and cross-origin. They do this by declaring tests in the test file, and then loading that same test file in iframes using fetch_tests_from_window.

However, a requirement of fetch_tests_from_window is that the window whose tests to fetch must not include testharnessreport.js – which isn't true for these Storage Access API tests. While this doesn't seem to make a difference when running wpt serve or otherwise when using the default testharnessreport.js file, tests run with wpt run might timeout, and the subtests coming from the iframes might not be reported.

This change creates versions of hasStorageAccess.sub.window.html and requestStorageAccess.sub.window.html that don't import testharnessreport.js, specifically to be loaded as iframes.

Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]

CI Results

Ran 11 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 2 tests and 11 subtests

Status Summary

Firefox

OK : 2
PASS : 20
FAIL : 6

Chrome

OK : 1
FAIL : 15
ERROR: 1

Safari

OK : 2
PASS : 20
FAIL : 6

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

/storage-access-api/requestStorageAccess.sub.window.html
[top-level-context] document.requestStorageAccess() should be rejected by default with no user gesture: FAIL (Safari: FAIL)
[top-level-context] document.requestStorageAccess() should be resolved when called properly with a user gesture: FAIL (Safari: FAIL)
[same-origin-frame] document.requestStorageAccess() should be rejected by default with no user gesture: FAIL (Safari: FAIL)
[cross-origin-frame] document.requestStorageAccess() should be rejected by default with no user gesture: FAIL (Safari: PASS)
[nested-same-origin-frame] document.requestStorageAccess() should be rejected by default with no user gesture: FAIL (Safari: FAIL)
[nested-cross-origin-frame] document.requestStorageAccess() should be rejected by default with no user gesture: FAIL (Safari: PASS)

Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ba7c691e361e
[wpt PR 30320] - [Storage Access API] Fix anomalous behavior with tests that use iframes, a=testonly
https://hg.mozilla.org/integration/autoland/rev/70df754e0ef9
[wpt PR 30320] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 95 Branch
You need to log in before you can comment on or make changes to this bug.