Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Unified Diff: LayoutTests/plugins/plugin-persists.html

Issue 23618022: BrowserPlugin/WebView - Move plugin lifetime to DOM (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add tests, make plugin creation synchronous. Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698