Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Side by Side Diff: media/audio/audio_output_controller_unittest.cc

Issue 15979015: Reland 15721002: Hook up the device selection to the WebAudio live audio (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed the comments. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698