summaryrefslogtreecommitdiffstats
path: root/base/env_var_unittest.cc
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-09 23:31:21 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-09 23:31:21 +0000
commit9c55d6cd75f149008c9d7bf8cca55145f68b43ca (patch)
tree661a17cf8bb3828524d19796d801547d376fc532 /base/env_var_unittest.cc
parent67ada37a725c3088a586300e643dc5d3153b3cf4 (diff)
downloadchromium_src-9c55d6cd75f149008c9d7bf8cca55145f68b43ca.zip
chromium_src-9c55d6cd75f149008c9d7bf8cca55145f68b43ca.tar.gz
chromium_src-9c55d6cd75f149008c9d7bf8cca55145f68b43ca.tar.bz2
base: Add SetEnvVar test to env_var_unittest.cc
BUG=None TEST=env_var_unittest.cc. out/Debug/base_unittests --gtest_filter=EnvVarTest.SetEnvVar Review URL: http://codereview.chromium.org/2935002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52017 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/env_var_unittest.cc')
-rw-r--r--base/env_var_unittest.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/base/env_var_unittest.cc b/base/env_var_unittest.cc
index 97b1a23..5587878 100644
--- a/base/env_var_unittest.cc
+++ b/base/env_var_unittest.cc
@@ -22,3 +22,17 @@ TEST_F(EnvVarTest, HasEnvVar) {
scoped_ptr<base::EnvVarGetter> env(base::EnvVarGetter::Create());
EXPECT_TRUE(env->HasEnv("PATH"));
}
+
+TEST_F(EnvVarTest, SetEnvVar) {
+ const char kFooUpper[] = "FOO";
+ const char kFooLower[] = "foo";
+ scoped_ptr<base::EnvVarGetter> env(base::EnvVarGetter::Create());
+ env->SetEnv(kFooUpper, kFooLower);
+
+ // Now verify that the environment has the new variable.
+ EXPECT_TRUE(env->HasEnv(kFooUpper));
+
+ std::string var_value;
+ EXPECT_TRUE(env->GetEnv(kFooUpper, &var_value));
+ EXPECT_EQ(var_value, kFooLower);
+}