| 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/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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 } | 352 } |
| 353 | 353 |
| 354 TEST_F(AudioRendererHostTest, SetVolume) { | 354 TEST_F(AudioRendererHostTest, SetVolume) { |
| 355 if (!IsRunningHeadless()) | 355 if (!IsRunningHeadless()) |
| 356 EnableRealDevice(); | 356 EnableRealDevice(); |
| 357 | 357 |
| 358 Create(); | 358 Create(); |
| 359 SetVolume(0.5); | 359 SetVolume(0.5); |
| 360 Play(); | 360 Play(); |
| 361 Pause(); | 361 Pause(); |
| 362 | |
| 363 // Expect the volume is set. | |
| 364 if (IsRunningHeadless()) { | |
| 365 EXPECT_EQ(0.5, | |
| 366 media::FakeAudioOutputStream::GetCurrentFakeStream()->volume()); | |
| 367 } | |
| 368 Close(); | 362 Close(); |
| 369 } | 363 } |
| 370 | 364 |
| 371 // Simulate the case where a stream is not properly closed. | 365 // Simulate the case where a stream is not properly closed. |
| 372 TEST_F(AudioRendererHostTest, CreatePlayAndShutdown) { | 366 TEST_F(AudioRendererHostTest, CreatePlayAndShutdown) { |
| 373 if (!IsRunningHeadless()) | 367 if (!IsRunningHeadless()) |
| 374 EnableRealDevice(); | 368 EnableRealDevice(); |
| 375 | 369 |
| 376 Create(); | 370 Create(); |
| 377 Play(); | 371 Play(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 404 EnableRealDevice(); | 398 EnableRealDevice(); |
| 405 | 399 |
| 406 Create(); | 400 Create(); |
| 407 Play(); | 401 Play(); |
| 408 SimulateError(); | 402 SimulateError(); |
| 409 Close(); | 403 Close(); |
| 410 } | 404 } |
| 411 | 405 |
| 412 | 406 |
| 413 // TODO(hclam): Add tests for data conversation in low latency mode. | 407 // TODO(hclam): Add tests for data conversation in low latency mode. |
| OLD | NEW |