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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/environment.h" | 7 #include "base/environment.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 | 210 |
211 void SwitchDevice(bool diverting) { | 211 void SwitchDevice(bool diverting) { |
212 if (!diverting) { | 212 if (!diverting) { |
213 // Expect the current stream to close and a new stream to start | 213 // Expect the current stream to close and a new stream to start |
214 // playing if not diverting. When diverting, nothing happens | 214 // playing if not diverting. When diverting, nothing happens |
215 // until diverting is stopped. | 215 // until diverting is stopped. |
216 EXPECT_CALL(mock_event_handler_, OnPlaying()) | 216 EXPECT_CALL(mock_event_handler_, OnPlaying()) |
217 .WillOnce(SignalEvent(&play_event_)); | 217 .WillOnce(SignalEvent(&play_event_)); |
218 } | 218 } |
219 | 219 |
220 controller_->SwitchOutputDevice(AudioManagerBase::kDefaultDeviceName, | 220 controller_->SwitchOutputDevice(AudioManager::GetDefaultDeviceName(), |
221 base::Bind(&base::DoNothing)); | 221 base::Bind(&base::DoNothing)); |
222 } | 222 } |
223 | 223 |
224 void Close() { | 224 void Close() { |
225 EXPECT_CALL(mock_sync_reader_, Close()); | 225 EXPECT_CALL(mock_sync_reader_, Close()); |
226 | 226 |
227 controller_->Close(base::MessageLoop::QuitClosure()); | 227 controller_->Close(base::MessageLoop::QuitClosure()); |
228 base::MessageLoop::current()->Run(); | 228 base::MessageLoop::current()->Run(); |
229 } | 229 } |
230 | 230 |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 | 403 |
404 TEST_F(AudioOutputControllerTest, DivertRevertClose) { | 404 TEST_F(AudioOutputControllerTest, DivertRevertClose) { |
405 Create(kSamplesPerPacket); | 405 Create(kSamplesPerPacket); |
406 WaitForCreate(); | 406 WaitForCreate(); |
407 DivertNeverPlaying(); | 407 DivertNeverPlaying(); |
408 RevertWasNotPlaying(); | 408 RevertWasNotPlaying(); |
409 Close(); | 409 Close(); |
410 } | 410 } |
411 | 411 |
412 } // namespace media | 412 } // namespace media |
OLD | NEW |