diff options
-rw-r--r-- | base/sys_info.h | 4 | ||||
-rw-r--r-- | base/sys_info_posix.cc | 8 | ||||
-rw-r--r-- | base/sys_info_unittest.cc | 7 | ||||
-rw-r--r-- | base/sys_info_win.cc | 7 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_main.cc | 6 |
5 files changed, 7 insertions, 25 deletions
diff --git a/base/sys_info.h b/base/sys_info.h index 0f27aa7..cefce13 100644 --- a/base/sys_info.h +++ b/base/sys_info.h @@ -30,10 +30,6 @@ class SysInfo { // or -1 on failure. static int64 AmountOfFreeDiskSpace(const FilePath& path); - // Return true if the given environment variable is defined. - // DEPRECATED in favor of EnvVarGetter in base/env_var.h. - static bool HasEnvVar(const wchar_t* var); - // Return the value of the given environment variable // or an empty string if not defined. // DEPRECATED in favor of EnvVarGetter in base/env_var.h. diff --git a/base/sys_info_posix.cc b/base/sys_info_posix.cc index b2526ba..f2d75d2 100644 --- a/base/sys_info_posix.cc +++ b/base/sys_info_posix.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -47,12 +47,6 @@ int64 SysInfo::AmountOfFreeDiskSpace(const FilePath& path) { } // static -bool SysInfo::HasEnvVar(const wchar_t* var) { - std::string var_utf8 = WideToUTF8(std::wstring(var)); - return getenv(var_utf8.c_str()) != NULL; -} - -// static std::wstring SysInfo::GetEnvVar(const wchar_t* var) { std::string var_utf8 = WideToUTF8(std::wstring(var)); char* value = getenv(var_utf8.c_str()); diff --git a/base/sys_info_unittest.cc b/base/sys_info_unittest.cc index 4339b6a..79f172d 100644 --- a/base/sys_info_unittest.cc +++ b/base/sys_info_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -33,11 +33,6 @@ TEST_F(SysInfoTest, GetEnvVar) { EXPECT_NE(base::SysInfo::GetEnvVar(L"PATH"), L""); } -TEST_F(SysInfoTest, HasEnvVar) { - // Every setup should have PATH... - EXPECT_TRUE(base::SysInfo::HasEnvVar(L"PATH")); -} - #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS) TEST_F(SysInfoTest, OperatingSystemVersionNumbers) { int32 os_major_version = -1; diff --git a/base/sys_info_win.cc b/base/sys_info_win.cc index ebb95c7ba..35a7878 100644 --- a/base/sys_info_win.cc +++ b/base/sys_info_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -48,11 +48,6 @@ int64 SysInfo::AmountOfFreeDiskSpace(const FilePath& path) { } // static -bool SysInfo::HasEnvVar(const wchar_t* var) { - return GetEnvironmentVariable(var, NULL, 0) != 0; -} - -// static std::wstring SysInfo::GetEnvVar(const wchar_t* var) { DWORD value_length = GetEnvironmentVariable(var, NULL, 0); if (value_length == 0) { diff --git a/webkit/tools/test_shell/test_shell_main.cc b/webkit/tools/test_shell/test_shell_main.cc index 41de061..412cd3a 100644 --- a/webkit/tools/test_shell/test_shell_main.cc +++ b/webkit/tools/test_shell/test_shell_main.cc @@ -1,10 +1,11 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/at_exit.h" #include "base/basictypes.h" #include "base/command_line.h" +#include "base/env_var.h" #include "base/event_recorder.h" #include "base/file_path.h" #include "base/file_util.h" @@ -90,8 +91,9 @@ int main(int argc, char* argv[]) { // directly, its constructor sets up some necessary state. MessageLoopForUI main_message_loop; + scoped_ptr<base::EnvVarGetter> env(base::EnvVarGetter::Create()); bool suppress_error_dialogs = ( - base::SysInfo::HasEnvVar(L"CHROME_HEADLESS") || + env->HasEnv("CHROME_HEADLESS") || parsed_command_line.HasSwitch(test_shell::kNoErrorDialogs) || parsed_command_line.HasSwitch(test_shell::kLayoutTests)); bool layout_test_mode = |