1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/plugins/test/crashtests/540114-1.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,40 @@ 1.4 +<!DOCTYPE html> 1.5 +<html class="reftest-wait"> 1.6 +<head> 1.7 +<script type="text/javascript"> 1.8 +function crashplugin() { 1.9 + var plugin = document.getElementById('removeme'); 1.10 + var flush_reflow = plugin.offsetHeight; // this may not be necessary 1.11 + document.body.removeChild(plugin); 1.12 + // Give the plugin time to crash 1.13 + setTimeout(function() { document.documentElement.removeAttribute('class') }, 1.14 + 1000); 1.15 +} 1.16 + 1.17 +function getTestCases() { 1.18 + return [ 1.19 + { testPassed: 1.20 + (function () { 1.21 + // Assuming the same process is used for removeme and checkme 1.22 + var plugin = document.getElementById('checkme'); 1.23 + try { 1.24 + plugin.getPaintCount(); 1.25 + return true; 1.26 + } catch (e) { 1.27 + return false; 1.28 + } 1.29 + }), 1.30 + testDescription: 1.31 + (function () { 1.32 + return "plugin should not crash"; 1.33 + }) 1.34 + } 1.35 + ]; 1.36 +} 1.37 +</script> 1.38 +</head> 1.39 +<body onload="crashplugin();"> 1.40 +<embed id="checkme" type="application/x-test"/> 1.41 +<embed id="removeme" type="application/x-test" wmode="window" cleanupwidget="false"/> 1.42 +</body> 1.43 +</html>