tor-browser

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

test_registration_none.js (814B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 const userAgentID = "a722e448-c481-4c48-aea0-fc411cb7c9ed";
      7 
      8 function run_test() {
      9  do_get_profile();
     10  setPrefs({ userAgentID });
     11  run_next_test();
     12 }
     13 
     14 // Should not open a connection if the client has no registrations.
     15 add_task(async function test_registration_none() {
     16  PushService.init({
     17    serverURI: "wss://push.example.org/",
     18    makeWebSocket(uri) {
     19      return new MockWebSocket(uri);
     20    },
     21  });
     22 
     23  let registration = await PushService.registration({
     24    scope: "https://example.net/1",
     25    originAttributes: ChromeUtils.originAttributesToSuffix({
     26      inIsolatedMozBrowser: false,
     27    }),
     28  });
     29  ok(!registration, "Should not open a connection without registration");
     30 });