Bug 1701423 - [devtools] Fix intermittent on browser_storage_fission_cookies.js. r=ochameau.

This patch waits for the "store-objects-edit" event to be emitted before checking
the content of the UI.

Differential Revision: https://phabricator.services.mozilla.com/D110423
This commit is contained in:
Nicolas Chevobbe 2021-04-02 05:01:53 +00:00
Родитель 4e07c4d3c3
Коммит a902adedc9
1 изменённых файлов: 8 добавлений и 3 удалений

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

@ -35,16 +35,21 @@ add_task(async function() {
checkCookieData("lorem", "ipsum");
info("Add more cookies");
const onUpdated = gUI.once("store-objects-edit");
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function() {
content.window.document.cookie = "foo2=bar2";
const iframe = content.document.querySelector("iframe");
return SpecialPowers.spawn(iframe, [], () => {
content.document.cookie = "lorem2=ipsum2";
});
});
// check that the new data is shown in the table
await onUpdated;
// check that the new data is shown in the table for the iframe document
checkCookieData("lorem2", "ipsum2");
// check that the new data is shown in the table for the top-level document
await selectTreeItem(["cookies", "http://example.com"]);
checkCookieData("foo2", "bar2");
await selectTreeItem(["cookies", "http://example.net"]);
checkCookieData("lorem2", "ipsum2");
});