| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 AudioParameters::AUDIO_FAKE, kChannelLayout, | 114 AudioParameters::AUDIO_FAKE, kChannelLayout, |
| 115 kSampleRate, kBitsPerSample, samples_per_packet); | 115 kSampleRate, kBitsPerSample, samples_per_packet); |
| 116 | 116 |
| 117 if (params_.IsValid()) { | 117 if (params_.IsValid()) { |
| 118 EXPECT_CALL(mock_event_handler_, OnCreated()) | 118 EXPECT_CALL(mock_event_handler_, OnCreated()) |
| 119 .WillOnce(SignalEvent(&create_event_)); | 119 .WillOnce(SignalEvent(&create_event_)); |
| 120 } | 120 } |
| 121 | 121 |
| 122 controller_ = AudioOutputController::Create( | 122 controller_ = AudioOutputController::Create( |
| 123 audio_manager_.get(), &mock_event_handler_, params_, std::string(), | 123 audio_manager_.get(), &mock_event_handler_, params_, std::string(), |
| 124 std::string(), &mock_sync_reader_); | 124 &mock_sync_reader_); |
| 125 if (controller_.get()) | 125 if (controller_.get()) |
| 126 controller_->SetVolume(kTestVolume); | 126 controller_->SetVolume(kTestVolume); |
| 127 | 127 |
| 128 EXPECT_EQ(params_.IsValid(), controller_.get() != NULL); | 128 EXPECT_EQ(params_.IsValid(), controller_.get() != NULL); |
| 129 } | 129 } |
| 130 | 130 |
| 131 void Play() { | 131 void Play() { |
| 132 // Expect the event handler to receive one OnPlaying() call and one or more | 132 // Expect the event handler to receive one OnPlaying() call and one or more |
| 133 // OnPowerMeasured() calls. | 133 // OnPowerMeasured() calls. |
| 134 EXPECT_CALL(mock_event_handler_, OnPlaying()) | 134 EXPECT_CALL(mock_event_handler_, OnPlaying()) |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 | 411 |
| 412 TEST_F(AudioOutputControllerTest, DivertRevertClose) { | 412 TEST_F(AudioOutputControllerTest, DivertRevertClose) { |
| 413 Create(kSamplesPerPacket); | 413 Create(kSamplesPerPacket); |
| 414 WaitForCreate(); | 414 WaitForCreate(); |
| 415 DivertNeverPlaying(); | 415 DivertNeverPlaying(); |
| 416 RevertWasNotPlaying(); | 416 RevertWasNotPlaying(); |
| 417 Close(); | 417 Close(); |
| 418 } | 418 } |
| 419 | 419 |
| 420 } // namespace media | 420 } // namespace media |
| OLD | NEW |