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

Unified Diff: content/browser/renderer_host/media/video_capture_manager_unittest.cc

Issue 2696533002: Rmoving the notion of task runner from MediaStreamProvider interface. (Closed)
Patch Set: Created 3 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/renderer_host/media/video_capture_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/media/video_capture_manager_unittest.cc
diff --git a/content/browser/renderer_host/media/video_capture_manager_unittest.cc b/content/browser/renderer_host/media/video_capture_manager_unittest.cc
index a4c697dd34791c9d034eb8d7f787056579651554..8525a344f26038d286d27fa8a64e41416d3d8026 100644
--- a/content/browser/renderer_host/media/video_capture_manager_unittest.cc
+++ b/content/browser/renderer_host/media/video_capture_manager_unittest.cc
@@ -175,12 +175,13 @@ class VideoCaptureManagerTest : public testing::Test {
listener_.reset(new MockMediaStreamProviderListener());
vcm_ = new VideoCaptureManager(
std::unique_ptr<media::VideoCaptureDeviceFactory>(
- new WrappedDeviceFactory()));
+ new WrappedDeviceFactory()),
+ base::ThreadTaskRunnerHandle::Get());
video_capture_device_factory_ = static_cast<WrappedDeviceFactory*>(
vcm_->video_capture_device_factory());
const int32_t kNumberOfFakeDevices = 2;
video_capture_device_factory_->set_number_of_devices(kNumberOfFakeDevices);
- vcm_->Register(listener_.get(), base::ThreadTaskRunnerHandle::Get());
+ vcm_->RegisterListener(listener_.get());
frame_observer_.reset(new MockFrameObserver());
base::RunLoop run_loop;
@@ -290,7 +291,7 @@ TEST_F(VideoCaptureManagerTest, CreateAndClose) {
// Wait to check callbacks before removing the listener.
base::RunLoop().RunUntilIdle();
- vcm_->Unregister();
+ vcm_->UnregisterListener();
}
TEST_F(VideoCaptureManagerTest, CreateAndCloseMultipleTimes) {
@@ -307,7 +308,7 @@ TEST_F(VideoCaptureManagerTest, CreateAndCloseMultipleTimes) {
// Wait to check callbacks before removing the listener.
base::RunLoop().RunUntilIdle();
- vcm_->Unregister();
+ vcm_->UnregisterListener();
}
// Try to open, start, and abort a device.
@@ -327,7 +328,7 @@ TEST_F(VideoCaptureManagerTest, CreateAndAbort) {
// Wait to check callbacks before removing the listener.
base::RunLoop().RunUntilIdle();
- vcm_->Unregister();
+ vcm_->UnregisterListener();
}
// Open the same device twice.
@@ -348,7 +349,7 @@ TEST_F(VideoCaptureManagerTest, OpenTwice) {
// Wait to check callbacks before removing the listener.
base::RunLoop().RunUntilIdle();
- vcm_->Unregister();
+ vcm_->UnregisterListener();
}
// Connect and disconnect devices.
@@ -374,7 +375,7 @@ TEST_F(VideoCaptureManagerTest, ConnectAndDisconnectDevices) {
run_loop2.Run();
ASSERT_EQ(devices_.size(), 3u);
- vcm_->Unregister();
+ vcm_->UnregisterListener();
video_capture_device_factory_->set_number_of_devices(number_of_devices_keep);
}
@@ -435,7 +436,7 @@ TEST_F(VideoCaptureManagerTest, ManipulateDeviceAndCheckCapabilities) {
vcm_->Close(video_session_id);
base::RunLoop().RunUntilIdle();
- vcm_->Unregister();
+ vcm_->UnregisterListener();
}
// Enumerate devices, then check the list of supported formats. Then open and
@@ -499,7 +500,7 @@ TEST_F(VideoCaptureManagerTest,
vcm_->Close(video_session_id);
base::RunLoop().RunUntilIdle();
- vcm_->Unregister();
+ vcm_->UnregisterListener();
}
// Enumerate devices and open the first, then check the formats currently in
@@ -541,7 +542,7 @@ TEST_F(VideoCaptureManagerTest, StartDeviceAndGetDeviceFormatInUse) {
vcm_->Close(video_session_id);
base::RunLoop().RunUntilIdle();
- vcm_->Unregister();
+ vcm_->UnregisterListener();
}
// Enumerate devices and open the first, then check the formats currently in
@@ -588,7 +589,7 @@ TEST_F(VideoCaptureManagerTest,
vcm_->Close(video_session_id);
base::RunLoop().RunUntilIdle();
- vcm_->Unregister();
+ vcm_->UnregisterListener();
}
// Open two different devices.
@@ -608,7 +609,7 @@ TEST_F(VideoCaptureManagerTest, OpenTwo) {
// Wait to check callbacks before removing the listener.
base::RunLoop().RunUntilIdle();
- vcm_->Unregister();
+ vcm_->UnregisterListener();
}
// Try open a non-existing device.
@@ -632,7 +633,7 @@ TEST_F(VideoCaptureManagerTest, OpenNotExisting) {
vcm_->Close(session_id);
base::RunLoop().RunUntilIdle();
- vcm_->Unregister();
+ vcm_->UnregisterListener();
}
// Start a device without calling Open, using a non-magic ID.
@@ -641,7 +642,7 @@ TEST_F(VideoCaptureManagerTest, StartInvalidSession) {
// Wait to check callbacks before removing the listener.
base::RunLoop().RunUntilIdle();
- vcm_->Unregister();
+ vcm_->UnregisterListener();
}
// Open and start a device, close it before calling Stop.
@@ -661,7 +662,7 @@ TEST_F(VideoCaptureManagerTest, CloseWithoutStop) {
// Wait to check callbacks before removing the listener
base::RunLoop().RunUntilIdle();
- vcm_->Unregister();
+ vcm_->UnregisterListener();
}
// Try to open, start, pause and resume a device. Confirm the device is
@@ -700,7 +701,7 @@ TEST_F(VideoCaptureManagerTest, PauseAndResumeClient) {
// Wait to check callbacks before removing the listener.
base::RunLoop().RunUntilIdle();
- vcm_->Unregister();
+ vcm_->UnregisterListener();
}
#if defined(OS_ANDROID)
@@ -731,7 +732,7 @@ TEST_F(VideoCaptureManagerTest, PauseAndResumeDevice) {
// Wait to check callbacks before removing the listener.
base::RunLoop().RunUntilIdle();
- vcm_->Unregister();
+ vcm_->UnregisterListener();
}
#endif
« no previous file with comments | « content/browser/renderer_host/media/video_capture_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698