tor-browser

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

choose-_parent-004.html (1185B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>HTML Test: Choose browsing context - '_parent' (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 var iframe;
     13 setup(() => prefixedStorage = new PrefixedLocalStorageTest());
     14 
     15 async_test(t => {
     16  t.add_cleanup(() => prefixedStorage.cleanup());
     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  prefixedStorage.onSet('isTop', t.step_func(e => {
     29    testFunc(e.newValue, 'false');
     30  }));
     31  prefixedStorage.onSet('name', t.step_func(e => {
     32    testFunc(e.newValue, 'parentWin');
     33  }));
     34  iframe = document.createElement('iframe');
     35  iframe.src = prefixedStorage.url('resources/choose-_parent-004-iframe-1.html');
     36  iframe.name = 'parentWin';
     37  document.body.appendChild(iframe);
     38 }, 'choosing _parent context should be case-insensitive');
     39 </script>
     40 </body>