dom/plugins/test/mochitest/test_bug854082.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 <!doctype html>
     2 <html>
     3 <head>
     4   <title>Test for Bug 854082</title>
     5   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     6   <script type="text/javascript" src="utils.js"></script>
     7   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     9   <meta http-equiv="content-type" content="text/html; charset=utf-8">
    10   <base href="chrome://browser/content/">
    11 </head>
    12 <body>
    13 <script type="application/javascript">
    14   // Tests that destroying the plugin's frame inside NPP_New does not cause a
    15   // crash
    17   SimpleTest.waitForExplicitFinish();
    18   setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
    20   // Create an object that will spawn asynchronously
    21   var o = document.createElement("object");
    22   o.type = "application/x-test";
    24   // The test plugin sets pluginFoundElement on its element inside NPP_New,
    25   // abuse this to run arbitrary script.
    26   var setterCalled;
    27   o.__defineSetter__("pluginFoundElement", function() {
    28     o.style.display = "none";
    29     // Access clientTop to force layout flush
    30     o.clientTop;
    31     setterCalled = true;
    32   });
    33   document.body.appendChild(o);
    35   SimpleTest.executeSoon(function() {
    36     ok(setterCalled, "Setter called and did not crash");
    37     SimpleTest.finish();
    38   });
    39 </script>
    40 </body>
    41 </html>

mercurial