choose-_top-003.html (1062B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>HTML Test: Choose browsing context - '_top' (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 testFunc = (function (t) { 16 var completed = 0; 17 var testCount = 2; 18 return function (actual, expected) { 19 assert_equals(actual, expected); 20 if (++completed >= testCount) { 21 t.done(); 22 } 23 } 24 }(t)); 25 26 t.add_cleanup(() => prefixedStorage.cleanup()); 27 28 prefixedStorage.onSet('isTop', t.step_func(e => { 29 testFunc(e.newValue, 'true'); 30 })); 31 prefixedStorage.onSet('name', t.step_func(e => { 32 testFunc(e.newValue, 'topWin'); 33 })); 34 35 window.open(prefixedStorage.url('resources/choose-_top-003-iframe-1.html'), '_blank'); 36 }, 'choosing _top context should be case-insensitive'); 37 38 </script> 39 </body>