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

Unified Diff: content/renderer/media/user_media_client_impl_unittest.cc

Issue 2872913003: Do not pass the origin to MediaDevicesDispatcherHost. (Closed)
Patch Set: Add tests with unique origin Created 3 years, 7 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
Index: content/renderer/media/user_media_client_impl_unittest.cc
diff --git a/content/renderer/media/user_media_client_impl_unittest.cc b/content/renderer/media/user_media_client_impl_unittest.cc
index e3e803f28b521dd7446867239c159a6fb4891d3b..f0c514107dd3fa93d4e6e0d8874f1b13f350ac68 100644
--- a/content/renderer/media/user_media_client_impl_unittest.cc
+++ b/content/renderer/media/user_media_client_impl_unittest.cc
@@ -117,7 +117,6 @@ class MockMediaDevicesDispatcherHost
void EnumerateDevices(bool request_audio_input,
bool request_video_input,
bool request_audio_output,
- const url::Origin& security_origin,
EnumerateDevicesCallback callback) override {
std::vector<std::vector<MediaDeviceInfo>> result(NUM_MEDIA_DEVICE_TYPES);
if (request_audio_input) {
@@ -140,7 +139,6 @@ class MockMediaDevicesDispatcherHost
}
void GetVideoInputCapabilities(
- const url::Origin& security_origin,
GetVideoInputCapabilitiesCallback client_callback) override {
::mojom::VideoInputDeviceCapabilitiesPtr device =
::mojom::VideoInputDeviceCapabilities::New();
@@ -161,10 +159,8 @@ class MockMediaDevicesDispatcherHost
std::move(client_callback).Run(std::move(result));
}
- MOCK_METHOD3(SubscribeDeviceChangeNotifications,
- void(MediaDeviceType type,
- uint32_t subscription_id,
- const url::Origin& security_origin));
+ MOCK_METHOD2(SubscribeDeviceChangeNotifications,
+ void(MediaDeviceType type, uint32_t subscription_id));
MOCK_METHOD2(UnsubscribeDeviceChangeNotifications,
void(MediaDeviceType type, uint32_t subscription_id));
};
@@ -781,15 +777,13 @@ TEST_F(UserMediaClientImplTest, RenderToAssociatedSinkConstraint) {
}
TEST_F(UserMediaClientImplTest, ObserveMediaDeviceChanges) {
+ EXPECT_CALL(media_devices_dispatcher_, SubscribeDeviceChangeNotifications(
+ MEDIA_DEVICE_TYPE_AUDIO_INPUT, _));
+ EXPECT_CALL(media_devices_dispatcher_, SubscribeDeviceChangeNotifications(
+ MEDIA_DEVICE_TYPE_VIDEO_INPUT, _));
EXPECT_CALL(
media_devices_dispatcher_,
- SubscribeDeviceChangeNotifications(MEDIA_DEVICE_TYPE_AUDIO_INPUT, _, _));
- EXPECT_CALL(
- media_devices_dispatcher_,
- SubscribeDeviceChangeNotifications(MEDIA_DEVICE_TYPE_VIDEO_INPUT, _, _));
- EXPECT_CALL(
- media_devices_dispatcher_,
- SubscribeDeviceChangeNotifications(MEDIA_DEVICE_TYPE_AUDIO_OUTPUT, _, _));
+ SubscribeDeviceChangeNotifications(MEDIA_DEVICE_TYPE_AUDIO_OUTPUT, _));
user_media_client_impl_->SetMediaDeviceChangeObserver(
blink::WebMediaDeviceChangeObserver(true));
base::RunLoop().RunUntilIdle();
« no previous file with comments | « content/renderer/media/user_media_client_impl.cc ('k') | content/renderer/pepper/pepper_device_enumeration_host_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698