mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 17:55:50 +00:00
e15a06b5ac
Depends on D21215 Differential Revision: https://phabricator.services.mozilla.com/D14130 --HG-- extra : moz-landing-system : lando
34 lines
982 B
JavaScript
34 lines
982 B
JavaScript
/* Any copyright is dedicated to the public domain.
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
// Bug 787517: Remove iframe in the handler of showmodalprompt. This shouldn't
|
|
// cause an exception to be thrown.
|
|
|
|
"use strict";
|
|
|
|
/* global browserElementTestHelpers */
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
browserElementTestHelpers.setEnabledPref(true);
|
|
browserElementTestHelpers.addPermission();
|
|
browserElementTestHelpers.allowTopLevelDataURINavigation();
|
|
|
|
function runTest() {
|
|
var iframe = document.createElement("iframe");
|
|
iframe.setAttribute("mozbrowser", "true");
|
|
document.body.appendChild(iframe);
|
|
|
|
iframe.addEventListener("mozbrowsershowmodalprompt", function(e) {
|
|
document.body.removeChild(iframe);
|
|
SimpleTest.executeSoon(function() {
|
|
ok(true);
|
|
SimpleTest.finish();
|
|
});
|
|
});
|
|
|
|
iframe.src = "data:text/html,<html><body><script>alert(\"test\")</script>" +
|
|
"</body></html>";
|
|
}
|
|
|
|
addEventListener("testready", runTest);
|