summaryrefslogtreecommitdiffstats
path: root/dom/base/test
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-12-22 23:48:40 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-12-22 23:48:40 +0100
commitf71108680b30848e48e0a1f7a6cef7fa37ec46b1 (patch)
tree6837e8112b25b27c6f627629e11032bfcf73deef /dom/base/test
parentdfa7af70ce4cd662add88f5e2a881e1054d91ef2 (diff)
downloadUXP-f71108680b30848e48e0a1f7a6cef7fa37ec46b1.tar
UXP-f71108680b30848e48e0a1f7a6cef7fa37ec46b1.tar.gz
UXP-f71108680b30848e48e0a1f7a6cef7fa37ec46b1.tar.lz
UXP-f71108680b30848e48e0a1f7a6cef7fa37ec46b1.tar.xz
UXP-f71108680b30848e48e0a1f7a6cef7fa37ec46b1.zip
Issue #1118 - Part 6: Fix various tests that are no longer correct.
The behavior change of document.open() requires these tests to be changed to account for the new spec behavior.
Diffstat (limited to 'dom/base/test')
-rw-r--r--dom/base/test/test_x-frame-options.html26
1 files changed, 16 insertions, 10 deletions
diff --git a/dom/base/test/test_x-frame-options.html b/dom/base/test/test_x-frame-options.html
index a0c7acdc3..8e8cffcc3 100644
--- a/dom/base/test/test_x-frame-options.html
+++ b/dom/base/test/test_x-frame-options.html
@@ -113,19 +113,25 @@ var testFramesLoaded = function() {
// test that a document can be framed under a javascript: URL opened by the
// same site as the frame
+// We can't set a load event listener before calling document.open/document.write, because those will remove such listeners. So we need to define a function that the new window will be able to call.
+function frameInJSURILoaded(win) {
+ var test = win.document.getElementById("sameorigin3")
+ .contentDocument.getElementById("test");
+ ok(test != null, "frame under javascript: URL should have loaded.");
+ win.close();
+
+ // run last test
+ if (!isUnique) {
+ testFrameInDataURI();
+ } else {
+ testFrameNotLoadedInDataURI();
+ }
+}
+
var testFrameInJSURI = function() {
var html = '<iframe id="sameorigin3" src="http://mochi.test:8888/tests/dom/base/test/file_x-frame-options_page.sjs?testid=sameorigin3&xfo=sameorigin"></iframe>';
var win = window.open();
- win.onload = function() {
- var test = win.document.getElementById("sameorigin3")
- .contentDocument.getElementById("test");
- ok(test != null, "frame under javascript: URL should have loaded.");
- win.close();
-
- // run last test
- testFrameInDataURI();
- }
- win.location.href = "javascript:document.write('"+html+"');document.close();";
+ win.location.href = "javascript:document.open(); onload = opener.frameInJSURILoaded.bind(null, window); document.write('"+html+"');document.close();";
}
// test that a document can be framed under a data: URL opened by the