mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-22 23:27:30 +09:00
moebius#231: Consider blocking top level window data: URIs (tests)
https://github.com/MoonchildProductions/moebius/pull/231
This commit is contained in:
parent
b6f0383b26
commit
745e1809b0
63 changed files with 157 additions and 83 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue