test_unsetLastAccessTime.js (1476B)
1 /** 2 * Any copyright is dedicated to the Public Domain. 3 * http://creativecommons.org/publicdomain/zero/1.0/ 4 */ 5 6 async function testSteps() { 7 const principal = getPrincipal("https://foo.example.com/"); 8 9 info("Setting pref"); 10 11 // The packaged profile will have a different build ID and we would treat the 12 // cache as invalid if we didn't bypass this check. 13 Services.prefs.setBoolPref("dom.quotaManager.caching.checkBuildId", false); 14 15 info("Clearing"); 16 17 let request = clear(); 18 await requestFinished(request); 19 20 info("Installing package"); 21 22 // The profile contains one initialized origin directory and the storage 23 // database: 24 // - storage/default/https+++foo.example.com 25 // - storage.sqlite 26 // The file make_unsetLastAccessTime.js was run locally, specifically it was 27 // temporarily enabled in xpcshell.toml and then executed: 28 // mach test --interactive dom/quota/test/xpcshell/caching/make_unsetLastAccessTime.js 29 // Note: to make it become the profile in the test, additional manual steps 30 // are needed. 31 // 1. Remove the folder "storage/temporary". 32 // 2. Remove the file "storage/ls-archive.sqlite". 33 installPackage("unsetLastAccessTime_profile"); 34 35 info("Getting full origin metadata"); 36 37 request = getFullOriginMetadata("default", principal); 38 await requestFinished(request); 39 40 info("Verifying last access time"); 41 42 Assert.notEqual( 43 BigInt(request.result.lastAccessTime), 44 INT64_MIN, 45 "Correct last access time" 46 ); 47 }