dom/plugins/test/mochitest/test_bug854082.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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