Name Description Size
browser.toml 1890
browser_audio_focus_management.js These tests are used to ensure that the audio focus management works correctly amongs different tabs no matter the pref is on or off. If the pref is on, there is only one tab which is allowed to play audio at a time, the last tab starting audio will immediately stop other tabs which own audio focus. But notice that playing inaudible media won't gain audio focus. If the pref is off, all audible tabs can own audio focus at the same time without interfering each others. 6540
browser_control_page_with_audible_and_inaudible_media.js When a page has audible media and inaudible media playing at the same time, only audible media should be controlled by media control keys. However, once inaudible media becomes audible, then it should be able to be controlled. 3091
browser_default_action_handler.js This test is used to check the scenario when we should use the customized action handler and the the default action handler (play/pause/stop). If a frame (DOM Window, it could be main frame or an iframe) has active media session, then it should use the customized action handler it it has one. Otherwise, the default action handler should be used. 13232
browser_media_control_audio_focus_within_a_page.js This test is used to check the behaviors when we play media from different frames. When a page contains multiple frames, if those frames are using the media session and set the metadata, then we have to know which frame owns the audio focus that would be the last tab playing media. When the frame owns audio focus, it means its metadata would be displayed on the virtual control interface if it has a media session. 12001
browser_media_control_before_media_starts.js Usually we would only start controlling media after media starts, but if media has entered Picture-in-Picture mode or fullscreen, then we would allow users to control them directly without prior to starting media. 6664
browser_media_control_captured_audio.js When we capture audio from an media element to the web audio, if the media is audible, it should be controlled by media keys as well. 1434
browser_media_control_keys_event.js This test is used to generate platform-independent media control keys event and see if media can be controlled correctly and current we only support `play`, `pause`, `playPause` and `stop` events. 2125
browser_media_control_main_controller.js This test is used to check in different situaition if we can determine the main controller correctly that is the controller which can receive media control keys and show its metadata on the virtual control interface. We will assign different metadata for each tab and know which tab is the main controller by checking main controller's metadata. We will always choose the last tab which plays media as the main controller, and maintain a list by the order of playing media. If the top element in the list has been removed, then we will use the last element in the list as the main controller. Eg. tab1 plays first, then tab2 plays, then tab3 plays, the list would be like [tab1, tab2, tab3] and the main controller would be tab3. If tab3 has been closed, then the list would become [tab1, tab2] and the tab2 would be the main controller. 12422
browser_media_control_metadata.js This test includes many different test cases of checking the current media metadata from the tab which is being controlled by the media control. Each `add_task(..)` is a different testing scenario. Media metadata is the information that can tell user about what title, artist, album and even art work the tab is currently playing to. The metadta is usually set from MediaSession API, but if the site doesn't use that API, we would also generate a default metadata instead. The current metadata would only be available after the page starts playing media at least once, if the page hasn't started any media before, then the current metadata is always empty. For following situations, we would create a default metadata which title is website's title and artwork is from our default favicon icon. (1) the page doesn't use MediaSession API (2) media session doesn't has metadata (3) media session has an empty metadata Otherwise, the current metadata would be media session's metadata from the tab which is currently controlled by the media control. 12337
browser_media_control_non_eligible_media.js This test is used to test couples of things about what kinds of media is eligible for being controlled by media control keys. (1) If media is inaudible all the time, then we would not control it. (2) If media starts inaudibly, we would not try to control it. But once it becomes audible later, we would keep controlling it until it's destroyed. (3) If media's duration is too short (<3s), then we would not control it. 6699
browser_media_control_playback_state.js This test is used to check the actual playback state [1] of the main media controller. The declared playback state is the playback state from the active media session, and the guessed playback state is determined by the media's playback state. Both the declared playback and the guessed playback state would be used to decide the final result of the actual playback state. [1] https://w3c.github.io/mediasession/#actual-playback-state 3729
browser_media_control_position_state.js This test is used to check if we can receive correct position state change, when we set the position state to the media session. 4268
browser_media_control_seekto.js This test is used to check if the `seekto` action can be sent when calling media controller's `seekTo()`. In addition, the seeking related properties which would be sent to the action handler should also be correct as what we set in `seekTo()`. 2763
browser_media_control_stop_timer.js This test is used to check the stop timer for media element, which would stop media control for the specific element when the element has been paused over certain length of time. (That is controlled by the value of the pref `media.mediacontrol.stopcontrol.timer.ms`) In this test, we set the pref to 0 which means the stop timer would be triggered after the media is paused. However, if the media is being used in PIP mode, we won't start the stop timer for it. 2636
browser_media_control_supported_keys.js Supported media keys are used for indicating what UI button should be shown on the virtual control interface. All supported media keys are listed in `MediaKey` in `MediaController.webidl`. Some media keys are defined as default media keys which are always supported. Otherwise, other media keys have to have corresponding action handler on the active media session in order to be added to the supported keys. 3977
browser_nosrc_and_error_media.js To ensure the no src media and media with error won't activate the media controller even if they enters PIP mode or fullscreen. 3291
browser_only_control_non_real_time_media.js This test is used to ensure that real-time media won't be affected by the media control. Only non-real-time media would. 2613
browser_remove_controllable_media_for_active_controller.js If an active controller has an active media session, then it can still be controlled via media key even if there is no controllable media presents. As active media session could still create other controllable media in its action handler, it should still receive media key. However, if a controller doesn't have an active media session, then it won't be controlled via media key when no controllable media presents. 3676
browser_resume_latest_paused_media.js This test is used to check when resuming media, we would only resume latest paused media, not all media in the page. 5827
browser_seek_captured_audio.js Seeking a captured audio media before it starts, and it should still be able to be controlled via media key after it starts playing. 1855
browser_stop_control_after_media_reaches_to_end.js This test is used to ensure that we would stop controlling media after it reaches to the end when a controller doesn't have an active media session. If a controller has an active media session, it would keep active despite media reaches to the end. 3562
browser_suspend_inactive_tab.js This test to used to test the feature that would suspend the inactive tab, which currently is only used on Android. Normally when tab becomes inactive, we would suspend it and stop its script from running. However, if a tab has a main controller, which indicates it might have playng media, or waiting media keys to control media, then it would not be suspended event if it's inactive. In addition, Note that, on Android, audio focus management is enabled by default, so there is only one tab being able to play at a time, which means the tab playing media always has main controller. 4512
file_audio_and_inaudible_media.html page with audible and inaudible media 220
file_autoplay.html Autoplay page 151
file_empty_title.html 125
file_error_media.html Error media 131
file_iframe_media.html 2924
file_main_frame_with_multiple_child_session_frames.html Media control page with multiple iframes which contain media session 253
file_multiple_audible_media.html mutiple audible media 247
file_muted_autoplay.html Muted autoplay page 164
file_no_src_media.html No src media 116
file_non_autoplay.html Non-Autoplay page 1809
file_non_eligible_media.html Media are not eligible to be controlled 551
file_non_looping_media.html Non looping media page 142
head.js This function would create a new foreround tab and load the url for it. In addition, instead of returning a tab element, we return a tab wrapper that helps us to automatically detect if the media controller of that tab dispatches the first (activated) and the last event (deactivated) correctly. @ param url the page url which tab would load @ param input window (optional) if it exists, the tab would be created from the input window. If not, then the tab would be created in current window. @ param needCheck (optional) it decides if we would perform the check for the first and last event on the media controller. It's default true. 12982