tor-browser

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

test_removeLocalStorage.js (1949B)


      1 /**
      2 * Any copyright is dedicated to the Public Domain.
      3 * http://creativecommons.org/publicdomain/zero/1.0/
      4 */
      5 
      6 function* testSteps() {
      7  const lsArchiveFile = "storage/ls-archive.sqlite";
      8  const lsArchiveTmpFile = "storage/ls-archive-tmp.sqlite";
      9  const lsDir = "storage/default/http+++localhost/ls";
     10 
     11  info("Setting pref");
     12 
     13  SpecialPowers.setBoolPref(
     14    "dom.storage.enable_unsupported_legacy_implementation",
     15    true
     16  );
     17 
     18  // Profile 1
     19  info("Clearing");
     20 
     21  clear(continueToNextStepSync);
     22  yield undefined;
     23 
     24  info("Installing package");
     25 
     26  installPackage("removeLocalStorage1_profile");
     27 
     28  info("Checking ls archive tmp file");
     29 
     30  let archiveTmpFile = getRelativeFile(lsArchiveTmpFile);
     31 
     32  let exists = archiveTmpFile.exists();
     33  ok(exists, "ls archive tmp file does exist");
     34 
     35  info("Initializing");
     36 
     37  let request = init(continueToNextStepSync);
     38  yield undefined;
     39 
     40  Assert.equal(request.resultCode, NS_OK, "Initialization succeeded");
     41 
     42  info("Checking ls archive file");
     43 
     44  exists = archiveTmpFile.exists();
     45  ok(!exists, "ls archive tmp file doesn't exist");
     46 
     47  // Profile 2
     48  info("Clearing");
     49 
     50  clear(continueToNextStepSync);
     51  yield undefined;
     52 
     53  info("Installing package");
     54 
     55  installPackage("removeLocalStorage2_profile");
     56 
     57  info("Checking ls archive file");
     58 
     59  let archiveFile = getRelativeFile(lsArchiveFile);
     60 
     61  exists = archiveFile.exists();
     62  ok(exists, "ls archive file does exist");
     63 
     64  info("Checking ls dir");
     65 
     66  let dir = getRelativeFile(lsDir);
     67 
     68  exists = dir.exists();
     69  ok(exists, "ls directory does exist");
     70 
     71  info("Initializing");
     72 
     73  request = init(continueToNextStepSync);
     74  yield undefined;
     75 
     76  Assert.equal(request.resultCode, NS_OK, "Initialization succeeded");
     77 
     78  info("Checking ls archive file");
     79 
     80  exists = archiveFile.exists();
     81  ok(!exists, "ls archive file doesn't exist");
     82 
     83  info("Checking ls dir");
     84 
     85  exists = dir.exists();
     86  ok(!exists, "ls directory doesn't exist");
     87 
     88  finishTest();
     89 }