Bug 1481439 - Print debugging info when browser_ext_omnibox.js fails r=aswan

Print useful information about the visible autocompletion results before
failing the test, for debugging.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Rob Wu 2018-08-30 19:00:11 +00:00
Родитель 73670afee3
Коммит 157b6e767a
1 изменённых файлов: 7 добавлений и 1 удалений

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

@ -118,7 +118,13 @@ add_task(async function() {
// Wait for the autocomplete search. Note that we cannot wait for the search
// to be complete, since the add-on doesn't communicate when it's done, so
// just check matches count.
await waitForAutocompleteResultAt(indexToWaitFor);
try {
await waitForAutocompleteResultAt(indexToWaitFor);
} catch (e) {
// Print message for debugging. Discard data:-URIs.
info(gURLBar.popup.richlistbox.outerHTML.replace(/data:image[^"\s]+/g, "data:image..."));
throw e;
}
return char;
}