Bug 1284102 - Fix a race in test code. r=florian
authorAndreas Pehrson <pehrsons@gmail.com>
Fri, 23 Sep 2016 11:21:50 +0200
changeset 318597 308e82fff677ea90a2e4ae453af8eba6d944459f
parent 318596 583a86a0e8d214f6110ae12d9381065ffea76042
child 318598 ce4fb8910a523b320b6e05a660819370bba647b2
push id20725
push userphilringnalda@gmail.com
push dateThu, 20 Oct 2016 01:36:01 +0000
treeherderfx-team@998ad5a74da8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian
bugs1284102
milestone52.0a1
Bug 1284102 - Fix a race in test code. r=florian MozReview-Commit-ID: 95xu305OBBM
browser/base/content/test/webrtc/browser_devices_get_user_media_anim.js
--- a/browser/base/content/test/webrtc/browser_devices_get_user_media_anim.js
+++ b/browser/base/content/test/webrtc/browser_devices_get_user_media_anim.js
@@ -53,16 +53,20 @@ var gTests = [
       // Ensure the icon disappears when selecting the tab.
       yield BrowserTestUtils.removeTab(gBrowser.selectedTab);
       ok(tab.selected, "the tab with ongoing sharing is selected again");
       is(window.getComputedStyle(icon).display, "none",
          "the animated sharing icon is gone after selecting the tab again");
 
       // And finally verify the attribute is removed when closing the stream.
       yield closeStream();
+
+      // TODO(Bug 1304997): Fix the race in closeStream() and remove this
+      // promiseWaitForCondition().
+      yield promiseWaitForCondition(() => !tab.getAttribute("sharing"));
       is(tab.getAttribute("sharing"), "",
          "the tab no longer has the 'sharing' attribute after closing the stream");
     }
 
     yield getStreamAndCheckBackgroundAnim(true, true, "camera");
     yield getStreamAndCheckBackgroundAnim(false, true, "camera");
     yield getStreamAndCheckBackgroundAnim(true, false, "microphone");
   }