OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <string> | 5 #include <string> |
6 #include <queue> | 6 #include <queue> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 // Use the fake content client and browser. | 247 // Use the fake content client and browser. |
248 content_client_.reset(new TestContentClient()); | 248 content_client_.reset(new TestContentClient()); |
249 SetContentClient(content_client_.get()); | 249 SetContentClient(content_client_.get()); |
250 old_browser_client_ = SetBrowserClientForTesting(host_.get()); | 250 old_browser_client_ = SetBrowserClientForTesting(host_.get()); |
251 | 251 |
252 #if defined(OS_CHROMEOS) | 252 #if defined(OS_CHROMEOS) |
253 chromeos::CrasAudioHandler::InitializeForTesting(); | 253 chromeos::CrasAudioHandler::InitializeForTesting(); |
254 #endif | 254 #endif |
255 } | 255 } |
256 | 256 |
257 virtual ~MediaStreamDispatcherHostTest() { | 257 ~MediaStreamDispatcherHostTest() override { |
258 #if defined(OS_CHROMEOS) | 258 #if defined(OS_CHROMEOS) |
259 chromeos::CrasAudioHandler::Shutdown(); | 259 chromeos::CrasAudioHandler::Shutdown(); |
260 #endif | 260 #endif |
261 } | 261 } |
262 | 262 |
263 virtual void SetUp() override { | 263 void SetUp() override { |
264 video_capture_device_factory_->GetDeviceNames(&physical_video_devices_); | 264 video_capture_device_factory_->GetDeviceNames(&physical_video_devices_); |
265 ASSERT_GT(physical_video_devices_.size(), 0u); | 265 ASSERT_GT(physical_video_devices_.size(), 0u); |
266 | 266 |
267 media_stream_manager_->audio_input_device_manager()->GetFakeDeviceNames( | 267 media_stream_manager_->audio_input_device_manager()->GetFakeDeviceNames( |
268 &physical_audio_devices_); | 268 &physical_audio_devices_); |
269 ASSERT_GT(physical_audio_devices_.size(), 0u); | 269 ASSERT_GT(physical_audio_devices_.size(), 0u); |
270 } | 270 } |
271 | 271 |
272 virtual void TearDown() override { | 272 void TearDown() override { host_->OnChannelClosing(); } |
273 host_->OnChannelClosing(); | |
274 } | |
275 | 273 |
276 protected: | 274 protected: |
277 virtual void SetupFakeUI(bool expect_started) { | 275 virtual void SetupFakeUI(bool expect_started) { |
278 stream_ui_ = new MockMediaStreamUIProxy(); | 276 stream_ui_ = new MockMediaStreamUIProxy(); |
279 if (expect_started) { | 277 if (expect_started) { |
280 EXPECT_CALL(*stream_ui_, OnStarted(_, _)); | 278 EXPECT_CALL(*stream_ui_, OnStarted(_, _)); |
281 } | 279 } |
282 media_stream_manager_->UseFakeUI( | 280 media_stream_manager_->UseFakeUI( |
283 scoped_ptr<FakeMediaStreamUIProxy>(stream_ui_)); | 281 scoped_ptr<FakeMediaStreamUIProxy>(stream_ui_)); |
284 } | 282 } |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
915 | 913 |
916 TEST_F(MediaStreamDispatcherHostTest, EnumerateVideoDevicesNoAccess) { | 914 TEST_F(MediaStreamDispatcherHostTest, EnumerateVideoDevicesNoAccess) { |
917 SetupFakeUI(false); | 915 SetupFakeUI(false); |
918 stream_ui_->SetCameraAccess(false); | 916 stream_ui_->SetCameraAccess(false); |
919 EnumerateDevicesAndWaitForResult(kRenderId, kPageRequestId, | 917 EnumerateDevicesAndWaitForResult(kRenderId, kPageRequestId, |
920 MEDIA_DEVICE_VIDEO_CAPTURE); | 918 MEDIA_DEVICE_VIDEO_CAPTURE); |
921 EXPECT_TRUE(DoesNotContainLabels(host_->enumerated_devices_)); | 919 EXPECT_TRUE(DoesNotContainLabels(host_->enumerated_devices_)); |
922 } | 920 } |
923 | 921 |
924 }; // namespace content | 922 }; // namespace content |
OLD | NEW |