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

Side by Side Diff: chrome/browser/shell_integration_unittest.cc

Issue 2843048: base: Add SetEnv() to EnvVarGetter class and get rid of the some ifdefs. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: filename 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 unified diff | Download patch
« no previous file with comments | « base/xdg_util_unittest.cc ('k') | chrome/common/logging_chrome_uitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/shell_integration.h" 5 #include "chrome/browser/shell_integration.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 30 matching lines...) Expand all
41 41
42 virtual bool GetEnv(const char* variable_name, std::string* result) { 42 virtual bool GetEnv(const char* variable_name, std::string* result) {
43 if (ContainsKey(variables_, variable_name)) { 43 if (ContainsKey(variables_, variable_name)) {
44 *result = variables_[variable_name]; 44 *result = variables_[variable_name];
45 return true; 45 return true;
46 } 46 }
47 47
48 return false; 48 return false;
49 } 49 }
50 50
51 virtual void SetEnv(const char* variable_name, const std::string& new_value) {
52 NOTIMPLEMENTED();
53 }
54
51 private: 55 private:
52 std::map<std::string, std::string> variables_; 56 std::map<std::string, std::string> variables_;
53 57
54 DISALLOW_COPY_AND_ASSIGN(MockEnvVarGetter); 58 DISALLOW_COPY_AND_ASSIGN(MockEnvVarGetter);
55 }; 59 };
56 60
57 } // namespace 61 } // namespace
58 62
59 TEST(ShellIntegrationTest, GetDesktopShortcutTemplate) { 63 TEST(ShellIntegrationTest, GetDesktopShortcutTemplate) {
60 #if defined(GOOGLE_CHROME_BUILD) 64 #if defined(GOOGLE_CHROME_BUILD)
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 // Non-default profile path should get chrome::kBrowserAppID joined with 305 // Non-default profile path should get chrome::kBrowserAppID joined with
302 // profile info. 306 // profile info.
303 FilePath profile_path(FILE_PATH_LITERAL("root")); 307 FilePath profile_path(FILE_PATH_LITERAL("root"));
304 profile_path = profile_path.Append(FILE_PATH_LITERAL("udd")); 308 profile_path = profile_path.Append(FILE_PATH_LITERAL("udd"));
305 profile_path = profile_path.Append(FILE_PATH_LITERAL("User Data - Test")); 309 profile_path = profile_path.Append(FILE_PATH_LITERAL("User Data - Test"));
306 EXPECT_EQ(BrowserDistribution::GetDistribution()->GetBrowserAppId() + 310 EXPECT_EQ(BrowserDistribution::GetDistribution()->GetBrowserAppId() +
307 L".udd.UserDataTest", 311 L".udd.UserDataTest",
308 ShellIntegration::GetChromiumAppId(profile_path)); 312 ShellIntegration::GetChromiumAppId(profile_path));
309 } 313 }
310 #endif 314 #endif
OLDNEW
« no previous file with comments | « base/xdg_util_unittest.cc ('k') | chrome/common/logging_chrome_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698