tor-browser

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

browser_fetch_lnk.js (647B)


      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 () => {
      7  const FILE_PAGE = Services.io.newFileURI(
      8    new FileUtils.File(getTestFilePath("dummy.html"))
      9  ).spec;
     10  await BrowserTestUtils.withNewTab(FILE_PAGE, async browser => {
     11    try {
     12      await SpecialPowers.spawn(browser, [], () =>
     13        content.fetch("./file_lnk.lnk")
     14      );
     15      ok(
     16        false,
     17        "Loading lnk must fail if it links to a file from other directory"
     18      );
     19    } catch (err) {
     20      is(err.constructor.name, "TypeError", "Should fail on Windows");
     21    }
     22  });
     23 });