Bug 1715632 - [devtools] Wait for the iframe to be loaded in browser_storage_cookies_navigation.js r=Honza
authorJulian Descottes <jdescottes@mozilla.com>
Wed, 23 Feb 2022 12:11:32 +0000
changeset 608492 1aba03afe516e515114026250865743abf195c4e
parent 608491 0bb2f690afeb714eaa4b1d1c99318041e0fdfa38
child 608493 6146bf672aa9778d44ce03e3462371812662ede9
push id158344
push userjdescottes@mozilla.com
push dateWed, 23 Feb 2022 12:13:51 +0000
treeherderautoland@1aba03afe516 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersHonza
bugs1715632
milestone99.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1715632 - [devtools] Wait for the iframe to be loaded in browser_storage_cookies_navigation.js r=Honza Differential Revision: https://phabricator.services.mozilla.com/D139307
devtools/client/storage/test/browser_storage_cookies_navigation.js
--- a/devtools/client/storage/test/browser_storage_cookies_navigation.js
+++ b/devtools/client/storage/test/browser_storage_cookies_navigation.js
@@ -91,17 +91,21 @@ async function testNavigation() {
 
   // make the iframe navigate to a different domain
   const onStorageTreeUpdated = gUI.once("store-objects-edit");
   await SpecialPowers.spawn(
     gBrowser.selectedBrowser,
     [URL_IFRAME],
     async function(url) {
       const iframe = content.document.querySelector("iframe");
+      const onIframeLoaded = new Promise(loaded =>
+        iframe.addEventListener("load", loaded, { once: true })
+      );
       iframe.src = url;
+      await onIframeLoaded;
     }
   );
   info("Waiting for storage tree to update");
   await onStorageTreeUpdated;
 
   info("Waiting for storage tree to refresh and show correct host…");
   await waitUntil(() => isInTree(doc, ["cookies", "https://example.org"]));
   info("Checking cookie data");