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 21 matching lines...) Expand all Loading... |
32 | 32 |
33 // Provides mock environment variables values based on a stored map. | 33 // Provides mock environment variables values based on a stored map. |
34 class MockEnvironment : public base::Environment { | 34 class MockEnvironment : public base::Environment { |
35 public: | 35 public: |
36 MockEnvironment() {} | 36 MockEnvironment() {} |
37 | 37 |
38 void Set(const std::string& name, const std::string& value) { | 38 void Set(const std::string& name, const std::string& value) { |
39 variables_[name] = value; | 39 variables_[name] = value; |
40 } | 40 } |
41 | 41 |
42 virtual bool GetEnv(const char* variable_name, std::string* result) { | 42 virtual bool GetVar(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 bool SetVar(const char* variable_name, const std::string& new_value) { | 51 virtual bool SetVar(const char* variable_name, const std::string& new_value) { |
52 ADD_FAILURE(); | 52 ADD_FAILURE(); |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 // Non-default profile path should get chrome::kBrowserAppID joined with | 310 // Non-default profile path should get chrome::kBrowserAppID joined with |
311 // profile info. | 311 // profile info. |
312 FilePath profile_path(FILE_PATH_LITERAL("root")); | 312 FilePath profile_path(FILE_PATH_LITERAL("root")); |
313 profile_path = profile_path.Append(FILE_PATH_LITERAL("udd")); | 313 profile_path = profile_path.Append(FILE_PATH_LITERAL("udd")); |
314 profile_path = profile_path.Append(FILE_PATH_LITERAL("User Data - Test")); | 314 profile_path = profile_path.Append(FILE_PATH_LITERAL("User Data - Test")); |
315 EXPECT_EQ(BrowserDistribution::GetDistribution()->GetBrowserAppId() + | 315 EXPECT_EQ(BrowserDistribution::GetDistribution()->GetBrowserAppId() + |
316 L".udd.UserDataTest", | 316 L".udd.UserDataTest", |
317 ShellIntegration::GetChromiumAppId(profile_path)); | 317 ShellIntegration::GetChromiumAppId(profile_path)); |
318 } | 318 } |
319 #endif | 319 #endif |
OLD | NEW |