Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Unified Diff: content/browser/web_contents/web_contents_impl_unittest.cc

Issue 972973002: Revert of Propagate audible state from player to the containing tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/content_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698