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 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 FROM_HERE, base::Bind( | 74 FROM_HERE, base::Bind( |
75 &MockAudioInputDeviceManagerEventHandler::DeviceStopped, | 75 &MockAudioInputDeviceManagerEventHandler::DeviceStopped, |
76 base::Unretained(this), session_id)); | 76 base::Unretained(this), session_id)); |
77 } | 77 } |
78 | 78 |
79 private: | 79 private: |
80 MessageLoop* message_loop_; | 80 MessageLoop* message_loop_; |
81 DISALLOW_COPY_AND_ASSIGN(MockAudioInputDeviceManagerEventHandler); | 81 DISALLOW_COPY_AND_ASSIGN(MockAudioInputDeviceManagerEventHandler); |
82 }; | 82 }; |
83 | 83 |
84 ACTION_P(ExitMessageLoop, message_loop) { | |
85 message_loop->PostTask(FROM_HERE, MessageLoop::QuitClosure()); | |
86 } | |
87 | |
88 class AudioInputDeviceManagerTest : public testing::Test { | 84 class AudioInputDeviceManagerTest : public testing::Test { |
89 public: | 85 public: |
90 AudioInputDeviceManagerTest() {} | 86 AudioInputDeviceManagerTest() {} |
91 | 87 |
92 // Returns true iff machine has an audio input device. | 88 // Returns true iff machine has an audio input device. |
93 bool CanRunAudioInputDeviceTests() { | 89 bool CanRunAudioInputDeviceTests() { |
94 return audio_manager_->HasAudioInputDevices(); | 90 return audio_manager_->HasAudioInputDevices(); |
95 } | 91 } |
96 | 92 |
97 protected: | 93 protected: |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 manager_->Stop(session_id); | 506 manager_->Stop(session_id); |
511 manager_->Close(session_id); | 507 manager_->Close(session_id); |
512 EXPECT_CALL(*audio_input_listener_, | 508 EXPECT_CALL(*audio_input_listener_, |
513 Closed(content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE, | 509 Closed(content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE, |
514 session_id)) | 510 session_id)) |
515 .Times(1); | 511 .Times(1); |
516 message_loop_->RunAllPending(); | 512 message_loop_->RunAllPending(); |
517 } | 513 } |
518 | 514 |
519 } // namespace media_stream | 515 } // namespace media_stream |
OLD | NEW |