2012-09-12 10:12:09 +04:00
|
|
|
/* 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";
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
2013-03-28 23:51:10 +04:00
|
|
|
browserElementTestHelpers.setEnabledPref(true);
|
|
|
|
browserElementTestHelpers.addPermission();
|
2012-09-12 10:12:09 +04:00
|
|
|
|
|
|
|
function runTest() {
|
|
|
|
var iframe = document.createElement('iframe');
|
2014-10-31 05:39:15 +03:00
|
|
|
iframe.setAttribute('mozbrowser', 'true');
|
2012-09-12 10:12:09 +04:00
|
|
|
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>";
|
|
|
|
}
|
|
|
|
|
2013-03-28 23:51:10 +04:00
|
|
|
addEventListener('testready', runTest);
|