tor-browser

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

test_migration_emptyValue.js (1069B)


      1 /**
      2 * Any copyright is dedicated to the Public Domain.
      3 * http://creativecommons.org/publicdomain/zero/1.0/
      4 */
      5 
      6 add_task(async function testSteps() {
      7  const data = {
      8    key: "foo",
      9    value: "",
     10  };
     11 
     12  info("Clearing");
     13 
     14  let request = clear();
     15  await requestFinished(request);
     16 
     17  info("Installing package");
     18 
     19  // The profile contains storage.sqlite and webappsstore.sqlite.
     20  // The archive migration_emptyValue_profile.zip was created by running
     21  // make_migration_emptyValue.js locally, specifically the special test was
     22  // temporarily activated in xpcshell.toml and then it was run as:
     23  // mach test --interactive dom/localstorage/test/unit/make_migration_emptyValue.js
     24  // Before packaging, additional manual steps are needed:
     25  // 1. Folder "cache2" is removed.
     26  // 2. Folder "crashes" is removed.
     27  // 3. File "mozinfo.json" is removed.
     28  installPackage("migration_emptyValue_profile");
     29 
     30  info("Getting storage");
     31 
     32  const storage = getLocalStorage();
     33 
     34  info("Verifying data");
     35 
     36  is(storage.getItem(data.key), data.value, "Correct value");
     37 });