tor-browser

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

object-handler.html (1553B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>HTML Test: object - handler</title>
      4 <link rel="author" title="Intel" href="http://www.intel.com" />
      5 <script src="/resources/testharness.js"></script>
      6 <script src="/resources/testharnessreport.js"></script>
      7 <div id="log"></div>
      8 <object id="test" name="obj" data="test0.html" type="text/html"></object>
      9 <script>
     10 
     11 var t1 = async_test("The nested browsing context must be navigated to the resource specified by the data attribute.");
     12 var t2 = async_test("The object.data must not be updated if the browsing context gets further navigated.");
     13 
     14 function callback(data) {
     15  if (data == "test0") {
     16    t1.step(function() {
     17      var testEle = document.getElementById("test");
     18      assert_true(testEle.contentDocument.location.href.indexOf("test0.html") != -1, "The nested browsing context should be navigated to test0.html.");
     19      window["obj"].history.replaceState({state:"ok"}, "mytitle ", "object-fallback.html");
     20      assert_not_equals(testEle.contentDocument.location.href.indexOf("object-fallback.html"), -1, "The nested browsing context should be replacement enabled.");
     21    });
     22    t1.done();
     23  } else if (data == "test1") {
     24    t2.step(function() {
     25      var testEle = document.getElementById("test");
     26      assert_true(testEle.contentDocument.location.href.indexOf("test1.html") != -1, "The browsing context should be navigated to test1.html.");
     27      assert_true(testEle.data.indexOf("test0.html") != -1, "The value of attribute data should not be updated.");
     28    });
     29    t2.done();
     30  }
     31 }
     32 
     33 </script>