Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* Any copyright is dedicated to the public domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
4 // Bug 787517: Remove iframe in the handler of showmodalprompt. This shouldn't
5 // cause an exception to be thrown.
7 "use strict";
9 SimpleTest.waitForExplicitFinish();
10 browserElementTestHelpers.setEnabledPref(true);
11 browserElementTestHelpers.addPermission();
13 function runTest() {
14 var iframe = document.createElement('iframe');
15 SpecialPowers.wrap(iframe).mozbrowser = true;
16 document.body.appendChild(iframe);
18 iframe.addEventListener("mozbrowsershowmodalprompt", function(e) {
19 document.body.removeChild(iframe);
20 SimpleTest.executeSoon(function() {
21 ok(true);
22 SimpleTest.finish();
23 });
24 });
26 iframe.src = "data:text/html,<html><body><script>alert(\"test\")</script>" +
27 "</body></html>";
28 }
30 addEventListener('testready', runTest);