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/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 // This class mocks the audio manager and overrides the | 52 // This class mocks the audio manager and overrides the |
53 // GetAudioInputDeviceNames() method to ensure that we can run our tests on | 53 // GetAudioInputDeviceNames() method to ensure that we can run our tests on |
54 // the buildbots. media::AudioManagerBase | 54 // the buildbots. media::AudioManagerBase |
55 class MockAudioManager : public AudioManagerPlatform { | 55 class MockAudioManager : public AudioManagerPlatform { |
56 public: | 56 public: |
57 MockAudioManager() : AudioManagerPlatform(&fake_audio_log_factory_) {} | 57 MockAudioManager() : AudioManagerPlatform(&fake_audio_log_factory_) {} |
58 virtual ~MockAudioManager() {} | 58 virtual ~MockAudioManager() {} |
59 | 59 |
60 virtual void GetAudioInputDeviceNames( | 60 virtual void GetAudioInputDeviceNames( |
61 media::AudioDeviceNames* device_names) OVERRIDE { | 61 media::AudioDeviceNames* device_names) override { |
62 DCHECK(device_names->empty()); | 62 DCHECK(device_names->empty()); |
63 if (HasAudioInputDevices()) { | 63 if (HasAudioInputDevices()) { |
64 AudioManagerBase::GetAudioInputDeviceNames(device_names); | 64 AudioManagerBase::GetAudioInputDeviceNames(device_names); |
65 } else { | 65 } else { |
66 device_names->push_back(media::AudioDeviceName("fake_device_name", | 66 device_names->push_back(media::AudioDeviceName("fake_device_name", |
67 "fake_device_id")); | 67 "fake_device_id")); |
68 } | 68 } |
69 } | 69 } |
70 | 70 |
71 private: | 71 private: |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 std::string label2 = MakeMediaAccessRequest(1); | 174 std::string label2 = MakeMediaAccessRequest(1); |
175 media_stream_manager_->CancelRequest(label1); | 175 media_stream_manager_->CancelRequest(label1); |
176 | 176 |
177 // Expecting the callback from the second request will be triggered and | 177 // Expecting the callback from the second request will be triggered and |
178 // quit the test. | 178 // quit the test. |
179 EXPECT_CALL(*this, Response(1)); | 179 EXPECT_CALL(*this, Response(1)); |
180 run_loop_.Run(); | 180 run_loop_.Run(); |
181 } | 181 } |
182 | 182 |
183 } // namespace content | 183 } // namespace content |
OLD | NEW |