tor-browser

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

test_bad_origin_directory.js (658B)


      1 /**
      2 * Any copyright is dedicated to the Public Domain.
      3 * http://creativecommons.org/publicdomain/zero/1.0/
      4 */
      5 
      6 /* exported testGenerator */
      7 var testGenerator = testSteps();
      8 
      9 function* testSteps() {
     10  const url = "ws://ws.example.com";
     11  const name = "test_bad_origin_directory.js";
     12 
     13  let uri = Services.io.newURI(url);
     14 
     15  let principal = Services.scriptSecurityManager.createContentPrincipal(
     16    uri,
     17    {}
     18  );
     19 
     20  info("Opening database");
     21 
     22  let request = indexedDB.openForPrincipal(principal, name);
     23  request.onerror = continueToNextStepSync;
     24  request.onsuccess = unexpectedSuccessHandler;
     25  yield undefined;
     26 
     27  finishTest();
     28  yield undefined;
     29 }