browsing-context-window.html (1289B)
1 <!doctype html> 2 <html> 3 <head> 4 <title>HTML Test: Newly-Created browsing context Window and `this`</title> 5 <link rel="author" title="Intel" href="http://www.intel.com/" /> 6 <script src="/resources/testharness.js"></script> 7 <script src="/resources/testharnessreport.js"></script> 8 <script src="/common/get-host-info.sub.js"></script> 9 </head> 10 <body> 11 <div id="log"></div> 12 <script> 13 14 /** 15 * Test for creating a new browsing context, [Browsing Contexts](#windows). 16 * This test is separate from the rest of the browsing-content-creation tests 17 * because the `iframe` has a src and thus its document won't be `about:blank`. 18 */ 19 var doc, iframe; 20 21 setup(function () { 22 iframe = document.createElement("iframe"); 23 iframe.src = get_host_info().HTTP_REMOTE_ORIGIN + "/html/browsers/windows/resources/browsing-context-window.html"; 24 document.body.appendChild(iframe); 25 doc = iframe.contentDocument; 26 }); 27 28 async_test(function (t) { 29 window.onmessage = t.step_func(function (e) { 30 assert_equals(e.data.thisWindowEquivalency, true, "The global `this` for the created browsing context should be a reference to Window through WindowProxy"); 31 t.done(); 32 }); 33 }); 34 35 </script> 36 </body> 37 </html>