| 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/basictypes.h" | 6 #include "base/basictypes.h" |
| 7 #include "base/waitable_event.h" | 7 #include "base/waitable_event.h" |
| 8 #include "media/audio/audio_output_controller.h" | 8 #include "media/audio/audio_output_controller.h" |
| 9 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 static bool HasAudioOutputDevices() { | 58 static bool HasAudioOutputDevices() { |
| 59 AudioManager* audio_man = AudioManager::GetAudioManager(); | 59 AudioManager* audio_man = AudioManager::GetAudioManager(); |
| 60 CHECK(audio_man); | 60 CHECK(audio_man); |
| 61 return audio_man->HasAudioOutputDevices(); | 61 return audio_man->HasAudioOutputDevices(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 static bool IsRunningHeadless() { | 64 static bool IsRunningHeadless() { |
| 65 scoped_ptr<base::Environment> env(base::Environment::Create()); | 65 scoped_ptr<base::Environment> env(base::Environment::Create()); |
| 66 if (env->HasEnv("CHROME_HEADLESS")) | 66 if (env->HasVar("CHROME_HEADLESS")) |
| 67 return true; | 67 return true; |
| 68 return false; | 68 return false; |
| 69 } | 69 } |
| 70 | 70 |
| 71 ACTION_P3(SignalEvent, event, count, limit) { | 71 ACTION_P3(SignalEvent, event, count, limit) { |
| 72 if (++*count >= limit) { | 72 if (++*count >= limit) { |
| 73 event->Signal(); | 73 event->Signal(); |
| 74 } | 74 } |
| 75 } | 75 } |
| 76 | 76 |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 kSampleRate, kBitsPerSample, | 276 kSampleRate, kBitsPerSample, |
| 277 kHardwareBufferSize, kBufferCapacity); | 277 kHardwareBufferSize, kBufferCapacity); |
| 278 ASSERT_TRUE(controller.get()); | 278 ASSERT_TRUE(controller.get()); |
| 279 | 279 |
| 280 // Close the controller immediately. | 280 // Close the controller immediately. |
| 281 controller->Close(); | 281 controller->Close(); |
| 282 controller->Close(); | 282 controller->Close(); |
| 283 } | 283 } |
| 284 | 284 |
| 285 } // namespace media | 285 } // namespace media |
| OLD | NEW |