Bug 1544595 - Wait for report breakage button visibility in browser_trackingUI_report_breakage.js. r=ewright
authorJohann Hofmann <jhofmann@mozilla.com>
Wed, 24 Apr 2019 14:54:48 +0000
changeset 530003 347e8f1714131ff0aabaa7be1a4c72aa40dbac87
parent 530002 45730400480e77ba6c28f4db3469eb657ddce66b
child 530004 ce050fe2bd45de0a82198ef8e0583bc00f0f4280
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersewright
bugs1544595
milestone68.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 1544595 - Wait for report breakage button visibility in browser_trackingUI_report_breakage.js. r=ewright We made changes to change the visibility of this button whenever the panel is opened, so more lazily. I think this caused some intermittents where the assertion was runinng before the hide/show code executed. Differential Revision: https://phabricator.services.mozilla.com/D28628
browser/base/content/test/trackingUI/browser_trackingUI_report_breakage.js
--- a/browser/base/content/test/trackingUI/browser_trackingUI_report_breakage.js
+++ b/browser/base/content/test/trackingUI/browser_trackingUI_report_breakage.js
@@ -106,18 +106,19 @@ add_task(async function testReportBreaka
     if (scenario.hasException) {
       Services.perms.add(uri, "trackingprotection", Services.perms.ALLOW_ACTION);
     }
 
     await BrowserTestUtils.withNewTab(scenario.url, async function() {
       await openIdentityPopup();
 
       let reportBreakageButton = document.getElementById("identity-popup-content-blocking-report-breakage");
-      is(BrowserTestUtils.is_visible(reportBreakageButton), scenario.buttonVisible,
-        "report breakage button has the correct visibility");
+      await TestUtils.waitForCondition(() => BrowserTestUtils.is_visible(reportBreakageButton) == scenario.buttonVisible,
+        "waiting for correct visibility");
+      ok(true, "report breakage button has the correct visibility");
     });
 
     Services.perms.remove(uri, "trackingprotection");
     for (let pref in scenario.prefs) {
       Services.prefs.clearUserPref(pref);
     }
   }
 });