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

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

Issue 66183002: Replace MessageLoopProxy with SingleThreadTaskRunner for the rest of media/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win and audio tests Created 6 years, 11 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
« no previous file with comments | « media/audio/audio_output_controller.cc ('k') | media/audio/audio_output_device.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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 void ChangeDevice() { 159 void ChangeDevice() {
160 // Expect the event handler to receive one OnPaying() call and no OnPaused() 160 // Expect the event handler to receive one OnPaying() call and no OnPaused()
161 // call. 161 // call.
162 EXPECT_CALL(mock_event_handler_, OnPlaying()) 162 EXPECT_CALL(mock_event_handler_, OnPlaying())
163 .WillOnce(SignalEvent(&play_event_)); 163 .WillOnce(SignalEvent(&play_event_));
164 EXPECT_CALL(mock_event_handler_, OnPaused()) 164 EXPECT_CALL(mock_event_handler_, OnPaused())
165 .Times(0); 165 .Times(0);
166 166
167 // Simulate a device change event to AudioOutputController from the 167 // Simulate a device change event to AudioOutputController from the
168 // AudioManager. 168 // AudioManager.
169 audio_manager_->GetMessageLoop()->PostTask( 169 audio_manager_->GetTaskRunner()->PostTask(
170 FROM_HERE, 170 FROM_HERE,
171 base::Bind(&AudioOutputController::OnDeviceChange, controller_)); 171 base::Bind(&AudioOutputController::OnDeviceChange, controller_));
172 } 172 }
173 173
174 void Divert(bool was_playing, int num_times_to_be_started) { 174 void Divert(bool was_playing, int num_times_to_be_started) {
175 if (was_playing) { 175 if (was_playing) {
176 // Expect the handler to receive one OnPlaying() call as a result of the 176 // Expect the handler to receive one OnPlaying() call as a result of the
177 // stream switching. 177 // stream switching.
178 EXPECT_CALL(mock_event_handler_, OnPlaying()) 178 EXPECT_CALL(mock_event_handler_, OnPlaying())
179 .WillOnce(SignalEvent(&play_event_)); 179 .WillOnce(SignalEvent(&play_event_));
(...skipping 231 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_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698