summaryrefslogtreecommitdiffstats
path: root/js/xpconnect/tests/mochitest/file_crossOriginObjects.html
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /js/xpconnect/tests/mochitest/file_crossOriginObjects.html
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-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.html')
-rw-r--r--js/xpconnect/tests/mochitest/file_crossOriginObjects.html35
1 files changed, 35 insertions, 0 deletions
diff --git a/js/xpconnect/tests/mochitest/file_crossOriginObjects.html b/js/xpconnect/tests/mochitest/file_crossOriginObjects.html
new file mode 100644
index 000000000..c3093ebda
--- /dev/null
+++ b/js/xpconnect/tests/mochitest/file_crossOriginObjects.html
@@ -0,0 +1,35 @@
+<!doctype html>
+<html>
+<head>
+<script>
+ // Override the |frames| property to test that such overrides are
+ // properly ignored cross-origin.
+ window.frames = "override";
+
+ // If we get a postMessage, we grab references to everything and set
+ // document.domain to trim off our topmost subdomain.
+ window.onmessage = function(evt) {
+ window.windowReferences = [];
+ window.locationReferences = [];
+ for (var i = 0; i < parent.length; ++i) {
+ windowReferences.push(parent[i]);
+ locationReferences.push(parent[i].location);
+ }
+ document.domain = document.domain.substring(document.domain.indexOf('.') + 1);
+ evt.source.postMessage('', '*');
+ }
+
+ function checkWindowReferences() {
+ for (var i = 0; i < parent.length; ++i) {
+ if (windowReferences[i] != parent[i])
+ throw new Error("Window references don't match for " + i + " after document.domain");
+ if (locationReferences[i] != parent[i].location)
+ throw new Error("Location references don't match for " + i + " after document.domain");
+ }
+ return true;
+ }
+</script>
+</head>
+<body>
+</body>
+</html>