tor-browser

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

test_appupdateurl.js (641B)


      1 /* Any copyright is dedicated to the Public Domain.
      2 * http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 add_task(async function test_app_update_URL() {
      7  await setupPolicyEngineWithJson({
      8    policies: {
      9      AppUpdateURL: "https://www.example.com/",
     10    },
     11  });
     12 
     13  equal(
     14    Services.policies.status,
     15    Ci.nsIEnterprisePolicies.ACTIVE,
     16    "Engine is active"
     17  );
     18 
     19  let checker = Cc["@mozilla.org/updates/update-checker;1"].getService(
     20    Ci.nsIUpdateChecker
     21  );
     22  let expected = await checker.getUpdateURL(checker.BACKGROUND_CHECK);
     23 
     24  equal("https://www.example.com/", expected, "Correct app update URL");
     25 });