mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:18:48 +00:00
f855ceaa31
- Bug 1163826 - Add remainder of top .jp sites to CSS unprefixing service whitelist. r=dholbert (8ed22f2638) - Bug 1165834: Add alicdn.com (used by taobao.com) to the CSS Unprefixing Service whitelist. r=miketaylr (30d150c28c) - Bug 1166792 - Add 3rd batch of top .jp sites to CSS unprefixing service whitelists. r=dholbert (e4073c1f09) - Bug 1170375 - Add 4th batch of top .jp sites to CSS unprefixing service whitelists. r=dholbert (d741e57cb0) - Bug 1207850 - Temporary fix for canceling the pump used by FetchBody. r=nsm (bc85cb1500) - Bug 1224865: Don't set a document in FetchDriver for requests in workers. r=bkelly (7bcb0bd16b) - Bug 1108181 - Make Headers iterable; r=bzbarsky (da8d6f8bb2) - Bug 1217501 P5 Relax guard checking on Headers with existing headers. r=ehsan (75ec3b6ae5) - Bug 1207882 - Use a separate build target for config/buildid. r=gps (ad9f536aac) - Bug 1216697 - Unship Request.cache until the implementation is finished; r=bzbarsky (49264a21d8) - Bug 1218119 - Simplify defining worker prefs; r=baku (8987aa23c3) - namespace (d88c3b7fc6) - Bug 1179489 - Don't count service workers towards an origin's max worker quota; r=nsm (ce5e1345ba) - Bug 1151646 - Cleanup, r=khuey. (d119d19ea7) - Bug 1118778 - Write upload properties from upload.py; r=glandium (f8745ffda8) - Bug 1194741 - Display upload output; r=nalexander (7adaa41d11) - Bug 1197293 - allow for TC builds that don't use 'make upload'; r=ted (e671e7c651) - Bug 1137000 - Add support for SDK building to moz-automation.mk. r=mshal (69b7ccb3c8) - Bug 1175895 - aid greppability of MOZ_AUTOMATION_*; r=ted (c9a099f168) - Bug 1198179 - Kill gen_mach_buildprops.py; r=ted (fa74e1930f) - Bug 1198179 - make upload.py write properties even if not uploading; r=ted (e7ca79b807) - Bug 8623031 - Move desktop build logic to a container neutral location; r=dustin (81dc866373) - Bug 1187139 (part 1) - Replace nsBaseHashtable::Enumerate() calls in accessible/ with iterators. r=tbsaunde. (7a75c73d17) - Bug 1187139 (part 2) - Replace nsBaseHashtable::Enumerate() calls in accessible/ with iterators. r=tbsaunde. (c631350ddb) - Bug 1187139 (part 3) - Replace nsBaseHashtable::Enumerate() calls in accessible/ with iterators. r=tbsaunde. (052cced2ca) - Bug 1225396 part 4 - Remove @@iterator workaround in Codegen.py. r=bz (3b05ddc4f0) - Bug 1048695 part 1. Pass the set of globals where a member should NOT be exposed to MemberCondition. r=peterv (d5c9040323) - Bug 1048695 part 2. Make interface members not be exposed based on their nonExposedGlobals. r=peterv (e852319bd0) - Bug 1229493 - Stop shell-only modules classes being reported as standard classes r=shu (4a6457af8d) - Bug 1151646 - Fix static analysis bustage. (347564b4d2) - Bug 1231051 - Moz2Dify nsNativeThemeCocoa::DrawWidgetBackground. r=mstange. (cbcbe17e30) - Bug 1178984 - Crashes at nsMenuBarX::RemoveMenuAtIndex. r=spohl (6e5869ae28) - leftovers of Bug 1151345 - Add debug logging to help decipher this bug. r=spohl (22d42fc66d)
220 lines
6.3 KiB
JavaScript
220 lines
6.3 KiB
JavaScript
function testScript(script) {
|
|
// reroute.html should have set this variable if a service worker is present!
|
|
if (!("isSWPresent" in window)) {
|
|
window.isSWPresent = false;
|
|
}
|
|
|
|
function setupPrefs() {
|
|
return new Promise(function(resolve, reject) {
|
|
SpecialPowers.pushPrefEnv({
|
|
"set": [["dom.requestcache.enabled", true],
|
|
["dom.requestcontext.enabled", true],
|
|
["dom.serviceWorkers.enabled", true],
|
|
["dom.serviceWorkers.testing.enabled", true],
|
|
["dom.serviceWorkers.exemptFromPerDomainMax", true]]
|
|
}, resolve);
|
|
});
|
|
}
|
|
|
|
function workerTest() {
|
|
return new Promise(function(resolve, reject) {
|
|
var worker = new Worker("worker_wrapper.js");
|
|
worker.onmessage = function(event) {
|
|
if (event.data.context != "Worker") {
|
|
return;
|
|
}
|
|
if (event.data.type == 'finish') {
|
|
resolve();
|
|
} else if (event.data.type == 'status') {
|
|
ok(event.data.status, event.data.context + ": " + event.data.msg);
|
|
}
|
|
}
|
|
worker.onerror = function(event) {
|
|
reject("Worker error: " + event.message);
|
|
};
|
|
|
|
worker.postMessage({ "script": script });
|
|
});
|
|
}
|
|
|
|
function serviceWorkerTest() {
|
|
var isB2G = !navigator.userAgent.includes("Android") &&
|
|
/Mobile|Tablet/.test(navigator.userAgent);
|
|
if (isB2G) {
|
|
// TODO B2G doesn't support running service workers for now due to bug 1137683.
|
|
dump("Skipping running the test in SW until bug 1137683 gets fixed.\n");
|
|
return Promise.resolve();
|
|
}
|
|
return new Promise(function(resolve, reject) {
|
|
function setupSW(registration) {
|
|
var worker = registration.waiting ||
|
|
registration.active;
|
|
|
|
window.addEventListener("message",function onMessage(event) {
|
|
if (event.data.context != "ServiceWorker") {
|
|
return;
|
|
}
|
|
if (event.data.type == 'finish') {
|
|
window.removeEventListener("message", onMessage);
|
|
registration.unregister()
|
|
.then(resolve)
|
|
.catch(reject);
|
|
} else if (event.data.type == 'status') {
|
|
ok(event.data.status, event.data.context + ": " + event.data.msg);
|
|
}
|
|
}, false);
|
|
|
|
worker.onerror = reject;
|
|
|
|
var iframe = document.createElement("iframe");
|
|
iframe.src = "message_receiver.html";
|
|
iframe.onload = function() {
|
|
worker.postMessage({ script: script });
|
|
};
|
|
document.body.appendChild(iframe);
|
|
}
|
|
|
|
navigator.serviceWorker.register("worker_wrapper.js", {scope: "."})
|
|
.then(function(registration) {
|
|
if (registration.installing) {
|
|
var done = false;
|
|
registration.installing.onstatechange = function() {
|
|
if (!done) {
|
|
done = true;
|
|
setupSW(registration);
|
|
}
|
|
};
|
|
} else {
|
|
setupSW(registration);
|
|
}
|
|
});
|
|
});
|
|
}
|
|
|
|
function windowTest() {
|
|
return new Promise(function(resolve, reject) {
|
|
var scriptEl = document.createElement("script");
|
|
scriptEl.setAttribute("src", script);
|
|
scriptEl.onload = function() {
|
|
runTest().then(resolve, reject);
|
|
};
|
|
document.body.appendChild(scriptEl);
|
|
});
|
|
}
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
// We have to run the window, worker and service worker tests sequentially
|
|
// since some tests set and compare cookies and running in parallel can lead
|
|
// to conflicting values.
|
|
setupPrefs()
|
|
.then(function() {
|
|
return windowTest();
|
|
})
|
|
.then(function() {
|
|
return workerTest();
|
|
})
|
|
.then(function() {
|
|
return serviceWorkerTest();
|
|
})
|
|
.catch(function(e) {
|
|
ok(false, "Some test failed in " + script);
|
|
info(e);
|
|
info(e.message);
|
|
return Promise.resolve();
|
|
})
|
|
.then(function() {
|
|
if (parent && parent.finishTest) {
|
|
parent.finishTest();
|
|
} else {
|
|
SimpleTest.finish();
|
|
}
|
|
});
|
|
}
|
|
|
|
// Utilities
|
|
// =========
|
|
|
|
// Helper that uses FileReader or FileReaderSync based on context and returns
|
|
// a Promise that resolves with the text or rejects with error.
|
|
function readAsText(blob) {
|
|
if (typeof FileReader !== "undefined") {
|
|
return new Promise(function(resolve, reject) {
|
|
var fs = new FileReader();
|
|
fs.onload = function() {
|
|
resolve(fs.result);
|
|
}
|
|
fs.onerror = reject;
|
|
fs.readAsText(blob);
|
|
});
|
|
} else {
|
|
var fs = new FileReaderSync();
|
|
return Promise.resolve(fs.readAsText(blob));
|
|
}
|
|
}
|
|
|
|
function readAsArrayBuffer(blob) {
|
|
if (typeof FileReader !== "undefined") {
|
|
return new Promise(function(resolve, reject) {
|
|
var fs = new FileReader();
|
|
fs.onload = function() {
|
|
resolve(fs.result);
|
|
}
|
|
fs.onerror = reject;
|
|
fs.readAsArrayBuffer(blob);
|
|
});
|
|
} else {
|
|
var fs = new FileReaderSync();
|
|
return Promise.resolve(fs.readAsArrayBuffer(blob));
|
|
}
|
|
}
|
|
|
|
function testScript(script) {
|
|
function workerTest() {
|
|
return new Promise(function(resolve, reject) {
|
|
var worker = new Worker("worker_wrapper.js");
|
|
worker.onmessage = function(event) {
|
|
if (event.data.type == 'finish') {
|
|
resolve();
|
|
} else if (event.data.type == 'status') {
|
|
ok(event.data.status, "Worker fetch test: " + event.data.msg);
|
|
}
|
|
}
|
|
worker.onerror = function(event) {
|
|
reject("Worker error: " + event.message);
|
|
};
|
|
|
|
worker.postMessage({ "script": script });
|
|
});
|
|
}
|
|
|
|
function windowTest() {
|
|
return new Promise(function(resolve, reject) {
|
|
var scriptEl = document.createElement("script");
|
|
scriptEl.setAttribute("src", script);
|
|
scriptEl.onload = function() {
|
|
runTest().then(resolve, reject);
|
|
};
|
|
document.body.appendChild(scriptEl);
|
|
});
|
|
}
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
// We have to run the window and worker tests sequentially since some tests
|
|
// set and compare cookies and running in parallel can lead to conflicting
|
|
// values.
|
|
windowTest()
|
|
.then(function() {
|
|
return workerTest();
|
|
})
|
|
.catch(function(e) {
|
|
ok(false, "Some test failed in " + script);
|
|
info(e);
|
|
info(e.message);
|
|
return Promise.resolve();
|
|
})
|
|
.then(function() {
|
|
SimpleTest.finish();
|
|
});
|
|
}
|
|
|