1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/browser-element/mochitest/browserElement_RemoveBrowserElement.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,30 @@ 1.4 +/* Any copyright is dedicated to the public domain. 1.5 + http://creativecommons.org/publicdomain/zero/1.0/ */ 1.6 + 1.7 +// Bug 787517: Remove iframe in the handler of showmodalprompt. This shouldn't 1.8 +// cause an exception to be thrown. 1.9 + 1.10 +"use strict"; 1.11 + 1.12 +SimpleTest.waitForExplicitFinish(); 1.13 +browserElementTestHelpers.setEnabledPref(true); 1.14 +browserElementTestHelpers.addPermission(); 1.15 + 1.16 +function runTest() { 1.17 + var iframe = document.createElement('iframe'); 1.18 + SpecialPowers.wrap(iframe).mozbrowser = true; 1.19 + document.body.appendChild(iframe); 1.20 + 1.21 + iframe.addEventListener("mozbrowsershowmodalprompt", function(e) { 1.22 + document.body.removeChild(iframe); 1.23 + SimpleTest.executeSoon(function() { 1.24 + ok(true); 1.25 + SimpleTest.finish(); 1.26 + }); 1.27 + }); 1.28 + 1.29 + iframe.src = "data:text/html,<html><body><script>alert(\"test\")</script>" + 1.30 + "</body></html>"; 1.31 +} 1.32 + 1.33 +addEventListener('testready', runTest);