| Index: content/browser/renderer_host/media/media_devices_dispatcher_host_unittest.cc
|
| diff --git a/content/browser/renderer_host/media/media_devices_dispatcher_host_unittest.cc b/content/browser/renderer_host/media/media_devices_dispatcher_host_unittest.cc
|
| index a050760cc58304f5b8dbaac7b6423bb42a47425c..1b0b18053ce89ce39751fa960fbb1b38d545f3f2 100644
|
| --- a/content/browser/renderer_host/media/media_devices_dispatcher_host_unittest.cc
|
| +++ b/content/browser/renderer_host/media/media_devices_dispatcher_host_unittest.cc
|
| @@ -103,6 +103,11 @@ class MediaDevicesDispatcherHostTest : public testing::Test {
|
| ASSERT_GT(physical_devices_[MEDIA_DEVICE_TYPE_AUDIO_OUTPUT].size(), 0u);
|
| }
|
|
|
| + MOCK_METHOD1(UniqueOriginCallback,
|
| + void(const std::vector<std::vector<MediaDeviceInfo>>&));
|
| + MOCK_METHOD1(ValidOriginCallback,
|
| + void(const std::vector<std::vector<MediaDeviceInfo>>&));
|
| +
|
| protected:
|
| void DevicesEnumerated(
|
| const base::Closure& closure,
|
| @@ -307,4 +312,21 @@ TEST_F(MediaDevicesDispatcherHostTest, SubscribeDeviceChangeNoAccess) {
|
| SubscribeAndWaitForResult(false);
|
| }
|
|
|
| +TEST_F(MediaDevicesDispatcherHostTest, EnumerateAllDevicesUniqueOrigin) {
|
| + EXPECT_CALL(*this, UniqueOriginCallback(testing::_)).Times(0);
|
| + host_->EnumerateDevices(
|
| + true, true, true, url::Origin(),
|
| + base::Bind(&MediaDevicesDispatcherHostTest::UniqueOriginCallback,
|
| + base::Unretained(this)));
|
| + base::RunLoop().RunUntilIdle();
|
| +
|
| + // Verify that the callback for a valid origin does get called.
|
| + EXPECT_CALL(*this, ValidOriginCallback(testing::_));
|
| + host_->EnumerateDevices(
|
| + true, true, true, url::Origin(GURL("http://localhost")),
|
| + base::Bind(&MediaDevicesDispatcherHostTest::ValidOriginCallback,
|
| + base::Unretained(this)));
|
| + base::RunLoop().RunUntilIdle();
|
| +}
|
| +
|
| }; // namespace content
|
|
|