gecko-dev/dom/push/test/error_worker.js
Kit Cambridge 18c5c296ef Bug 1246341 - Add a test for push event error reporting. r=dragana
MozReview-Commit-ID: LABOJnYtpD5

--HG--
extra : rebase_source : 86c27b8a2deb388cdb34a82aebd12b042477acb5
2016-03-28 11:40:58 -07:00

11 lines
273 B
JavaScript

this.onpush = function(event) {
var request = event.data.json();
if (request.type == "exception") {
throw new Error("Uncaught exception");
}
if (request.type == "rejection") {
event.waitUntil(Promise.reject(
new Error("Unhandled rejection")));
}
};