Merge pull request #4541 from yurydelendik/chrometest
Cools down Chrome/Windows during testing
This commit is contained in:
commit
3e71b3a5fa
@ -35,6 +35,9 @@ var appPath, masterMode, browser, canvas, dummyCanvas, currentTaskIdx,
|
|||||||
manifest, stdout;
|
manifest, stdout;
|
||||||
var inFlightRequests = 0;
|
var inFlightRequests = 0;
|
||||||
|
|
||||||
|
// Chrome for Windows locks during testing on low end machines
|
||||||
|
var letItCooldown = /Windows.*?Chrom/i.test(navigator.userAgent);
|
||||||
|
|
||||||
function queryParams() {
|
function queryParams() {
|
||||||
var qs = window.location.search.substring(1);
|
var qs = window.location.search.substring(1);
|
||||||
var kvs = qs.split('&');
|
var kvs = qs.split('&');
|
||||||
@ -84,7 +87,7 @@ window.load = function load() {
|
|||||||
}, delay);
|
}, delay);
|
||||||
};
|
};
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup(callback) {
|
||||||
// Clear out all the stylesheets since a new one is created for each font.
|
// Clear out all the stylesheets since a new one is created for each font.
|
||||||
while (document.styleSheets.length > 0) {
|
while (document.styleSheets.length > 0) {
|
||||||
var styleSheet = document.styleSheets[0];
|
var styleSheet = document.styleSheets[0];
|
||||||
@ -107,6 +110,11 @@ function cleanup() {
|
|||||||
delete manifest[i].pdfDoc;
|
delete manifest[i].pdfDoc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (letItCooldown) {
|
||||||
|
setTimeout(callback, 500);
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function exceptionToString(e) {
|
function exceptionToString(e) {
|
||||||
@ -120,8 +128,10 @@ function exceptionToString(e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function nextTask() {
|
function nextTask() {
|
||||||
cleanup();
|
cleanup(continueNextTask);
|
||||||
|
}
|
||||||
|
|
||||||
|
function continueNextTask() {
|
||||||
if (currentTaskIdx == manifest.length) {
|
if (currentTaskIdx == manifest.length) {
|
||||||
done();
|
done();
|
||||||
return;
|
return;
|
||||||
@ -401,7 +411,11 @@ function send(url, message, callback) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (callback) {
|
if (callback) {
|
||||||
callback();
|
if (letItCooldown) {
|
||||||
|
setTimeout(callback, 100);
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -47,6 +47,7 @@ function WebServer() {
|
|||||||
this.port = 8000;
|
this.port = 8000;
|
||||||
this.server = null;
|
this.server = null;
|
||||||
this.verbose = false;
|
this.verbose = false;
|
||||||
|
this.disableRangeRequests = false;
|
||||||
this.hooks = {
|
this.hooks = {
|
||||||
'GET': [],
|
'GET': [],
|
||||||
'POST': []
|
'POST': []
|
||||||
@ -89,8 +90,7 @@ WebServer.prototype = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// disables range requests for chrome windows -- locks during testing
|
var disableRangeRequests = this.disableRangeRequests;
|
||||||
var disableRangeRequests = /Windows.*?Chrom/i.test(agent);
|
|
||||||
|
|
||||||
var filePath;
|
var filePath;
|
||||||
fs.realpath(path.join(this.root, pathPart), checkFile);
|
fs.realpath(path.join(this.root, pathPart), checkFile);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user