зеркало из https://github.com/mozilla/gecko-dev.git
bug 1523104: remote: display error message and a stack in mochitest; r=ato
This commit is contained in:
Родитель
ee11408b81
Коммит
dffc508f5d
|
@ -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();
|
||||
});
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче