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

Unified Diff: chrome/browser/shell_integration_unittest.cc

Issue 3052034: base: Rename EnvVarGetter to Environment. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: review Created 10 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/shell_integration_unittest.cc
diff --git a/chrome/browser/shell_integration_unittest.cc b/chrome/browser/shell_integration_unittest.cc
index dbaa290550713df0b8c84533be853d328fc5d784..708bf3cb0d729995ce26b272f84ffeb8a5d481f2 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);
}

Powered by Google App Engine
This is Rietveld 408576698