modules/plugin/test/crashtests/540114-1.html
author L. David Baron <dbaron@dbaron.org>
Tue, 08 Jun 2010 22:28:14 -0700
changeset 43376 ebc6875a1ec4d9c195541647e88d753def3a1180
parent 41489 64d8811a32ec5e2a34a3167e537eb28bf76b8087
permissions -rw-r--r--
Use macros for frame state so that it's easy to change the size and easier to read the constants. (Bug 570837) r=roc

<!DOCTYPE html>
<html class="reftest-wait">
<head>
<script type="text/javascript">
function crashplugin() {
  var plugin = document.getElementById('removeme');
  var flush_reflow = plugin.offsetHeight; // this may not be necessary
  document.body.removeChild(plugin);
  // Give the plugin time to crash
  setTimeout(function() { document.documentElement.removeAttribute('class') },
             1000);
}

function getTestCases() {
  return [
    { testPassed:
      (function () {
        // Assuming the same process is used for removeme and checkme
        var plugin = document.getElementById('checkme');
        try {
          plugin.getPaintCount();
          return true;
        } catch (e) {
          return false;
        }
      }),
      testDescription:
      (function () {
        return "plugin should not crash";
      })
    }
  ];
}
</script>
</head>
<body onload="crashplugin();">
<embed id="checkme" type="application/x-test"/>
<embed id="removeme" type="application/x-test" wmode="window" cleanupwidget="false"/>
</body>
</html>