tor-browser

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

choose-_self-002.html (1181B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>HTML Test: Choose browsing context - '_self' (case-sensitivity)</title>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <script src="/common/PrefixedLocalStorage.js"></script>
      7 <body>
      8 <div id="log"></div>
      9 
     10 <script>
     11 var prefixedStorage;
     12 setup(() => prefixedStorage = new PrefixedLocalStorageTest());
     13 
     14 async_test(t => {
     15  var iframe;
     16 
     17  var testFunc = (function (t) {
     18    var completed = 0;
     19    var testCount = 2;
     20    return function (actual, expected) {
     21      assert_equals(actual, expected);
     22      if (++completed >= testCount) {
     23        t.done();
     24      }
     25    }
     26  }(t));
     27 
     28  t.add_cleanup(() => prefixedStorage.cleanup());
     29 
     30  prefixedStorage.onSet('isTop', t.step_func(e => {
     31    testFunc(e.newValue, 'false');
     32  }));
     33  prefixedStorage.onSet('name', t.step_func(e => {
     34    testFunc(e.newValue, 'testWin');
     35  }));
     36 
     37  iframe = document.createElement('iframe');
     38  iframe.name = 'testWin';
     39  iframe.src = prefixedStorage.url('resources/choose-_self-002-iframe.html');
     40  document.body.appendChild(iframe);
     41 
     42 }, 'choosing _self context should be case-insensitive');
     43 
     44 </script>
     45 
     46 </body>