Bug 1576333 - Part 3: Fix broken test_inprogress r=zombie

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nils Maier 2019-09-06 03:09:30 +00:00
Родитель f28d2b02a0
Коммит 12ec8dfe49
1 изменённых файлов: 5 добавлений и 2 удалений

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

@ -633,7 +633,9 @@ add_task(async function test_inprogress() {
resumePromise = new Promise(resolve => {
resume = resolve;
});
server.registerPathHandler("/slow", async (request, response) => {
let hit = false;
server.registerPathHandler("/data/slow", async (request, response) => {
hit = true;
response.processAsync();
await resumePromise;
response.setHeader("Content-type", "text/plain");
@ -662,7 +664,7 @@ add_task(async function test_inprogress() {
);
browser.downloads.onChanged.addListener(info => {
if (info.id == id && info.state.current == "complete") {
if (info.id == id && info.state && info.state.current == "complete") {
browser.test.notifyPass("done");
}
});
@ -678,4 +680,5 @@ add_task(async function test_inprogress() {
resume();
await extension.awaitFinish("done");
await extension.unload();
Assert.ok(hit, "slow path was actually hit");
});