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

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

mercurial