OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
7 #include "base/synchronization/waitable_event.h" | 7 #include "base/synchronization/waitable_event.h" |
8 #include "base/test/test_timeouts.h" | 8 #include "base/test/test_timeouts.h" |
9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
10 #include "media/video/capture/fake_video_capture_device.h" | 10 #include "media/video/capture/fake_video_capture_device.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 58 |
59 private: | 59 private: |
60 base::WaitableEvent* wait_event_; | 60 base::WaitableEvent* wait_event_; |
61 }; | 61 }; |
62 | 62 |
63 class VideoCaptureDeviceTest : public testing::Test { | 63 class VideoCaptureDeviceTest : public testing::Test { |
64 public: | 64 public: |
65 VideoCaptureDeviceTest(): wait_event_(false, false) { } | 65 VideoCaptureDeviceTest(): wait_event_(false, false) { } |
66 | 66 |
67 void PostQuitTask() { | 67 void PostQuitTask() { |
68 loop_->PostTask(FROM_HERE, new MessageLoop::QuitTask); | 68 loop_->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
69 loop_->Run(); | 69 loop_->Run(); |
70 } | 70 } |
71 | 71 |
72 protected: | 72 protected: |
73 virtual void SetUp() { | 73 virtual void SetUp() { |
74 frame_observer_.reset(new MockFrameObserver(&wait_event_)); | 74 frame_observer_.reset(new MockFrameObserver(&wait_event_)); |
75 loop_.reset(new MessageLoopForUI()); | 75 loop_.reset(new MessageLoopForUI()); |
76 } | 76 } |
77 | 77 |
78 virtual void TearDown() { | 78 virtual void TearDown() { |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 device->Allocate(640, 480, 30, frame_observer_.get()); | 277 device->Allocate(640, 480, 30, frame_observer_.get()); |
278 | 278 |
279 device->Start(); | 279 device->Start(); |
280 EXPECT_TRUE(wait_event_.TimedWait(base::TimeDelta::FromMilliseconds( | 280 EXPECT_TRUE(wait_event_.TimedWait(base::TimeDelta::FromMilliseconds( |
281 TestTimeouts::action_max_timeout_ms()))); | 281 TestTimeouts::action_max_timeout_ms()))); |
282 device->Stop(); | 282 device->Stop(); |
283 device->DeAllocate(); | 283 device->DeAllocate(); |
284 } | 284 } |
285 | 285 |
286 }; // namespace media | 286 }; // namespace media |
OLD | NEW |