| 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 .WillOnce(SignalEvent(&play_event_)); | 217 .WillOnce(SignalEvent(&play_event_)); |
| 218 } | 218 } |
| 219 | 219 |
| 220 controller_->SwitchOutputDevice(AudioManager::GetDefaultDeviceName(), | 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::QuitWhenIdleClosure()); |
| 228 base::MessageLoop::current()->Run(); | 228 base::MessageLoop::current()->Run(); |
| 229 } | 229 } |
| 230 | 230 |
| 231 // These help make test sequences more readable. | 231 // These help make test sequences more readable. |
| 232 void DivertNeverPlaying() { Divert(false, 0); } | 232 void DivertNeverPlaying() { Divert(false, 0); } |
| 233 void DivertWillEventuallyBeTwicePlayed() { Divert(false, 2); } | 233 void DivertWillEventuallyBeTwicePlayed() { Divert(false, 2); } |
| 234 void DivertWhilePlaying() { Divert(true, 1); } | 234 void DivertWhilePlaying() { Divert(true, 1); } |
| 235 void RevertWasNotPlaying() { Revert(false); } | 235 void RevertWasNotPlaying() { Revert(false); } |
| 236 void RevertWhilePlaying() { Revert(true); } | 236 void RevertWhilePlaying() { Revert(true); } |
| 237 | 237 |
| (...skipping 165 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 |