1
0
Fork 0
firefox/testing/web-platform/tests/fedcm/support/fedcm-mojojs-helper.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

20 lines
655 B
JavaScript

// The testing infra for FedCM is loaded using mojo js shim. To enable these
// tests the browser must be run with these options:
//
// --enable-blink-features=MojoJS,MojoJSTest
import { MockFederatedAuthRequest } from './fedcm-mock.js';
export function fedcm_mojo_mock_test(test_func, name, exception, properties) {
promise_test(async (t) => {
assert_implements(navigator.credentials, 'missing navigator.credentials');
const mock = new MockFederatedAuthRequest();
try {
await test_func(t, mock);
} catch (e) {
assert_equals(exception, e.message)
} finally {
await mock.reset();
}
}, name, properties);
}