forked from mirrors/gecko-dev
This is split from the previous changeset since if we include dom/ the file size is too large for phabricator to handle. This is an autogenerated commit to handle scripts loading mochitest harness files, in the simple case where the script src is on the same line as the tag. This was generated with https://bug1544322.bmoattachments.org/attachment.cgi?id=9058170 using the `--part 2` argument. Differential Revision: https://phabricator.services.mozilla.com/D27457 --HG-- extra : moz-landing-system : lando
68 lines
1.5 KiB
HTML
68 lines
1.5 KiB
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<title>Test for plugin freezing and thawing</title>
|
|
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
|
|
<script 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();
|
|
});
|
|
|
|
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>
|