mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-04 11:26:09 +00:00
4ba9c81516
Implement Crash Report for Reporting API. The browser test will force a crash of the renderer and check that a report is sent to the server. Because of this (intentional) crash, the verification test fail. So we disable verification test for that test. Differential Revision: https://phabricator.services.mozilla.com/D58053 --HG-- extra : moz-landing-system : lando
38 lines
887 B
JavaScript
38 lines
887 B
JavaScript
"use strict";
|
|
|
|
/* exported storeReportingHeader */
|
|
async function storeReportingHeader(browser, reportingURL, extraParams = "") {
|
|
await SpecialPowers.spawn(
|
|
browser,
|
|
[{ url: reportingURL, extraParams }],
|
|
async obj => {
|
|
await content
|
|
.fetch(
|
|
obj.url +
|
|
"?task=header" +
|
|
(obj.extraParams.length ? "&" + obj.extraParams : "")
|
|
)
|
|
.then(r => r.text())
|
|
.then(text => {
|
|
is(text, "OK", "Report-to header sent");
|
|
});
|
|
}
|
|
);
|
|
}
|
|
|
|
/* exported checkReport */
|
|
function checkReport(reportingURL) {
|
|
return new Promise(resolve => {
|
|
let id = setInterval(_ => {
|
|
fetch(reportingURL + "?task=check")
|
|
.then(r => r.text())
|
|
.then(text => {
|
|
if (text) {
|
|
resolve(JSON.parse(text));
|
|
clearInterval(id);
|
|
}
|
|
});
|
|
}, 1000);
|
|
});
|
|
}
|