Bug 1286895 - Remove a test for checking the number of created workers, r=me

This commit is contained in:
Andrea Marchesini 2016-08-22 12:01:53 +02:00
Родитель 1785b4b376
Коммит d3c5cce268
2 изменённых файлов: 0 добавлений и 85 удалений

Просмотреть файл

@ -144,7 +144,6 @@ support-files =
[test_bug1132395.html]
skip-if = true # bug 1176225
[test_bug1132924.html]
[test_bug1241485.html]
[test_chromeWorker.html]
[test_clearTimeouts.html]
[test_close.html]

Просмотреть файл

@ -1,84 +0,0 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1241485
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 1241485</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">
/** Test for Bug 1241485 **/
SimpleTest.waitForExplicitFinish();
SimpleTest.requestCompleteLog();
SimpleTest.requestFlakyTimeout("requestFlakyTimeout is silly.");
var limit = 10;
SpecialPowers.pushPrefEnv({"set":[["dom.workers.maxPerDomain", limit]] },
function() {
var workers = new Array();
var workerToWait = null;
var url = URL.createObjectURL(new Blob(["postMessage('loaded');"]));
var timeouts = new Array();
function addTimeout(fn, time) {
timeouts.push(setTimeout(fn, time));
}
function createWorker() {
workerToWait = new Worker(url);
workerToWait.onmessage = function(e) {
if (!workers) {
// finish() has been called already.
return;
}
workers.push(workerToWait);
info(workers.length + " workers");
addTimeout(createWorker, 0);
if (workers.length == limit) {
// Just give the worker creation loop some more time to try to
// create more workers to check that we don't go over the limit.
addTimeout(finish, 250);
}
};
}
function finish() {
for (var i = 0; i < timeouts.length; ++i) {
clearTimeout(timeouts[i]);
}
if (workerToWait) {
workerToWait.onmessage = null;
}
ok(workers.length <= limit, "Too many workers created!");
workers = null;
SpecialPowers.gc();
SimpleTest.finish();
}
info("Expecting no more than " + limit + " workers.");
// Make sure we finish at some point, even if creating workers takes
// lots of time.
addTimeout(finish, 10000);
addTimeout(createWorker, 0);
});
</script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1241485">Mozilla Bug 1241485</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
</html>