mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
0d7d241faf
--HG-- extra : rebase_source : cf8294ebf52bf91b067dc065ccf92098c529a445
67 lines
1.4 KiB
HTML
67 lines
1.4 KiB
HTML
<!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();
|
|
if (w) {
|
|
w.close();
|
|
}
|
|
}, false);
|
|
|
|
function nextTest() {
|
|
if (testIndex == tests.length) {
|
|
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); }, 100);
|
|
}
|
|
|
|
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>");
|
|
w.onload = nextTest;
|
|
SimpleTest.waitForExplicitFinish();
|
|
} catch (err) {
|
|
todo(false, "Instances already being watched?");
|
|
}
|
|
|
|
</script>
|
|
<pre id="test">
|
|
</pre>
|
|
</body>
|
|
</html>
|