Closed Bug 1886797 Opened 2 years ago Closed 2 years ago

[wpt-sync] Sync PR 45255 - Fenced frame: fix CSP tests and CSP check in can load API.

Categories

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

task

Tracking

(firefox126 fixed)

RESOLVED FIXED
126 Branch
Tracking Status
firefox126 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Attachments

(1 file)

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

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

Liam Brady <lbrady@google.com> wrote:

Fenced frame: fix CSP tests and CSP check in can load API.

The navigator.canLoadAdAuctionFencedFrame() API currently doesn't
properly handle the case when calling it in a document whose content
security policy is "fenced-frame-src: https:". This is because the API
isn't explicitly checking for that specific case. This CL modifies the
function to match the checks in CheckCSPSource() in csp_source.cc.

This would've been caught by the CSP WPTs, but those have a bug that
makes them ineffective in catching corner cases. When adding a CSP with
the \<meta> tag, that is a strictly additive operation, and removing the
tag will have no effect on the document's CSP. Since the same page is
re-used through all the promise_tests in the file, each subsequent test
will load with all of the CSPs set in the prior tests. This CL fixes
that by having each test create a subframe that gets the CSP, and
running the test in that subframe.

Change-Id: Iea3238cc2b515976468f957ae808277df8c5adc9

Reviewed-on: https://chromium-review.googlesource.com/5378803
WPT-Export-Revision: 47071b15ecda2cffb90a15b24658073e2057ec76

Attached file Notable wpt changes
# CI Results Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI Total 236 tests and 1 subtests ## Status Summary ### Firefox `OK` : 208[Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt] 215[GitHub] `PASS` : 21[Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt] 23[GitHub] `FAIL` : 469[Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt] 540[GitHub] `TIMEOUT`: 4[Gecko-windows11-64-2009-qr-debug] 5[Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-opt] 6[Gecko-linux1804-64-qr-debug] 29[GitHub] `ERROR` : 8[Gecko-linux1804-64-qr-debug, Gecko-windows11-64-2009-qr-debug] 9[Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-opt, GitHub] `NOTRUN` : 4[Gecko-windows11-64-2009-qr-debug] 6[Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-opt] 21[GitHub] ### Chrome `OK` : 185 `PASS` : 31 `FAIL` : 413 `TIMEOUT`: 94 `ERROR` : 6 `NOTRUN` : 110 ### Safari `OK` : 214 `PASS` : 22 `FAIL` : 539 `TIMEOUT`: 30 `ERROR` : 9 `NOTRUN` : 21 ## Links [Gecko CI (Treeherder)](https://treeherder.mozilla.org/#/jobs?repo=try&revision=456f620605d086169d691ded0f9e094d0611d657) [GitHub PR Head](https://wpt.fyi/results/?sha=0d144e7aef8338a508a6c90838ff281f6d2495ca&label=pr_head) [GitHub PR Base](https://wpt.fyi/results/?sha=0d144e7aef8338a508a6c90838ff281f6d2495ca&label=pr_base) ## Details (See attachment for full changes)
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a1d43aa5d90b [wpt PR 45255] - Fenced frame: fix CSP tests and CSP check in can load API., a=testonly https://hg.mozilla.org/integration/autoland/rev/f689b9dfb5b3 [wpt PR 45255] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 126 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: