bug 1523104: remote: display error message and a stack in mochitest; r=ato

This commit is contained in:
Alexandre Poirot 2019-02-22 04:15:58 -08:00 коммит произвёл Andreas Tolfsen
Родитель ee11408b81
Коммит dffc508f5d
1 изменённых файлов: 15 добавлений и 1 удалений

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

@ -10,6 +10,20 @@
const TEST_URI = "data:text/html;charset=utf-8,default-test-page";
add_task(async function() {
try {
await testCDP();
} catch (e) {
// Display better error message with the server side stacktrace
// if an error happened on the server side:
if (e.response) {
throw new Error("CDP Exception:\n" + e.response + "\n");
} else {
throw e;
}
}
});
async function testCDP() {
// Open a test page, to prevent debugging the random default page
const tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_URI);
@ -62,4 +76,4 @@ add_task(async function() {
BrowserTestUtils.removeTab(tab);
await RemoteAgent.close();
});
}