tor-browser

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

test_leaving_page.html (1483B)


      1 <!--
      2  Any copyright is dedicated to the Public Domain.
      3  http://creativecommons.org/publicdomain/zero/1.0/
      4 -->
      5 <html>
      6 <head>
      7  <title>Indexed Database Leaving Page Test</title>
      8 
      9  <script src="/tests/SimpleTest/SimpleTest.js"></script>
     10  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     11 </head>
     12 
     13 <body onload="runTest();">
     14  <iframe id="inner"></iframe>
     15  <a id="a" href="leaving_page_iframe.html"></a>
     16 
     17  <script type="text/javascript">
     18    window.addEventListener("message", function(e) {
     19      ok(false, "gotmessage: " + e.data);
     20    });
     21 
     22    function* testSteps()
     23    {
     24      var iframe = $("inner");
     25      iframe.src = "leaving_page_iframe.html";
     26      iframe.onload = continueToNextStep;
     27      yield undefined;
     28      is(iframe.contentWindow.location.href, $("a").href,
     29         "should navigate to iframe page");
     30      yield undefined;
     31      is(iframe.contentWindow.location.href, "about:blank",
     32         "should nagivate to about:blank");
     33 
     34      let request = indexedDB.open(location, 1);
     35      request.onsuccess = grabEventAndContinueHandler;
     36      let event = yield undefined;
     37 
     38      let db = event.target.result;
     39      db.transaction(["mystore"]).objectStore("mystore").get(42).onsuccess =
     40        grabEventAndContinueHandler;
     41      event = yield undefined;
     42      is(event.target.result.hello, "world", "second modification rolled back");
     43 
     44      finishTest();
     45    }
     46  </script>
     47  <script type="text/javascript" src="helpers.js"></script>
     48 </html>