Closed Bug 2086622 Opened 1 month ago Closed 19 days ago

[wpt-sync] Sync PR 64218 - [dbsc] Add WPTs and browser tests for session retrieval

Categories

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

task

Tracking

(firefox162 fixed)

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

amraboelkher <amraboelkher@chromium.org> wrote:

[dbsc] Add WPTs and browser tests for session retrieval

At present the unit tests for DeviceBoundSessionRegistrationObserver use
a fake manager, and the browser tests from part 4 bind the manager by
hand. No test registers a real session and reads it back through the
API.

Add five WPTs in device-bound-session-credentials/. The API has an
explainer but no spec yet, so their names carry .tentative.

  • registration-observer: the callback gets the observer and each
    session's ID, refresh URL and creation time; the first call lists the
    sessions that already exist and a later call holds only the new
    session; repeated observe() calls neither subscribe twice nor resend
    the existing sessions; after disconnect() nothing arrives, and a new
    observe() gets the existing sessions again; a session scoped to
    another origin of the same site is not seen.
  • registration-observer-abort: an AbortSignal aborted before or after
    observe() stops every later callback, while an observer without a
    signal still sees the session, and observe() does not restart the
    observer.
  • registration-observer-cross-subdomain: a site-wide session that a
    subdomain registers is seen from the site root.
  • registration-observer-opaque-origin: the constructor throws a
    SecurityError in a sandboxed iframe and does not work in a data:
    document.
  • registration-observer-not-eligible: a credentialless iframe, and an
    iframe from the test's origin inside a cross-site iframe, observe
    nothing and keep running, because Blink does not ask for the manager
    there. The inner iframe shares the test page's origin, so it has a
    session it could leak. observer_frame.html is the iframe page; with
    ?embed= it also holds the inner iframe.

Like the rest of the directory, they run in chrome_wpt_tests
(TestLists/chrome.filter), where wptrunner runs chrome with
--enable-experimental-web-platform-features, which turns
DeviceBoundSessionJsApi on through part 4's switch override.

The negative checks wait for a later session or a later observer, not
for a fixed time: the network service pushes to a document's observers
in the order they subscribed, on one pipe. Only checks where nothing
can arrive, such as an iframe whose document never binds the manager,
keep a fixed wait.

Add browser tests that register a site-wide a.test session with the test
server. The fixture turns on the DeviceBoundSessionJsApi feature, which
turns on the Blink runtime flag through runtime_features.cc.

  • A session registered on accounts.a.test is seen on mail.a.test after a
    redirect.
  • An a.test iframe under b.test sees no session, while a top-level
    a.test page does.
  • A credentialless a.test iframe sees no session, and its renderer is
    not killed, because Blink does not ask for the manager.
  • A same-origin iframe sees the session. It commits into the window of
    its initial empty document, so this checks that a kept window gets
    the commit-time value.
  • A new a.test page commits, then cookies and site data for a.test are
    blocked. The page's first observe() binds the manager after that and
    sees no session, and its renderer stays alive: the setting can change
    while the page is open, so it never causes a kill.
  • Incognito and the regular profile each register a session with their
    own ID. The regular profile's first callback holds only its own
    session, and a second Incognito window sees only the Incognito one.
  • HttpsPageBindsManager and SameSiteIframeBindsManager, from part 4,
    register a session and read it back through the page's observer,
    which works only if the browser bound the manager with the frame's
    origin and isolation info. The part 4 tests that expect a bad message
    still bind by hand, as the comment on BindManager() explains.

Part 6 of 6.

Test: run_wpt_tests.py -p chrome external/wpt/device-bound-session-credentials/
Test: content_browsertests --gtest_filter=DeviceBoundSessionJsApi*
Bug: 494489935
Change-Id: If68c369f55c87b5307de53c0687376d76a6a6964
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8579637
Reviewed-by: Kenichi Ishibashi \<bashi@chromium.org>
Reviewed-by: Jan Wilken Dörrie \<jdoerrie@chromium.org>
Commit-Queue: Amr Aboelkher \<amraboelkher@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1728002}

CI Results

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

Total 32 tests and 5 subtests

Status Summary

Firefox

OK : 5[GitHub] 6[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS: 1[GitHub] 2[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
FAIL: 12

Chrome

OK : 5
PASS: 1
FAIL: 12

Safari

OK : 5
PASS: 1
FAIL: 12

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Tests Disabled in Gecko Infrastructure

Status: NEW → RESOLVED
Closed: 19 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.