Closed Bug 1820674 Opened 2 years ago Closed 2 years ago

[wpt-sync] Sync PR 38836 - Ensure we never fire a navigateerror event without a navigate event

Categories

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

task

Tracking

(firefox113 fixed)

RESOLVED FIXED
113 Branch
Tracking Status
firefox113 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Nate Chapin <japhet@chromium.org> wrote:

Ensure we never fire a navigateerror event without a navigate event

  1. Currently, we try to error any upcoming traversals on frame detach,
    rather than leaving the promises unfulfilled. That's inconsistent
    with what we do for an ongoing navigation. Leave them unfulfilled,
    and move the cleanup logic to ContextDestroyed(), where the
    cleanup for the ongoing navigation case is.
  2. Now the only place we error an upcoming traversals is
    TraverseCancelled(). Directly reject the promise and remove the
    traversal from upcoming_traversals_, rather than going through
    RejectPromisesAndFireNavigateErrorEvent(). This fixes the issue
    where we would fire a navigateerror event for a traversal that
    had not yet fired a navigate event.
  3. Now RejectPromisesAndFireNavigateErrorEvent() and
    FinalizeWithAbortedNavigationError() are now only used for the
    ongoing navigation, so there's no need for them to take a
    NavigationApiNaviagtion* parameter.
  4. Every codepath that ends a navigation now knows whether it is an
    ongoing navigation or an upcoming traversal. Clear the
    appropriate state directly rather than needing
    CleanupApiNavigation().

Bug: 1421647
Change-Id: I959b9f7b47e962c41aa57a49dcbf0e4bfce9a15e
Reviewed-on: https://chromium-review.googlesource.com/4313039
WPT-Export-Revision: bc3a6864038842dbafbaf3b4170140893fe0688b

Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]

CI Results

Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 5 tests and 1 subtests

Status Summary

Firefox

OK : 5
FAIL: 5

Chrome

OK : 5
PASS: 2
FAIL: 3

Safari

OK : 5
FAIL: 5

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b921f9c29e8a [wpt PR 38836] - Ensure we never fire a navigateerror event without a navigate event, a=testonly https://hg.mozilla.org/integration/autoland/rev/359a63b55a31 [wpt PR 38836] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 113 Branch
You need to log in before you can comment on or make changes to this bug.