[wpt-sync] Sync PR 15262 - [WPT] Merge wpt/{referrer-policy,mixed-content}/generic/common.js
Categories
(Core :: DOM: Security, enhancement, P4)
Tracking
()
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
Assignee | ||
Updated•6 years ago
|
Updated•6 years ago
|
Assignee | ||
Comment 1•6 years ago
|
||
Assignee | ||
Comment 2•6 years ago
|
||
Assignee | ||
Comment 3•6 years ago
|
||
Comment 6•6 years ago
|
||
bugherder |
Description
•