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

Side by Side Diff: content/browser/renderer_host/media/audio_renderer_host_unittest.cc

Issue 9692038: stopping the audio thread before destroying the AudioManager<Platform> (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased and fixed the speech recognition unittest Created 8 years, 9 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/bind.h" 5 #include "base/bind.h"
6 #include "base/environment.h" 6 #include "base/environment.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/process_util.h" 9 #include "base/process_util.h"
10 #include "base/sync_socket.h" 10 #include "base/sync_socket.h"
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 } 354 }
355 355
356 TEST_F(AudioRendererHostTest, SetVolume) { 356 TEST_F(AudioRendererHostTest, SetVolume) {
357 if (!IsRunningHeadless()) 357 if (!IsRunningHeadless())
358 EnableRealDevice(); 358 EnableRealDevice();
359 359
360 Create(); 360 Create();
361 SetVolume(0.5); 361 SetVolume(0.5);
362 Play(); 362 Play();
363 Pause(); 363 Pause();
364 Close();
365 364
366 // Expect the volume is set. 365 // Expect the volume is set.
367 if (IsRunningHeadless()) { 366 if (IsRunningHeadless()) {
368 EXPECT_EQ(0.5, FakeAudioOutputStream::GetLastFakeStream()->volume()); 367 EXPECT_EQ(0.5, FakeAudioOutputStream::GetCurrentFakeStream()->volume());
369 } 368 }
369 Close();
370 } 370 }
371 371
372 // Simulate the case where a stream is not properly closed. 372 // Simulate the case where a stream is not properly closed.
373 TEST_F(AudioRendererHostTest, CreatePlayAndShutdown) { 373 TEST_F(AudioRendererHostTest, CreatePlayAndShutdown) {
374 if (!IsRunningHeadless()) 374 if (!IsRunningHeadless())
375 EnableRealDevice(); 375 EnableRealDevice();
376 376
377 Create(); 377 Create();
378 Play(); 378 Play();
379 } 379 }
(...skipping 25 matching lines...) Expand all
405 EnableRealDevice(); 405 EnableRealDevice();
406 406
407 Create(); 407 Create();
408 Play(); 408 Play();
409 SimulateError(); 409 SimulateError();
410 Close(); 410 Close();
411 } 411 }
412 412
413 413
414 // TODO(hclam): Add tests for data conversation in low latency mode. 414 // TODO(hclam): Add tests for data conversation in low latency mode.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698