tor-browser

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

test_service_parent.js (866B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 function run_test() {
      7  do_get_profile();
      8  setPrefs();
      9  run_next_test();
     10 }
     11 
     12 add_task(async function test_service_parent() {
     13  let db = PushServiceWebSocket.newPushDB();
     14  registerCleanupFunction(() => {
     15    return db.drop().then(() => db.close());
     16  });
     17  await setUpServiceInParent(PushService, db);
     18 
     19  // Accessing the lazy service getter will start the service in the main
     20  // process.
     21  equal(
     22    PushServiceComponent.pushTopic,
     23    "push-message",
     24    "Wrong push message observer topic"
     25  );
     26  equal(
     27    PushServiceComponent.subscriptionChangeTopic,
     28    "push-subscription-change",
     29    "Wrong subscription change observer topic"
     30  );
     31 
     32  await run_test_in_child("./test_service_child.js");
     33 
     34  await tearDownServiceInParent(db);
     35 });