Closed Bug 1568665 Opened 4 months ago Closed 3 months ago

[wpt-sync] Sync PR 18055 - [WPT/referrer-policy] Fix races around history.back()

Categories

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

task

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: wptsync, Unassigned)

References

()

Details

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

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

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

Hiroshige Hayashizaki <hiroshige@chromium.org> wrote:

[WPT/referrer-policy] Fix races around history.back()

Because history.back() works asynchronously,
there are races between history.back() and subsequent
promise_test()s.
For exmample:

  1. The first 4K-length-referrer subtest finishes and history.back() is called.
  2. The second subtest starts, and replaceState() is called.
  3. The change to location caused by hisotory.back() in Step 1
    comes into effect.
  4. The second subtest finishes -- at this time, location is the
    original Document URL
    (not '.../AAAA....AAA' set by replaceState() in Step 2)
    and thus history.back() has no effects.

This CL fixes the race by waiting for popstate events that should
be fired at the end of async tasks of history.back().

Bug: 906850
Change-Id: I21e7b8dd6001a13230fd8dca4d1693ae956958ed

Reviewed-on: https://chromium-review.googlesource.com/1717268
WPT-Export-Revision: fe4949fb39c462efe22295fad216043a0ec5aeb5

Whiteboard: [wptsync downstream] → [wptsync downstream error]
Component: web-platform-tests → DOM: Security
Product: Testing → Core
Whiteboard: [wptsync downstream error] → [wptsync downstream]
Whiteboard: [wptsync downstream] → [wptsync downstream][domsecurity-backlog]
Whiteboard: [wptsync downstream][domsecurity-backlog] → [wptsync downstream]
Whiteboard: [wptsync downstream] → [wptsync downstream][domsecurity-backlog]
Whiteboard: [wptsync downstream][domsecurity-backlog] → [wptsync downstream]
Whiteboard: [wptsync downstream] → [wptsync downstream][domsecurity-backlog]
Ran 500 tests and 1345 subtests
OK     : 500
PASS   : 1343
FAIL   : 2
Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/0f7f604a2c76
[wpt PR 18055] - [WPT/referrer-policy] Fix races around history.back(), a=testonly
Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.