send-after-setting-document-domain.htm (1465B)
1 <!doctype html> 2 <html> 3 <head> 4 <title>XMLHttpRequest: send() with document.domain set</title> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <link rel="help" href="https://xhr.spec.whatwg.org/#the-open()-method" data-tested-assertations="following::ol[1]/li[2]/ol[1]/li[3]" /> 8 </head> 9 <body> 10 <div id="log"></div> 11 <script> 12 var test_base_url = location.protocol+'//www2.'+location.host+"/xhr/resources/", 13 test_windows = [ 14 window.open(test_base_url + "send-after-setting-document-domain-window-1.htm"), 15 window.open(test_base_url + "send-after-setting-document-domain-window-2.htm"), 16 ], 17 num_tests_left = test_windows.length; 18 19 async_test(function(wrapper_test) { 20 window.addEventListener("message", function(evt) { 21 // run a shadow test that just forwards the results 22 async_test(function(test) { 23 assert_true(evt.data.passed, evt.data.message); 24 test.done(); 25 }, evt.data.name); 26 27 // after last result comes in, close all test 28 // windows and complete the wrapper test. 29 if (--num_tests_left == 0) { 30 for (var i=0; i<test_windows.length; ++i) { 31 test_windows[i].close(); 32 } 33 wrapper_test.done(); 34 } 35 }, false); 36 }, "All tests ran"); 37 </script> 38 </body> 39 </html>