| Index: content/renderer/media/video_capture_service_unittest.cc
|
| diff --git a/content/renderer/media/video_capture_impl_manager_unittest.cc b/content/renderer/media/video_capture_service_unittest.cc
|
| similarity index 84%
|
| rename from content/renderer/media/video_capture_impl_manager_unittest.cc
|
| rename to content/renderer/media/video_capture_service_unittest.cc
|
| index a688c12b57b087cfff965bf97fbae8f08a10976f..f8163d08124828c9a22f0296e711a58329fa1b85 100644
|
| --- a/content/renderer/media/video_capture_impl_manager_unittest.cc
|
| +++ b/content/renderer/media/video_capture_service_unittest.cc
|
| @@ -9,8 +9,8 @@
|
| #include "base/run_loop.h"
|
| #include "content/child/child_process.h"
|
| #include "content/renderer/media/video_capture_impl.h"
|
| -#include "content/renderer/media/video_capture_impl_manager.h"
|
| #include "content/renderer/media/video_capture_message_filter.h"
|
| +#include "content/renderer/media/video_capture_service.h"
|
| #include "media/base/bind_to_current_loop.h"
|
| #include "testing/gmock/include/gmock/gmock.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| @@ -43,13 +43,13 @@ class MockVideoCaptureImpl : public VideoCaptureImpl {
|
| DISALLOW_COPY_AND_ASSIGN(MockVideoCaptureImpl);
|
| };
|
|
|
| -class MockVideoCaptureImplManager : public VideoCaptureImplManager {
|
| +class MockVideoCaptureService : public VideoCaptureService {
|
| public:
|
| - explicit MockVideoCaptureImplManager(
|
| + explicit MockVideoCaptureService(
|
| base::Closure destruct_video_capture_callback)
|
| : destruct_video_capture_callback_(
|
| destruct_video_capture_callback) {}
|
| - ~MockVideoCaptureImplManager() override {}
|
| + ~MockVideoCaptureService() override {}
|
|
|
| protected:
|
| VideoCaptureImpl* CreateVideoCaptureImplForTesting(
|
| @@ -63,13 +63,13 @@ class MockVideoCaptureImplManager : public VideoCaptureImplManager {
|
| private:
|
| base::Closure destruct_video_capture_callback_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(MockVideoCaptureImplManager);
|
| + DISALLOW_COPY_AND_ASSIGN(MockVideoCaptureService);
|
| };
|
|
|
| -class VideoCaptureImplManagerTest : public ::testing::Test {
|
| +class VideoCaptureServiceTest : public ::testing::Test {
|
| public:
|
| - VideoCaptureImplManagerTest()
|
| - : manager_(new MockVideoCaptureImplManager(
|
| + VideoCaptureServiceTest()
|
| + : manager_(new MockVideoCaptureService(
|
| BindToCurrentLoop(cleanup_run_loop_.QuitClosure()))) {
|
| params_.requested_format = media::VideoCaptureFormat(
|
| gfx::Size(176, 144), 30, media::PIXEL_FORMAT_I420);
|
| @@ -83,7 +83,7 @@ class VideoCaptureImplManagerTest : public ::testing::Test {
|
| loop->PostTask(
|
| FROM_HERE,
|
| base::Bind(
|
| - &VideoCaptureImplManagerTest::FakeChannelSetup,
|
| + &VideoCaptureServiceTest::FakeChannelSetup,
|
| base::Unretained(this)));
|
| return;
|
| }
|
| @@ -114,9 +114,9 @@ class VideoCaptureImplManagerTest : public ::testing::Test {
|
| base::Closure StartCapture(const media::VideoCaptureParams& params) {
|
| return manager_->StartCapture(
|
| 0, params,
|
| - base::Bind(&VideoCaptureImplManagerTest::OnStateUpdate,
|
| + base::Bind(&VideoCaptureServiceTest::OnStateUpdate,
|
| base::Unretained(this)),
|
| - base::Bind(&VideoCaptureImplManagerTest::OnFrameReady,
|
| + base::Bind(&VideoCaptureServiceTest::OnFrameReady,
|
| base::Unretained(this)));
|
| }
|
|
|
| @@ -124,15 +124,15 @@ class VideoCaptureImplManagerTest : public ::testing::Test {
|
| scoped_ptr<ChildProcess> child_process_;
|
| media::VideoCaptureParams params_;
|
| base::RunLoop cleanup_run_loop_;
|
| - scoped_ptr<MockVideoCaptureImplManager> manager_;
|
| + scoped_ptr<MockVideoCaptureService> manager_;
|
|
|
| private:
|
| - DISALLOW_COPY_AND_ASSIGN(VideoCaptureImplManagerTest);
|
| + DISALLOW_COPY_AND_ASSIGN(VideoCaptureServiceTest);
|
| };
|
|
|
| // Multiple clients with the same session id. There is only one
|
| // media::VideoCapture object.
|
| -TEST_F(VideoCaptureImplManagerTest, MultipleClients) {
|
| +TEST_F(VideoCaptureServiceTest, MultipleClients) {
|
| base::Closure release_cb1 = manager_->UseDevice(0);
|
| base::Closure release_cb2 = manager_->UseDevice(0);
|
| base::Closure stop_cb1, stop_cb2;
|
| @@ -166,7 +166,7 @@ TEST_F(VideoCaptureImplManagerTest, MultipleClients) {
|
| cleanup_run_loop_.Run();
|
| }
|
|
|
| -TEST_F(VideoCaptureImplManagerTest, NoLeak) {
|
| +TEST_F(VideoCaptureServiceTest, NoLeak) {
|
| manager_->UseDevice(0).Reset();
|
| manager_.reset();
|
| cleanup_run_loop_.Run();
|
|
|