| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |