| Index: content/browser/web_contents/web_contents_impl_unittest.cc
|
| diff --git a/content/browser/web_contents/web_contents_impl_unittest.cc b/content/browser/web_contents/web_contents_impl_unittest.cc
|
| index ab40bcd466f7431fb7b60094387f79825a8ff74e..89ccba00876825c718b60b391680690e3cd15220 100644
|
| --- a/content/browser/web_contents/web_contents_impl_unittest.cc
|
| +++ b/content/browser/web_contents/web_contents_impl_unittest.cc
|
| @@ -9,7 +9,7 @@
|
| #include "content/browser/frame_host/interstitial_page_impl.h"
|
| #include "content/browser/frame_host/navigation_entry_impl.h"
|
| #include "content/browser/frame_host/render_frame_host_impl.h"
|
| -#include "content/browser/media/audio_stream_monitor.h"
|
| +#include "content/browser/media/audio_state_provider.h"
|
| #include "content/browser/renderer_host/render_view_host_impl.h"
|
| #include "content/browser/site_instance_impl.h"
|
| #include "content/browser/webui/web_ui_controller_factory_registry.h"
|
| @@ -2892,20 +2892,20 @@ TEST_F(WebContentsImplTest, MediaPowerSaveBlocking) {
|
| EXPECT_FALSE(contents()->has_video_power_save_blocker_for_testing());
|
|
|
| TestRenderFrameHost* rfh = contents()->GetMainFrame();
|
| - AudioStreamMonitor* monitor = contents()->audio_stream_monitor();
|
| + AudioStateProvider* audio_state = contents()->audio_state_provider();
|
|
|
| // The audio power save blocker should not be based on having a media player
|
| // when audio stream monitoring is available.
|
| - if (AudioStreamMonitor::monitoring_available()) {
|
| + if (AudioStateProvider::audio_state_available()) {
|
| // Send a fake audio stream monitor notification. The audio power save
|
| // blocker should be created.
|
| - monitor->set_was_recently_audible_for_testing(true);
|
| + audio_state->set_was_recently_audible_for_testing(true);
|
| contents()->NotifyNavigationStateChanged(INVALIDATE_TYPE_TAB);
|
| EXPECT_TRUE(contents()->has_audio_power_save_blocker_for_testing());
|
|
|
| // Send another fake notification, this time when WasRecentlyAudible() will
|
| // be false. The power save blocker should be released.
|
| - monitor->set_was_recently_audible_for_testing(false);
|
| + audio_state->set_was_recently_audible_for_testing(false);
|
| contents()->NotifyNavigationStateChanged(INVALIDATE_TYPE_TAB);
|
| EXPECT_FALSE(contents()->has_audio_power_save_blocker_for_testing());
|
| }
|
| @@ -2917,7 +2917,7 @@ TEST_F(WebContentsImplTest, MediaPowerSaveBlocking) {
|
| 0, kPlayerAudioVideoId, true, true, false));
|
| EXPECT_TRUE(contents()->has_video_power_save_blocker_for_testing());
|
| EXPECT_EQ(contents()->has_audio_power_save_blocker_for_testing(),
|
| - !AudioStreamMonitor::monitoring_available());
|
| + !AudioStateProvider::audio_state_available());
|
|
|
| // Upon hiding the video power save blocker should be released.
|
| contents()->WasHidden();
|
| @@ -2930,7 +2930,7 @@ TEST_F(WebContentsImplTest, MediaPowerSaveBlocking) {
|
| 0, kPlayerVideoOnlyId, true, false, false));
|
| EXPECT_FALSE(contents()->has_video_power_save_blocker_for_testing());
|
| EXPECT_EQ(contents()->has_audio_power_save_blocker_for_testing(),
|
| - !AudioStreamMonitor::monitoring_available());
|
| + !AudioStateProvider::audio_state_available());
|
|
|
| // Showing the WebContents should result in the creation of the blocker.
|
| contents()->WasShown();
|
| @@ -2942,7 +2942,7 @@ TEST_F(WebContentsImplTest, MediaPowerSaveBlocking) {
|
| 0, kPlayerAudioOnlyId, false, true, false));
|
| EXPECT_TRUE(contents()->has_video_power_save_blocker_for_testing());
|
| EXPECT_EQ(contents()->has_audio_power_save_blocker_for_testing(),
|
| - !AudioStreamMonitor::monitoring_available());
|
| + !AudioStateProvider::audio_state_available());
|
|
|
| // Start a remote player. There should be no change in the power save
|
| // blockers.
|
| @@ -2950,7 +2950,7 @@ TEST_F(WebContentsImplTest, MediaPowerSaveBlocking) {
|
| 0, kPlayerRemoteId, true, true, true));
|
| EXPECT_TRUE(contents()->has_video_power_save_blocker_for_testing());
|
| EXPECT_EQ(contents()->has_audio_power_save_blocker_for_testing(),
|
| - !AudioStreamMonitor::monitoring_available());
|
| + !AudioStateProvider::audio_state_available());
|
|
|
| // Destroy the original audio video player. Both power save blockers should
|
| // remain.
|
| @@ -2958,7 +2958,7 @@ TEST_F(WebContentsImplTest, MediaPowerSaveBlocking) {
|
| FrameHostMsg_MediaPausedNotification(0, kPlayerAudioVideoId));
|
| EXPECT_TRUE(contents()->has_video_power_save_blocker_for_testing());
|
| EXPECT_EQ(contents()->has_audio_power_save_blocker_for_testing(),
|
| - !AudioStreamMonitor::monitoring_available());
|
| + !AudioStateProvider::audio_state_available());
|
|
|
| // Destroy the audio only player. The video power save blocker should remain.
|
| rfh->OnMessageReceived(
|
| @@ -2985,7 +2985,7 @@ TEST_F(WebContentsImplTest, MediaPowerSaveBlocking) {
|
| 0, kPlayerAudioVideoId, true, true, false));
|
| EXPECT_TRUE(contents()->has_video_power_save_blocker_for_testing());
|
| EXPECT_EQ(contents()->has_audio_power_save_blocker_for_testing(),
|
| - !AudioStreamMonitor::monitoring_available());
|
| + !AudioStateProvider::audio_state_available());
|
|
|
| // Crash the renderer.
|
| contents()->GetMainFrame()->OnMessageReceived(
|
|
|