summaryrefslogtreecommitdiffstats
path: root/editor
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-05-06 14:31:20 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-05-06 14:31:20 +0200
commit4b7a2c677a8bda717cbc21f8e06ee43c0d9f0005 (patch)
treeea479247696202858d088702ecd85b4163c4750a /editor
parent7d5f95a8e57de5255ad2767342c1f2392b6f261f (diff)
downloadUXP-4b7a2c677a8bda717cbc21f8e06ee43c0d9f0005.tar
UXP-4b7a2c677a8bda717cbc21f8e06ee43c0d9f0005.tar.gz
UXP-4b7a2c677a8bda717cbc21f8e06ee43c0d9f0005.tar.lz
UXP-4b7a2c677a8bda717cbc21f8e06ee43c0d9f0005.tar.xz
UXP-4b7a2c677a8bda717cbc21f8e06ee43c0d9f0005.zip
moebius#231: Consider blocking top level window data: URIs (tests)
https://github.com/MoonchildProductions/moebius/pull/231
Diffstat (limited to 'editor')
-rw-r--r--editor/libeditor/tests/browser.ini4
-rw-r--r--editor/libeditor/tests/bug527935.html2
-rw-r--r--editor/libeditor/tests/bug527935_2.html1
-rw-r--r--editor/libeditor/tests/file_bug635636_2.html1
-rw-r--r--editor/libeditor/tests/file_bug966155.html1
-rw-r--r--editor/libeditor/tests/file_bug966552.html1
-rw-r--r--editor/libeditor/tests/test_bug966155.html15
-rw-r--r--editor/libeditor/tests/test_bug966552.html13
8 files changed, 19 insertions, 19 deletions
diff --git a/editor/libeditor/tests/browser.ini b/editor/libeditor/tests/browser.ini
index 249f59aa8..bd234fc8d 100644
--- a/editor/libeditor/tests/browser.ini
+++ b/editor/libeditor/tests/browser.ini
@@ -1,6 +1,8 @@
[browser_bug527935.js]
skip-if = toolkit == 'android'
-support-files = bug527935.html
+support-files =
+ bug527935.html
+ bug527935_2.html
[browser_bug629172.js]
skip-if = toolkit == 'android'
support-files = bug629172.html
diff --git a/editor/libeditor/tests/bug527935.html b/editor/libeditor/tests/bug527935.html
index 4bfa1bac2..1731734d2 100644
--- a/editor/libeditor/tests/bug527935.html
+++ b/editor/libeditor/tests/bug527935.html
@@ -3,7 +3,7 @@
<body>
<div id="content">
<iframe id="formTarget" name="formTarget"></iframe>
- <form action="data:text/html," target="formTarget">
+ <form action="bug527935_2.html" target="formTarget">
<input name="test" id="initValue"><input type="submit">
</form>
</div>
diff --git a/editor/libeditor/tests/bug527935_2.html b/editor/libeditor/tests/bug527935_2.html
new file mode 100644
index 000000000..96af0721d
--- /dev/null
+++ b/editor/libeditor/tests/bug527935_2.html
@@ -0,0 +1 @@
+<html><body>dummy page</body></html>
diff --git a/editor/libeditor/tests/file_bug635636_2.html b/editor/libeditor/tests/file_bug635636_2.html
new file mode 100644
index 000000000..bf0c8101f
--- /dev/null
+++ b/editor/libeditor/tests/file_bug635636_2.html
@@ -0,0 +1 @@
+<html><body>2</body></html>
diff --git a/editor/libeditor/tests/file_bug966155.html b/editor/libeditor/tests/file_bug966155.html
new file mode 100644
index 000000000..04f55a918
--- /dev/null
+++ b/editor/libeditor/tests/file_bug966155.html
@@ -0,0 +1 @@
+<input><iframe onload="contentDocument.designMode = 'on';">
diff --git a/editor/libeditor/tests/file_bug966552.html b/editor/libeditor/tests/file_bug966552.html
new file mode 100644
index 000000000..5061c2e40
--- /dev/null
+++ b/editor/libeditor/tests/file_bug966552.html
@@ -0,0 +1 @@
+<body onload="document.designMode='on'">test</body>
diff --git a/editor/libeditor/tests/test_bug966155.html b/editor/libeditor/tests/test_bug966155.html
index 524b15d69..1e7ed67f3 100644
--- a/editor/libeditor/tests/test_bug966155.html
+++ b/editor/libeditor/tests/test_bug966155.html
@@ -18,13 +18,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=966155
<script class="testbody" type="text/javascript">
SimpleTest.waitForExplicitFinish();
-addLoadEvent(function() {
- var win = window.open("data:text/html,<input><iframe onload=\"contentDocument.designMode = 'on';\">", "", "test-966155");
- win.addEventListener("load", function onLoad() {
- win.removeEventListener("load", onLoad);
- runTest(win);
- }, false);
-});
+var win = window.open("file_bug966155.html", "", "test-966155");
+win.addEventListener("load", function() {
+ runTest(win);
+}, {once: true});
function runTest(win) {
SimpleTest.waitForFocus(function() {
@@ -38,14 +35,14 @@ function runTest(win) {
"test".split("").forEach(function(letter) {
synthesizeKey(letter, {}, win);
});
- is(iframeDoc.body.textContent, "test", "entered the text");
+ is(iframeDoc.body.textContent.trim(), "test", "entered the text");
// focus the input box
input.focus();
// press tab
synthesizeKey("VK_TAB", {}, win);
// Now press Ctrl+Backspace
synthesizeKey("VK_BACK_SPACE", {ctrlKey: true}, win);
- is(iframeDoc.body.textContent, "", "deleted the text");
+ is(iframeDoc.body.textContent.trim(), "", "deleted the text");
win.close();
SimpleTest.finish();
}, win);
diff --git a/editor/libeditor/tests/test_bug966552.html b/editor/libeditor/tests/test_bug966552.html
index 3d0ec5fe3..e18883aad 100644
--- a/editor/libeditor/tests/test_bug966552.html
+++ b/editor/libeditor/tests/test_bug966552.html
@@ -18,13 +18,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=966552
<script class="testbody" type="text/javascript">
SimpleTest.waitForExplicitFinish();
-addLoadEvent(function() {
- var win = window.open("data:text/html,<body onload=\"document.designMode='on'\">test</body>", "", "test-966552");
- win.addEventListener("load", function onLoad() {
- win.removeEventListener("load", onLoad);
- runTest(win);
- }, false);
-});
+var win = window.open("file_bug966552.html", "", "test-966552");
+win.addEventListener("load", function() {
+ runTest(win);
+}, {once: true});
function runTest(win) {
SimpleTest.waitForFocus(function() {
@@ -33,7 +30,7 @@ function runTest(win) {
doc.body.focus();
sel.collapse(doc.body.firstChild, 2);
synthesizeKey("VK_BACK_SPACE", {ctrlKey: true}, win);
- is(doc.body.textContent, "st");
+ is(doc.body.textContent.trim(), "st");
win.close();
SimpleTest.finish();
}, win);