diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /js/xpconnect/tests/mochitest/file_crossOriginObjects_documentDomain.html | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'js/xpconnect/tests/mochitest/file_crossOriginObjects_documentDomain.html')
-rw-r--r-- | js/xpconnect/tests/mochitest/file_crossOriginObjects_documentDomain.html | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/js/xpconnect/tests/mochitest/file_crossOriginObjects_documentDomain.html b/js/xpconnect/tests/mochitest/file_crossOriginObjects_documentDomain.html new file mode 100644 index 000000000..1c0f05bd2 --- /dev/null +++ b/js/xpconnect/tests/mochitest/file_crossOriginObjects_documentDomain.html @@ -0,0 +1,55 @@ +<!DOCTYPE html> +<html> +<head> + <script> + function loadFrames() { + window.A = document.getElementById('A').contentWindow; + window.B = document.getElementById('B').contentWindow; + window.C = document.getElementById('C').contentWindow; + window.D = document.getElementById('D').contentWindow; + + var path = location.pathname.substring(0, location.pathname.lastIndexOf('/')) + '/file_crossOriginObjects.html'; + A.location = 'file_crossOriginObjects.html'; + B.location = frameURI = 'http://test2.mochi.test:' + location.port + path; + C.location = frameURI = 'http://test1.mochi.test:' + location.port + path; + D.location = frameURI = 'http://test1.mochi.test:' + location.port + path; + + var loadCount = 0; + function frameLoaded() { + if (++loadCount == 4) + go(); + } + Array.forEach(document.getElementsByTagName('iframe'), function(ifr) { ifr.onload = frameLoaded; }); + } + + + var results = []; + function assert(cond, msg) { + results.push({pass: !!cond, message: msg}); + } + + function go() { + window.onmessage = function() { + assert(B.checkWindowReferences(), "B's Window references are still self-consistent after document.domain"); + for (var i = 0; i < window.length; ++i) { + assert(window[i] === B.windowReferences[i], + "Window reference " + i + " consistent between globals after document.domain"); + assert(window[i].location === B.locationReferences[i], + "Location reference " + i + " consistent between globals after document.domain"); + } + opener.postMessage(results, '*'); + }; + A.document.domain = A.document.domain; + document.domain = document.domain; + B.postMessage('', '*'); + } + + </script> +</head> +<body onload="loadFrames()"> + <iframe id="A"></iframe> + <iframe id="B"></iframe> + <iframe id="C"></iframe> + <iframe id="D"></iframe> +</body> +</html> |