Bug 1192818 - part1 : dispatch DOMAudioPlaybackStopped when mute the tab. r=baku

The root cause of the intermittent fail is because "DOMAudioPlaybackStopped" has no directly relationship with browser.mute()/unmute().

In [1], the "DOMAudioPlaybackStopped" is caused by audio stop playing, not by calling the browser.mute(). If the audio stops playing before calling the wait_for_event(), the test would be time-out. I guess the bug 1302280 is also caused by same reason.

So this patch would do two thinngs,
1. dispatch "DOMAudioPlaybackStopped" when we mute tab
2. loop the audio in test file, to make sure the "DOMAudioPlaybackStopped" is
   dispatched when muting the audio, not the file ended.
[1] https://goo.gl/ymUv8P

MozReview-Commit-ID: 703JHj9dICT
This commit is contained in:
Alastor Wu
2017-02-21 18:41:09 +08:00
parent ecf10eb7b7
commit 3d07567345
2 changed files with 2 additions and 1 deletions

View File

@@ -996,7 +996,7 @@ private:
IsOwnerAudible() const
{
// Muted or the volume should not be ~0
if (mOwner->Muted() || (std::fabs(mOwner->Volume()) <= 1e-7)) {
if (mOwner->mMuted || (std::fabs(mOwner->Volume()) <= 1e-7)) {
return AudioChannelService::AudibleState::eNotAudible;
}