Chromium Code Reviews| Index: LayoutTests/plugins/plugin-persists.html |
| diff --git a/LayoutTests/plugins/plugin-persists.html b/LayoutTests/plugins/plugin-persists.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..554d48570bd012ae5ad093bcad719623d47e34fe |
| --- /dev/null |
| +++ b/LayoutTests/plugins/plugin-persists.html |
| @@ -0,0 +1,45 @@ |
| +<html> |
| +<head> |
| +<style> |
| + #plugin { |
| + width: 150px; |
| + height: 150px; |
| + } |
| +</style> |
| +</head> |
| + |
| +<body> |
| +<embed id="plugin" type="application/x-webkit-test-webplugin-persistent" primitive="triangle" background-color="green" primitive-color="blue"></embed> |
| +<div>Each line below should start with 'Pass':</div> |
| +<div id="result1"></div> |
| +<div id="result2"></div> |
| +<script> |
| + |
| + if (!window.testRunner) { |
| + document.write("This test does not work in manual mode."); |
| + } else { |
| + testRunner.dumpAsText(); |
| + testRunner.waitUntilDone(); |
| + |
| + if (plugin.isPersistent) |
| + result1.innerHTML = "Pass: plugin identifies itself as persistent."; |
| + else |
| + result1.innerHTML = "Fail: plugin identifies itself as not-persistent."; |
| + |
| + // Verify that the plugin is not destroyed. |
| + plugin.setAttribute("display", "none"); |
| + // Force synchronous style recalc. |
| + document.body.offsetTop; |
|
eseidel
2013/12/12 20:40:13
I might use plugin.offsetTop to make sure we don't
wjmaclean
2013/12/12 22:31:15
Thanks, will give that a try.
|
| + |
| + window.setTimeout(function () { |
| + if (plugin.instanceId == 1) |
| + result2.innerHTML = "Pass: plugin is persisting."; |
| + else |
| + result2.innerHTML = "Fail: plugin failed to persist."; |
| + testRunner.notifyDone(); |
| + }, 50); |
| + } |
| + |
| +</script> |
| +</body> |
| +</html> |