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

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

Issue 163343002: Reland 153623004: Remove the unified IO code on the browser (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fixed the cras bot Created 6 years, 10 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
« no previous file with comments | « media/audio/audio_output_controller.cc ('k') | media/audio/audio_output_dispatcher.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « media/audio/audio_output_controller.cc ('k') | media/audio/audio_output_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698