diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-03 03:00:50 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-03 03:00:50 +0000 |
commit | 76b90d310def447b7b5f10d92a69813308150778 (patch) | |
tree | 24c61fdccf94360913bfa8f7ac67c24a27bcfb38 /chrome/browser/shell_integration_unittest.cc | |
parent | 7f2a9dbe56bfa6189271af808c53ccaee193a961 (diff) | |
download | chromium_src-76b90d310def447b7b5f10d92a69813308150778.zip chromium_src-76b90d310def447b7b5f10d92a69813308150778.tar.gz chromium_src-76b90d310def447b7b5f10d92a69813308150778.tar.bz2 |
base: Rename EnvVarGetter to Environment.
Now EnvVarGetter do much more than getting environment variables.
Per suggestion from Pawel in http://codereview.chromium.org/3043018/.
BUG=None
TEST=trybots
Signed-off-by: Thiago Farina <tfarina@chromium.org>
Review URL: http://codereview.chromium.org/3052034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54696 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/shell_integration_unittest.cc')
-rw-r--r-- | chrome/browser/shell_integration_unittest.cc | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/chrome/browser/shell_integration_unittest.cc b/chrome/browser/shell_integration_unittest.cc index dbaa290..708bf3c 100644 --- a/chrome/browser/shell_integration_unittest.cc +++ b/chrome/browser/shell_integration_unittest.cc @@ -21,7 +21,7 @@ #if defined(OS_WIN) #include "chrome/installer/util/browser_distribution.h" #elif defined(OS_LINUX) -#include "base/env_var.h" +#include "base/environment.h" #endif // defined(OS_LINUX) #define FPL FILE_PATH_LITERAL @@ -30,9 +30,9 @@ namespace { // Provides mock environment variables values based on a stored map. -class MockEnvVarGetter : public base::EnvVarGetter { +class MockEnvironment : public base::Environment { public: - MockEnvVarGetter() {} + MockEnvironment() {} void Set(const std::string& name, const std::string& value) { variables_[name] = value; @@ -60,7 +60,7 @@ class MockEnvVarGetter : public base::EnvVarGetter { private: std::map<std::string, std::string> variables_; - DISALLOW_COPY_AND_ASSIGN(MockEnvVarGetter); + DISALLOW_COPY_AND_ASSIGN(MockEnvironment); }; } // namespace @@ -82,13 +82,13 @@ TEST(ShellIntegrationTest, GetDesktopShortcutTemplate) { ScopedTempDir temp_dir; ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); - MockEnvVarGetter env_getter; - env_getter.Set("XDG_DATA_HOME", temp_dir.path().value()); + MockEnvironment env; + env.Set("XDG_DATA_HOME", temp_dir.path().value()); ASSERT_TRUE(file_util::WriteFile( temp_dir.path().AppendASCII(kTemplateFilename), kTestData1, strlen(kTestData1))); std::string contents; - ASSERT_TRUE(ShellIntegration::GetDesktopShortcutTemplate(&env_getter, + ASSERT_TRUE(ShellIntegration::GetDesktopShortcutTemplate(&env, &contents)); EXPECT_EQ(kTestData1, contents); } @@ -97,8 +97,8 @@ TEST(ShellIntegrationTest, GetDesktopShortcutTemplate) { ScopedTempDir temp_dir; ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); - MockEnvVarGetter env_getter; - env_getter.Set("XDG_DATA_DIRS", temp_dir.path().value()); + MockEnvironment env; + env.Set("XDG_DATA_DIRS", temp_dir.path().value()); ASSERT_TRUE(file_util::CreateDirectory( temp_dir.path().AppendASCII("applications"))); ASSERT_TRUE(file_util::WriteFile( @@ -106,7 +106,7 @@ TEST(ShellIntegrationTest, GetDesktopShortcutTemplate) { .AppendASCII(kTemplateFilename), kTestData2, strlen(kTestData2))); std::string contents; - ASSERT_TRUE(ShellIntegration::GetDesktopShortcutTemplate(&env_getter, + ASSERT_TRUE(ShellIntegration::GetDesktopShortcutTemplate(&env, &contents)); EXPECT_EQ(kTestData2, contents); } @@ -115,8 +115,8 @@ TEST(ShellIntegrationTest, GetDesktopShortcutTemplate) { ScopedTempDir temp_dir; ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); - MockEnvVarGetter env_getter; - env_getter.Set("XDG_DATA_DIRS", temp_dir.path().value() + ":" + + MockEnvironment env; + env.Set("XDG_DATA_DIRS", temp_dir.path().value() + ":" + temp_dir.path().AppendASCII("applications").value()); ASSERT_TRUE(file_util::CreateDirectory( temp_dir.path().AppendASCII("applications"))); @@ -128,7 +128,7 @@ TEST(ShellIntegrationTest, GetDesktopShortcutTemplate) { .AppendASCII(kTemplateFilename), kTestData2, strlen(kTestData2))); std::string contents; - ASSERT_TRUE(ShellIntegration::GetDesktopShortcutTemplate(&env_getter, + ASSERT_TRUE(ShellIntegration::GetDesktopShortcutTemplate(&env, &contents)); EXPECT_EQ(kTestData1, contents); } |