Closed Bug 1526275 Opened 6 years ago Closed 6 years ago

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

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

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

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

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

Hiroshige Hayashizaki <hiroshige@chromium.org> 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:

  • expect.py'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
wpt/{referrer-policy,mixed-content}/generic/common.js
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
Reviewed-on: https://chromium-review.googlesource.com/1455745
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: /mixed-content/link-prefetch-tag/no-opt-in/same-host-https/top-level/keep-scheme-redirect/allowed/allowed.https.html
Pushed by james@hoppipolla.co.uk: https://hg.mozilla.org/integration/mozilla-inbound/rev/8592c05fe031 [wpt PR 15262] - [WPT] Merge wpt/{referrer-policy,mixed-content}/generic/common.js, a=testonly
Pushed by james@hoppipolla.co.uk: https://hg.mozilla.org/integration/mozilla-inbound/rev/6d7a636b53c9 [wpt PR 15262] - [WPT] Merge wpt/{referrer-policy,mixed-content}/generic/common.js, a=testonly
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.