Commit 2b58ff21 authored by Marcos Cáceres's avatar Marcos Cáceres Committed by aborovova@mozilla.com
Browse files

Bug 1944430 [wpt PR 50352] - Digital Credentials: small test bug fixes/improvements,

Automatic update from web-platform-tests
Digital Credentials: small test bug fixes/improvements (#50352)

--

wpt-commits: 180c27cfae86b260b0d1e8a61e180dd3e43af5b4
wpt-pr: 50352

Differential Revision: https://phabricator.services.mozilla.com/D250178
parent 580b6441
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -105,10 +105,11 @@
                        const options = {
                            digital: {
                                // Results in TypeError when allowed, NotAllowedError when disallowed
                                requests: [],
                                requests: [{ data: {}, protocol: "openid4vp" }],
                            },
                            mediation: "required",
                        };
                        await test_driver.bless("User activation");
                        const { data } = await new Promise((resolve) => {
                            window.addEventListener("message", resolve, {
                                once: true,
+4 −4
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@
    controller.abort();

    // Steal all the needed references.
    const navigator = iframe.contentWindow.navigator;
    const { credentials } = iframe.contentWindow.navigator;
    const DOMExceptionCtor = iframe.contentWindow.DOMException;

    // No longer fully active.
@@ -44,7 +44,7 @@
      t,
      "InvalidStateError",
      DOMExceptionCtor,
      navigator.credentials.get({ signal }),
      credentials.get({ signal }),
      "Expected InvalidStateError for get() on non-fully-active document"
    );

@@ -53,7 +53,7 @@
      t,
      "InvalidStateError",
      DOMExceptionCtor,
      navigator.credentials.create({ signal }),
      credentials.create({ signal }),
      "Expected InvalidStateError for create() on non-fully-active document"
    );

@@ -62,7 +62,7 @@
      t,
      "InvalidStateError",
      DOMExceptionCtor,
      navigator.credentials.preventSilentAccess(),
      credentials.preventSilentAccess(),
      "Expected InvalidStateError for preventSilentAccess() on non-fully-active document"
    );
  }, "non-fully active document behavior for CredentialsContainer");
+2 −2
Original line number Diff line number Diff line
@@ -27,8 +27,8 @@
      }
      data.options.signal = abortController.signal;
    }
    if (data.needsActivation) {
      await test_driver.bless("user activation", null, window);
    if (data.needsActivation && !navigator.userActivation.isActive) {
      await test_driver.bless("user activation");
    }
    let result;
    try {
+8 −3
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
      navigator.userActivation.isActive,
      "User activation should not be active"
    );
    const options = makeGetOptions([]);
    const options = makeGetOptions("openid4vp");
    await promise_rejects_dom(
      t,
      "NotAllowedError",
@@ -24,12 +24,17 @@

  promise_test(async (t) => {
    await test_driver.bless();
    const abort = new AbortController();
    const options = makeGetOptions("openid4vp");
    options.signal = abort.signal;
    assert_true(
      navigator.userActivation.isActive,
      "User activation should be active after test_driver.bless()."
    );
    const options = makeGetOptions([]);
    await promise_rejects_js(t, TypeError, navigator.credentials.get(options));

    const getPromise = navigator.credentials.get(options);
    abort.abort();
    await promise_rejects_dom(t, "AbortError", getPromise);
    assert_false(
      navigator.userActivation.isActive,
      "User activation should be consumed after navigator.credentials.get()."