tor-browser

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

016-1.html (1375B)


      1 <script>
      2 window.test_prop = 1;
      3 </script>
      4 <script>
      5 onload = function() {
      6  parent.tests[0].step(function() {
      7    parent.assert_equals(document.open(), document);
      8  });
      9  document.write("<script>test_prop = 2; timeout_fired=false;<\/script>");
     10  document.close();
     11 
     12  setTimeout(function() {
     13    parent.tests[0].step(function() {
     14      parent.assert_equals(test_prop, 2, "Global scope from original window timeout");
     15      parent.assert_equals(window.test_prop, 2, "Window property from original window timeout")
     16    });
     17    parent.tests[1].step(function() {
     18      var t = get_this();
     19      parent.assert_equals(t.test_prop, 2, "Window property from original window timeout");
     20      parent.assert_equals(t, window, "Global scope from original window timeout");
     21    });
     22  }, 0);
     23 
     24  window.setTimeout(function() {
     25    parent.tests[2].step(function() {
     26      parent.assert_equals(test_prop, 2, "Global scope from original window timeout");
     27      parent.assert_equals(window.test_prop, 2, "Window property from original window timeout")
     28    });
     29    parent.tests[3].step(function() {
     30      var t = get_this();
     31      parent.assert_equals(t.test_prop, 2, "Window property from original window timeout");
     32      parent.assert_equals(t, window, "Global scope from original window timeout");
     33    });
     34    parent.tests_done();
     35  }, 100);
     36 };
     37 
     38 function get_this() {
     39  return this;
     40 }
     41 </script>