tor-browser

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

browser_webauthn_ipaddress.js (862B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
      3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 "use strict";
      6 
      7 add_virtual_authenticator();
      8 
      9 let expectSecurityError = expectError("Security");
     10 
     11 add_task(async function test_setup() {
     12  return SpecialPowers.pushPrefEnv({
     13    set: [["network.proxy.allow_hijacking_localhost", true]],
     14  });
     15 });
     16 
     17 add_task(async function test_appid() {
     18  // 127.0.0.1 triggers special cases in ssltunnel, so let's use .2!
     19  const TEST_URL = "https://127.0.0.2/";
     20 
     21  // Open a new tab.
     22  let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_URL);
     23 
     24  await promiseWebAuthnMakeCredential(tab)
     25    .then(arrivingHereIsBad)
     26    .catch(expectSecurityError);
     27 
     28  // Close tab.
     29  BrowserTestUtils.removeTab(tab);
     30 });