Closed Bug 1213154 Opened 9 years ago Closed 9 years ago

tab-sound-icon does not display after back/forward navigation

Categories

(Core :: Audio/Video: Playback, defect, P2)

44 Branch
defect

Tracking

()

VERIFIED FIXED
mozilla45
Tracking Status
firefox42 --- affected
firefox43 --- affected
firefox44 --- affected
firefox45 --- verified

People

(Reporter: alice0775, Assigned: baku)

References

Details

Attachments

(2 files, 5 obsolete files)

Steps to reproduce:
1. Open https://videos.cdn.mozilla.net/uploads/mozillaorg/
2. Click "A different kind of browser.webm" link 
   --- observe, tab-sound-icon display as expected
3. Click navigation back button in location bar
4. Click navigation forward button in location bar
--- observe, tab-sound-icon display or not

Actual results.
tab-sound-icon does not display

Expected results:
tab-sound-icon dhould display
Andrea, can you take a look, please?  Thanks!
Component: Tabbed Browser → Audio/Video
Flags: needinfo?(amarchesini)
Product: Firefox → Core
I'm not able to reproduce this issue. Following the STR from the description, I see the icon when I load the video for the first time, then going back the icon disappears, but clicking the forward button, the video and the icon appear again.
Flags: needinfo?(amarchesini)
(In reply to Andrea Marchesini (:baku) from comment #2)
> I'm not able to reproduce this issue. Following the STR from the
> description, I see the icon when I load the video for the first time, then
> going back the icon disappears, but clicking the forward button, the video
> and the icon appear again.


You should wait to stop buffering, then back and forward
Attached patch bfcache.patch (obsolete) — Splinter Review
Assignee: nobody → amarchesini
Attachment #8673654 - Flags: review?(roc)
Blocks: 1214659
Comment on attachment 8673654 [details] [diff] [review]
bfcache.patch

Review of attachment 8673654 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/html/HTMLMediaElement.cpp
@@ +4726,5 @@
>    bool playingThroughTheAudioChannel =
>       (!mPaused &&
>        !Muted() &&
> +      // We should consider any bfcached page as non-playing.
> +      !mEventDeliveryPaused &&

Shouldn't we check mPausedForInactiveDocumentOrChannel instead of this? That gets set to true for an inactive document (or channel), and bfcached documents are inactive.
Attachment #8673654 - Flags: review?(roc) → review-
Attached patch bfcache.patch (obsolete) — Splinter Review
Attachment #8673654 - Attachment is obsolete: true
Attachment #8674190 - Flags: review?(roc)
Keywords: checkin-needed
Attached patch bfcache.patch (obsolete) — Splinter Review
Ehsan, can you double check the changes in the test?
Attachment #8674190 - Attachment is obsolete: true
Attachment #8674884 - Flags: review?(ehsan)
What kind of notification are you getting here, and is it "active" or "inactive"?  I'd like to understand why this is changing here...

Note that test_swapped_browser() is called two times, once when the audio element is playing and once when it's not, so I suspect you should be seeing different values in the two cases.
Flags: needinfo?(amarchesini)
With this patch we receive a notification when we the document is marked as inactive. So we should receive inactive when the document is not visible (replaced by something else and in bfcache), and active when it's shown again.
Flags: needinfo?(amarchesini)
Comment on attachment 8674884 [details] [diff] [review]
bfcache.patch

Review of attachment 8674884 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with the below fixed.

::: browser/base/content/test/general/browser_audioTabIcon.js
@@ +192,5 @@
>             event.detail.changed.indexOf("muted") >= 0;
>    });
>    let AudioPlaybackPromise = new Promise(resolve => {
>      let observer = (subject, topic, data) => {
> +      ok(true, "Should see an audio-playback notification");

OK, so instead of doing this, please compare |data| against "active" or "inactive" based on the isPlaying argument.  Also there is a comment a few lines below when yielding on AudioPlaybackPromise that you need to update as well.
Attachment #8674884 - Flags: review?(ehsan) → review+
Attached patch bfcache.patch (obsolete) — Splinter Review
Attachment #8674884 - Attachment is obsolete: true
Attached patch bfcache.patch (obsolete) — Splinter Review
I cannot do what Ehsan is suggesting because the notification is received by the window who contains the 2 tabs. So, swapping tab I receive 2 notifications and that doesn't allow me to compare the state with isPlaying.
Attachment #8676075 - Attachment is obsolete: true
Keywords: checkin-needed
sorry had to back this out in https://treeherder.mozilla.org/#/jobs?repo=mozilla-inbound&revision=d1d71aba0fbc - one of this change, this one or the other caused a perma failure like https://treeherder.mozilla.org/logviewer.html#?job_id=15945937&repo=mozilla-inbound

since i was unable to determine which of this 2 changes caused this i had to backout both to get the treen green again.
Flags: needinfo?(amarchesini)
Component: Audio/Video → Audio/Video: Playback
Priority: -- → P2
And one more: the push right before you enabled a bunch of tests on e10s runs, including browser_audioTabIcon.js, and you apparently made it racy enough that on slow runs it failed like https://treeherder.mozilla.org/logviewer.html#?job_id=16621574&repo=mozilla-inbound around 10% of the time on Linux32 debug and 25% of the time on ASan.
Attached patch bfcache.patchSplinter Review
mtseng, sorry for changing bug, but this is exactly the same issue we have with reftests in the other bug. As you can see, I changed the code, but enabling/disabling the pref in reftests.ini I break all the tests.

Do you have a time to give me help with it?
Thanks!
Attachment #8676084 - Attachment is obsolete: true
Flags: needinfo?(amarchesini) → needinfo?(mtseng)
I think the problem is not the same. The problem here is actually default-preferences in reftest.list can be setting only once. If you write several lines of default-preferences, previous default-preferences will be ignored. I change the patch and see if it works. Here is try result.

https://treeherder.mozilla.org/#/jobs?repo=try&revision=5a7c444fa360
Flags: needinfo?(mtseng)
wfm on ff42
It's still broken, but I have to fix a gaia marionette test and it's hard to set up the correct environment to run it locally.
Flags: needinfo?(amarchesini)
Attached patch interdiffSplinter Review
Finally I found the time to set up a local environment for mulet + marionette and I wrote this interdiff.

roc, we cannot use mPausedForInactiveDocumentOrChannel in IsPlayingThroughTheAudioChannel because that boolean is set to true when we mute the element by the audiochannel. That means that from that moment it will be muted forever. The real check we want to do is just about bfcache. I used IsActive() for that.

I also added a couple of calls to UpdateAudioChannelPlayingState() when we touch a flag that can change the status of IsPlayingThroughTheAudioChannel.
Attachment #8690570 - Flags: review?(roc)
Depends on: 1227320
https://hg.mozilla.org/mozilla-central/rev/a96f1eaabfce
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Flags: qe-verify+
Verified fixed on Windows 7 64bit, Ubuntu 13.10 32bit and Mac 0SX 10.9.5 using Firefox 45 Beta 2 (buildID: 20160201143558): tab-sound-icon correctly displayed after back/forward navigation.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: