Closed Bug 1526275 Opened 2 years ago Closed 1 year ago

[wpt-sync] Sync PR 15262 - [WPT] Merge wpt/{referrer-policy,mixed-content}/generic/common.js


(Core :: DOM: Security, enhancement, P4)




Tracking Status
firefox67 --- fixed


(Reporter:, Unassigned)




(Whiteboard: [wptsync downstream][domsecurity-backlog])

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

Details from upstream follow.

Hiroshige Hayashizaki <> wrote:

[WPT] Merge wpt/{referrer-policy,mixed-content}/generic/common.js

To merge wpt/{referrer-policy,mixed-content} test frameworks,
this CL merges their common.js.

The new common.js is based on mixed-content's common.js,
with some aspects imported from referrer-policy's common.js:

  • Passes results from subresource payloads to resolved promises,
    converting if necessary using wrapResult().
    This is for referrer-policy tests that rely on subresource
    payload to get referrer request headers, while
    mixed-content tests don't use the payload information at all.
  • Accepts additionalArguments arguments (to be used to set
    referrer-policy-related attributes to elements).
  • Extends bindEvents() to clean up event listeners on completion
    (which is done for some request types in
    referrer-policy's common.js).
  • Imports queryImage() (with renaming to
    requestViaImageForReferrerPolicy) from referrer-policy's common.js
    (this should be merged with mixed-content version of
    image requests, but not now).

On mixed-content side:

  •'s response for script requests is modified
    because postMessage() is required by referrer-policy's common.js.

On referrer-policy side:

  • referrer-policy-test-case.js is converted to promise-based,
  • Move referrer-policy-specific code from common.js
    to referrer-policy-test-case.js, including wrapResult().

Some manually-written tests are modified, because:

  • Functions in referrer-policy's common.js are renamed, and
  • Some methods are moved to referrer-policy-test-case.js.

Then now
are the same.

They are duplicated (i.e. not moved/merged to a single file)
just to avoid mass modification of a large number of
generated files for each step of refactoring,
as these file names are hard-coded there.

Bug: 906850
Change-Id: I39f19d08d658c1a898fc453b621d82a2faaaaf6b
WPT-Export-Revision: ab84fa1329f67a0458caa367549adcf2589a6f5c

Component: web-platform-tests → DOM: Security
Product: Testing → Core
Whiteboard: [wptsync downstream] → [wptsync downstream][domsecurity-backlog]
Ran 393 tests and 396 subtests
OK     : 392
PASS   : 346
FAIL   : 50

Tests that are disabled for instability:
Pushed by
[wpt PR 15262] - [WPT] Merge wpt/{referrer-policy,mixed-content}/generic/common.js, a=testonly
Pushed by
[wpt PR 15262] - [WPT] Merge wpt/{referrer-policy,mixed-content}/generic/common.js, a=testonly
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.