tor-browser

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

test_schema3upgrade.js (1304B)


      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 url = "http://example.com";
      8 
      9  info("Setting pref");
     10 
     11  Services.prefs.setBoolPref("dom.storage.next_gen", true);
     12 
     13  info("Clearing");
     14 
     15  let request = clear();
     16  await requestFinished(request);
     17 
     18  info("Installing package");
     19 
     20  // The profile contains one initialized origin directory with local
     21  // storage data, local storage archive, a script for origin initialization,
     22  // the storage database and the web apps store database:
     23  // - storage/default/http+++example.com
     24  // - storage/ls-archive.sqlite
     25  // - create_db.js
     26  // - storage.sqlite
     27  // - webappsstore.sqlite
     28  // The file create_db.js in the package was run locally (with a build with
     29  // local storage archive version 1 and database schema version 2),
     30  // specifically it was temporarily added to xpcshell.toml and then executed:
     31  //   mach xpcshell-test --interactive dom/localstorage/test/unit/create_db.js
     32  // Note: to make it become the profile in the test, additional manual steps
     33  // are needed.
     34  // 1. Remove the folder "storage/temporary".
     35  installPackage("schema3upgrade_profile");
     36 
     37  let storage = getLocalStorage(getPrincipal(url));
     38  storage.open();
     39 });