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 // Unit test for VideoCaptureManager. | 5 // Unit test for VideoCaptureManager. |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 65 |
66 // Test class | 66 // Test class |
67 class VideoCaptureManagerTest : public testing::Test { | 67 class VideoCaptureManagerTest : public testing::Test { |
68 public: | 68 public: |
69 VideoCaptureManagerTest() : next_client_id_(1) {} | 69 VideoCaptureManagerTest() : next_client_id_(1) {} |
70 virtual ~VideoCaptureManagerTest() {} | 70 virtual ~VideoCaptureManagerTest() {} |
71 | 71 |
72 protected: | 72 protected: |
73 virtual void SetUp() OVERRIDE { | 73 virtual void SetUp() OVERRIDE { |
74 listener_.reset(new MockMediaStreamProviderListener()); | 74 listener_.reset(new MockMediaStreamProviderListener()); |
75 message_loop_.reset(new base::MessageLoop(base::MessageLoop::TYPE_IO)); | 75 message_loop_.reset(new base::MessageLoopForIO); |
76 io_thread_.reset(new BrowserThreadImpl(BrowserThread::IO, | 76 io_thread_.reset(new BrowserThreadImpl(BrowserThread::IO, |
77 message_loop_.get())); | 77 message_loop_.get())); |
78 vcm_ = new VideoCaptureManager(); | 78 vcm_ = new VideoCaptureManager(); |
79 vcm_->UseFakeDevice(); | 79 vcm_->UseFakeDevice(); |
80 vcm_->Register(listener_.get(), message_loop_->message_loop_proxy().get()); | 80 vcm_->Register(listener_.get(), message_loop_->message_loop_proxy().get()); |
81 frame_observer_.reset(new MockFrameObserver()); | 81 frame_observer_.reset(new MockFrameObserver()); |
82 } | 82 } |
83 | 83 |
84 virtual void TearDown() OVERRIDE {} | 84 virtual void TearDown() OVERRIDE {} |
85 | 85 |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 // VideoCaptureManager destructor otherwise. | 430 // VideoCaptureManager destructor otherwise. |
431 vcm_->Close(video_session_id); | 431 vcm_->Close(video_session_id); |
432 StopClient(client_id); | 432 StopClient(client_id); |
433 | 433 |
434 // Wait to check callbacks before removing the listener | 434 // Wait to check callbacks before removing the listener |
435 message_loop_->RunUntilIdle(); | 435 message_loop_->RunUntilIdle(); |
436 vcm_->Unregister(); | 436 vcm_->Unregister(); |
437 } | 437 } |
438 | 438 |
439 } // namespace content | 439 } // namespace content |
OLD | NEW |