tor-browser

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

test_BackupService_resolveDownloadLink.js (974B)


      1 /* Any copyright is dedicated to the Public Domain.
      2 https://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 /**
      7 * Tests that valid links are produced for each update channel.
      8 */
      9 add_task(async function test_supported_update_channel_links() {
     10  const SUPPORTED_CHANNELS = ["nightly", "aurora", "beta", "release", "esr"];
     11  for (let channel of SUPPORTED_CHANNELS) {
     12    let bs = new BackupService();
     13    let linkHref = await bs.resolveDownloadLink(channel);
     14    let url = URL.parse(linkHref);
     15    Assert.ok(url, `Got a valid URL back for channel ${channel}`);
     16  }
     17 });
     18 
     19 /**
     20 * Tests that a fallback links is produced for an unsupported update channel.
     21 */
     22 add_task(async function test_unsupported_update_channel() {
     23  const UNSUPPORTED_CHANNEL = "test123";
     24 
     25  let bs = new BackupService();
     26  let linkHref = await bs.resolveDownloadLink(UNSUPPORTED_CHANNEL);
     27  let url = URL.parse(linkHref);
     28  Assert.ok(url, "Got a valid URL back for unsupported channel");
     29 });