| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/environment.h" | 5 #include "base/environment.h" |
| 6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
| 7 #include "base/process_util.h" | 7 #include "base/process_util.h" |
| 8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
| 9 #include "base/sync_socket.h" | 9 #include "base/sync_socket.h" |
| 10 #include "base/waitable_event.h" | 10 #include "base/waitable_event.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 using ::testing::Return; | 23 using ::testing::Return; |
| 24 using ::testing::SaveArg; | 24 using ::testing::SaveArg; |
| 25 using ::testing::SetArgumentPointee; | 25 using ::testing::SetArgumentPointee; |
| 26 | 26 |
| 27 static const int kInvalidId = -1; | 27 static const int kInvalidId = -1; |
| 28 static const int kRouteId = 200; | 28 static const int kRouteId = 200; |
| 29 static const int kStreamId = 50; | 29 static const int kStreamId = 50; |
| 30 | 30 |
| 31 static bool IsRunningHeadless() { | 31 static bool IsRunningHeadless() { |
| 32 scoped_ptr<base::Environment> env(base::Environment::Create()); | 32 scoped_ptr<base::Environment> env(base::Environment::Create()); |
| 33 if (env->HasEnv("CHROME_HEADLESS")) | 33 if (env->HasVar("CHROME_HEADLESS")) |
| 34 return true; | 34 return true; |
| 35 return false; | 35 return false; |
| 36 } | 36 } |
| 37 | 37 |
| 38 class MockAudioRendererHost : public AudioRendererHost { | 38 class MockAudioRendererHost : public AudioRendererHost { |
| 39 public: | 39 public: |
| 40 MockAudioRendererHost() : shared_memory_length_(0) { | 40 MockAudioRendererHost() : shared_memory_length_(0) { |
| 41 } | 41 } |
| 42 | 42 |
| 43 virtual ~MockAudioRendererHost() { | 43 virtual ~MockAudioRendererHost() { |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 | 462 |
| 463 // Simulate the case where a stream is not properly closed. | 463 // Simulate the case where a stream is not properly closed. |
| 464 TEST_F(AudioRendererHostTest, CreateLowLatencyAndShutdown) { | 464 TEST_F(AudioRendererHostTest, CreateLowLatencyAndShutdown) { |
| 465 if (!IsRunningHeadless()) | 465 if (!IsRunningHeadless()) |
| 466 EnableRealDevice(); | 466 EnableRealDevice(); |
| 467 | 467 |
| 468 CreateLowLatency(); | 468 CreateLowLatency(); |
| 469 } | 469 } |
| 470 | 470 |
| 471 // TODO(hclam): Add tests for data conversation in low latency mode. | 471 // TODO(hclam): Add tests for data conversation in low latency mode. |
| OLD | NEW |