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

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

Issue 3052034: base: Rename EnvVarGetter to Environment. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: review Created 10 years, 4 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
OLDNEW
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/env_var.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"
11 11
12 using ::testing::_; 12 using ::testing::_;
13 using ::testing::AtLeast; 13 using ::testing::AtLeast;
14 using ::testing::Exactly; 14 using ::testing::Exactly;
15 using ::testing::InvokeWithoutArgs; 15 using ::testing::InvokeWithoutArgs;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 DISALLOW_COPY_AND_ASSIGN(MockAudioOutputControllerSyncReader); 55 DISALLOW_COPY_AND_ASSIGN(MockAudioOutputControllerSyncReader);
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::EnvVarGetter> env(base::EnvVarGetter::Create()); 65 scoped_ptr<base::Environment> env(base::Environment::Create());
66 if (env->HasEnv("CHROME_HEADLESS")) 66 if (env->HasEnv("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 }
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698