mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1749013 - Fix browser_jsonview_save_json.js checking disk data too early. r=Honza
Differential Revision: https://phabricator.services.mozilla.com/D135446
This commit is contained in:
parent
8a196d598a
commit
1da3a93991
@ -45,6 +45,10 @@ function awaitSavedFileContents(name, ext) {
|
||||
ok(destFile.exists(), "The downloaded file should exist.");
|
||||
const { path } = destFile;
|
||||
await BrowserTestUtils.waitForCondition(() => IOUtils.exists(path));
|
||||
await BrowserTestUtils.waitForCondition(async () => {
|
||||
const { size } = await IOUtils.stat(path);
|
||||
return size > 0;
|
||||
});
|
||||
const buffer = await IOUtils.read(path);
|
||||
resolve(new TextDecoder().decode(buffer));
|
||||
} catch (error) {
|
||||
|
Loading…
Reference in New Issue
Block a user