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 187f3c42b3e7d0eca942e47303532da9095a4b48..da3c82e7d4826fe968344dadc907178eca8bb1d1 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_state_provider.h" |
+#include "content/browser/media/audio_stream_monitor.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" |
@@ -2891,20 +2891,20 @@ |
EXPECT_FALSE(contents()->has_video_power_save_blocker_for_testing()); |
TestRenderFrameHost* rfh = contents()->GetMainFrame(); |
- AudioStateProvider* audio_state = contents()->audio_state_provider(); |
+ AudioStreamMonitor* monitor = contents()->audio_stream_monitor(); |
// The audio power save blocker should not be based on having a media player |
// when audio stream monitoring is available. |
- if (audio_state->IsAudioStateAvailable()) { |
+ if (AudioStreamMonitor::monitoring_available()) { |
// Send a fake audio stream monitor notification. The audio power save |
// blocker should be created. |
- audio_state->set_was_recently_audible_for_testing(true); |
+ monitor->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. |
- audio_state->set_was_recently_audible_for_testing(false); |
+ monitor->set_was_recently_audible_for_testing(false); |
contents()->NotifyNavigationStateChanged(INVALIDATE_TYPE_TAB); |
EXPECT_FALSE(contents()->has_audio_power_save_blocker_for_testing()); |
} |
@@ -2916,7 +2916,7 @@ |
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(), |
- !audio_state->IsAudioStateAvailable()); |
+ !AudioStreamMonitor::monitoring_available()); |
// Upon hiding the video power save blocker should be released. |
contents()->WasHidden(); |
@@ -2929,7 +2929,7 @@ |
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(), |
- !audio_state->IsAudioStateAvailable()); |
+ !AudioStreamMonitor::monitoring_available()); |
// Showing the WebContents should result in the creation of the blocker. |
contents()->WasShown(); |
@@ -2941,7 +2941,7 @@ |
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(), |
- !audio_state->IsAudioStateAvailable()); |
+ !AudioStreamMonitor::monitoring_available()); |
// Start a remote player. There should be no change in the power save |
// blockers. |
@@ -2949,7 +2949,7 @@ |
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(), |
- !audio_state->IsAudioStateAvailable()); |
+ !AudioStreamMonitor::monitoring_available()); |
// Destroy the original audio video player. Both power save blockers should |
// remain. |
@@ -2957,7 +2957,7 @@ |
FrameHostMsg_MediaPausedNotification(0, kPlayerAudioVideoId)); |
EXPECT_TRUE(contents()->has_video_power_save_blocker_for_testing()); |
EXPECT_EQ(contents()->has_audio_power_save_blocker_for_testing(), |
- !audio_state->IsAudioStateAvailable()); |
+ !AudioStreamMonitor::monitoring_available()); |
// Destroy the audio only player. The video power save blocker should remain. |
rfh->OnMessageReceived( |
@@ -2984,7 +2984,7 @@ |
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(), |
- !audio_state->IsAudioStateAvailable()); |
+ !AudioStreamMonitor::monitoring_available()); |
// Crash the renderer. |
contents()->GetMainFrame()->OnMessageReceived( |