tor-browser

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

test_storage_manager_persist_deny.js (727B)


      1 /**
      2 * Any copyright is dedicated to the Public Domain.
      3 * http://creativecommons.org/publicdomain/zero/1.0/
      4 */
      5 
      6 function* testSteps() {
      7  SpecialPowers.pushPrefEnv(
      8    {
      9      set: [["dom.storageManager.prompt.testing.allow", false]],
     10    },
     11    continueToNextStep
     12  );
     13  yield undefined;
     14 
     15  navigator.storage.persist().then(grabArgAndContinueHandler);
     16  let persistResult = yield undefined;
     17 
     18  is(
     19    persistResult,
     20    false,
     21    "Cancel the persist prompt and resolve a promise with false"
     22  );
     23 
     24  navigator.storage.persisted().then(grabArgAndContinueHandler);
     25  let persistedResult = yield undefined;
     26 
     27  is(
     28    persistResult,
     29    persistedResult,
     30    "Persist/persisted results are consistent"
     31  );
     32 
     33  finishTest();
     34 }