tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

fedcm-mojojs-helper.js (655B)


      1 // The testing infra for FedCM is loaded using mojo js shim. To enable these
      2 // tests the browser must be run with these options:
      3 //
      4 //   --enable-blink-features=MojoJS,MojoJSTest
      5 
      6 import { MockFederatedAuthRequest } from './fedcm-mock.js';
      7 
      8 export function fedcm_mojo_mock_test(test_func, name, exception, properties) {
      9  promise_test(async (t) => {
     10    assert_implements(navigator.credentials, 'missing navigator.credentials');
     11    const mock = new MockFederatedAuthRequest();
     12    try {
     13      await test_func(t, mock);
     14    } catch (e) {
     15      assert_equals(exception, e.message)
     16    } finally {
     17      await mock.reset();
     18    }
     19  }, name, properties);
     20 }