| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 params_ = AudioParameters( | 115 params_ = AudioParameters( |
| 116 AudioParameters::AUDIO_FAKE, kChannelLayout, | 116 AudioParameters::AUDIO_FAKE, kChannelLayout, |
| 117 kSampleRate, kBitsPerSample, samples_per_packet); | 117 kSampleRate, kBitsPerSample, samples_per_packet); |
| 118 | 118 |
| 119 if (params_.IsValid()) { | 119 if (params_.IsValid()) { |
| 120 EXPECT_CALL(mock_event_handler_, OnCreated()) | 120 EXPECT_CALL(mock_event_handler_, OnCreated()) |
| 121 .WillOnce(SignalEvent(&create_event_)); | 121 .WillOnce(SignalEvent(&create_event_)); |
| 122 } | 122 } |
| 123 | 123 |
| 124 controller_ = AudioOutputController::Create( | 124 controller_ = AudioOutputController::Create( |
| 125 audio_manager_.get(), &mock_event_handler_, params_, | 125 audio_manager_.get(), &mock_event_handler_, params_, std::string(), |
| 126 &mock_sync_reader_); | 126 &mock_sync_reader_); |
| 127 if (controller_.get()) | 127 if (controller_.get()) |
| 128 controller_->SetVolume(kTestVolume); | 128 controller_->SetVolume(kTestVolume); |
| 129 | 129 |
| 130 EXPECT_EQ(params_.IsValid(), controller_.get() != NULL); | 130 EXPECT_EQ(params_.IsValid(), controller_.get() != NULL); |
| 131 } | 131 } |
| 132 | 132 |
| 133 void Play() { | 133 void Play() { |
| 134 // Expect the event handler to receive one OnPlaying() call and one or more | 134 // Expect the event handler to receive one OnPlaying() call and one or more |
| 135 // OnAudible() calls. | 135 // OnAudible() calls. |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 | 374 |
| 375 TEST_F(AudioOutputControllerTest, DivertRevertClose) { | 375 TEST_F(AudioOutputControllerTest, DivertRevertClose) { |
| 376 Create(kSamplesPerPacket); | 376 Create(kSamplesPerPacket); |
| 377 WaitForCreate(); | 377 WaitForCreate(); |
| 378 DivertNeverPlaying(); | 378 DivertNeverPlaying(); |
| 379 RevertWasNotPlaying(); | 379 RevertWasNotPlaying(); |
| 380 Close(); | 380 Close(); |
| 381 } | 381 } |
| 382 | 382 |
| 383 } // namespace media | 383 } // namespace media |
| OLD | NEW |