dom/browser-element/mochitest/browserElement_RemoveBrowserElement.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:7d69b14edec1
1 /* Any copyright is dedicated to the public domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
3
4 // Bug 787517: Remove iframe in the handler of showmodalprompt. This shouldn't
5 // cause an exception to be thrown.
6
7 "use strict";
8
9 SimpleTest.waitForExplicitFinish();
10 browserElementTestHelpers.setEnabledPref(true);
11 browserElementTestHelpers.addPermission();
12
13 function runTest() {
14 var iframe = document.createElement('iframe');
15 SpecialPowers.wrap(iframe).mozbrowser = true;
16 document.body.appendChild(iframe);
17
18 iframe.addEventListener("mozbrowsershowmodalprompt", function(e) {
19 document.body.removeChild(iframe);
20 SimpleTest.executeSoon(function() {
21 ok(true);
22 SimpleTest.finish();
23 });
24 });
25
26 iframe.src = "data:text/html,<html><body><script>alert(\"test\")</script>" +
27 "</body></html>";
28 }
29
30 addEventListener('testready', runTest);

mercurial