dom/browser-element/mochitest/browserElement_RemoveBrowserElement.js

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     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);

mercurial