summaryrefslogtreecommitdiffstats
path: root/dom/base/test/test_plugin_freezing.html
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /dom/base/test/test_plugin_freezing.html
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/base/test/test_plugin_freezing.html')
-rw-r--r--dom/base/test/test_plugin_freezing.html68
1 files changed, 68 insertions, 0 deletions
diff --git a/dom/base/test/test_plugin_freezing.html b/dom/base/test/test_plugin_freezing.html
new file mode 100644
index 000000000..41d41be58
--- /dev/null
+++ b/dom/base/test/test_plugin_freezing.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <title>Test for plugin freezing and thawing</title>
+ <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
+ <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+</head>
+<body>
+<div id="content" style="display: none">
+</div>
+<embed id='e1' type='application/x-test'></embed>
+<script>
+var e1 = document.getElementById('e1');
+var w;
+
+var testIndex = 0;
+var tests;
+
+window.addEventListener("unload", function() {
+ e1.stopWatchingInstanceCount();
+}, false);
+
+function nextTest() {
+ if (testIndex == tests.length) {
+ if (w) {
+ w.close();
+ }
+ SimpleTest.waitForFocus(function() {
+ SimpleTest.finish();
+ });
+ return;
+ }
+
+ var test = tests[testIndex];
+ ++testIndex;
+ test();
+}
+
+function waitForInstanceCount(n) {
+ if (e1.getInstanceCount() == n) {
+ ok(true, "reached instance count " + n);
+ nextTest();
+ return;
+ }
+ setTimeout(function() { waitForInstanceCount(n); }, 0);
+}
+
+tests = [
+ function() { waitForInstanceCount(1); },
+ function() { w.location.href = "about:blank";
+ waitForInstanceCount(0); },
+];
+
+try {
+ e1.startWatchingInstanceCount();
+ var w = window.open("data:text/html,<embed id='e2' type='application/x-test'></embed>");
+ SimpleTest.waitForFocus(nextTest, w);
+ SimpleTest.waitForExplicitFinish();
+} catch (err) {
+ todo(false, "Instances already being watched?");
+}
+
+</script>
+<pre id="test">
+</pre>
+</body>
+</html>