Bug 1494796 - fix verify test r=jdescottes

Differential Revision: https://phabricator.services.mozilla.com/D34981

--HG--
extra : moz-landing-system : lando
This commit is contained in:
yulia 2019-06-14 20:34:04 +00:00
parent 9d1bf84ed1
commit 9ab3272468
2 changed files with 22 additions and 3 deletions

View File

@ -28,6 +28,7 @@ add_task(async function() {
invokeInTab("firstCall");
await waitForPaused(dbg);
await waitForRequestsToSettle(dbg);
await navigate(dbg, "doc-scripts.html", "simple1.js");
await selectSource(dbg, "simple1");
await addBreakpoint(dbg, "simple1.js", 4);
@ -39,18 +40,29 @@ add_task(async function() {
assertPausedLocation(dbg);
is(countSources(dbg), 5, "5 sources are loaded.");
await waitForRequestsToSettle(dbg);
// this test is intermittent without this
let onBreakpoint = waitForDispatch(dbg, "SET_BREAKPOINT");
await navigate(dbg, "doc-scripts.html", ...sources);
await onBreakpoint
is(countSources(dbg), 5, "5 sources are loaded.");
ok(!getIsPaused(getCurrentThread()), "Is not paused");
await waitForRequestsToSettle(dbg);
// this test is intermittent without this
onBreakpoint = waitForDispatch(dbg, "SET_BREAKPOINT");
await navigate(dbg, "doc-scripts.html", ...sources);
await onBreakpoint
is(countSources(dbg), 5, "5 sources are loaded.");
// Test that the current select source persists across reloads
await selectSource(dbg, "long.js");
await waitForRequestsToSettle(dbg);
await waitForRequestsToSettle(dbg);
// this test is intermittent without this
onBreakpoint = waitForDispatch(dbg, "SET_BREAKPOINT");
await reload(dbg, "long.js");
await onBreakpoint
await waitForSelectedSource(dbg, "long.js");
await waitForRequestsToSettle(dbg);

View File

@ -195,8 +195,15 @@ class ThreadClient extends FrontClassWithSpec(threadSpec) {
/**
* Request the loaded sources for the current thread.
*/
getSources() {
return super.sources();
async getSources() {
let sources = [];
try {
({sources} = await super.sources());
} catch (e) {
// we may have closed the connection
console.log(`getSources failed. Connection may have closed: ${e}`);
}
return { sources };
}
/**