dom/plugins/test/crashtests/540114-1.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 class="reftest-wait">
     3 <head>
     4 <script type="text/javascript">
     5 function crashplugin() {
     6   var plugin = document.getElementById('removeme');
     7   var flush_reflow = plugin.offsetHeight; // this may not be necessary
     8   document.body.removeChild(plugin);
     9   // Give the plugin time to crash
    10   setTimeout(function() { document.documentElement.removeAttribute('class') },
    11              1000);
    12 }
    14 function getTestCases() {
    15   return [
    16     { testPassed:
    17       (function () {
    18         // Assuming the same process is used for removeme and checkme
    19         var plugin = document.getElementById('checkme');
    20         try {
    21           plugin.getPaintCount();
    22           return true;
    23         } catch (e) {
    24           return false;
    25         }
    26       }),
    27       testDescription:
    28       (function () {
    29         return "plugin should not crash";
    30       })
    31     }
    32   ];
    33 }
    34 </script>
    35 </head>
    36 <body onload="crashplugin();">
    37 <embed id="checkme" type="application/x-test"/>
    38 <embed id="removeme" type="application/x-test" wmode="window" cleanupwidget="false"/>
    39 </body>
    40 </html>

mercurial