OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_linux.h" | 5 #include "chrome/browser/shell_integration_linux.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cstdlib> | 8 #include <cstdlib> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 // Provides mock environment variables values based on a stored map. | 37 // Provides mock environment variables values based on a stored map. |
38 class MockEnvironment : public base::Environment { | 38 class MockEnvironment : public base::Environment { |
39 public: | 39 public: |
40 MockEnvironment() {} | 40 MockEnvironment() {} |
41 | 41 |
42 void Set(const std::string& name, const std::string& value) { | 42 void Set(const std::string& name, const std::string& value) { |
43 variables_[name] = value; | 43 variables_[name] = value; |
44 } | 44 } |
45 | 45 |
46 virtual bool GetVar(const char* variable_name, std::string* result) OVERRIDE { | 46 virtual bool GetVar(const char* variable_name, std::string* result) override { |
47 if (ContainsKey(variables_, variable_name)) { | 47 if (ContainsKey(variables_, variable_name)) { |
48 *result = variables_[variable_name]; | 48 *result = variables_[variable_name]; |
49 return true; | 49 return true; |
50 } | 50 } |
51 | 51 |
52 return false; | 52 return false; |
53 } | 53 } |
54 | 54 |
55 virtual bool SetVar(const char* variable_name, | 55 virtual bool SetVar(const char* variable_name, |
56 const std::string& new_value) OVERRIDE { | 56 const std::string& new_value) override { |
57 ADD_FAILURE(); | 57 ADD_FAILURE(); |
58 return false; | 58 return false; |
59 } | 59 } |
60 | 60 |
61 virtual bool UnSetVar(const char* variable_name) OVERRIDE { | 61 virtual bool UnSetVar(const char* variable_name) override { |
62 ADD_FAILURE(); | 62 ADD_FAILURE(); |
63 return false; | 63 return false; |
64 } | 64 } |
65 | 65 |
66 private: | 66 private: |
67 std::map<std::string, std::string> variables_; | 67 std::map<std::string, std::string> variables_; |
68 | 68 |
69 DISALLOW_COPY_AND_ASSIGN(MockEnvironment); | 69 DISALLOW_COPY_AND_ASSIGN(MockEnvironment); |
70 }; | 70 }; |
71 | 71 |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 | 633 |
634 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); i++) { | 634 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); i++) { |
635 SCOPED_TRACE(i); | 635 SCOPED_TRACE(i); |
636 EXPECT_EQ(test_cases[i].expected_output, | 636 EXPECT_EQ(test_cases[i].expected_output, |
637 GetDirectoryFileContents(base::ASCIIToUTF16(test_cases[i].title), | 637 GetDirectoryFileContents(base::ASCIIToUTF16(test_cases[i].title), |
638 test_cases[i].icon_name)); | 638 test_cases[i].icon_name)); |
639 } | 639 } |
640 } | 640 } |
641 | 641 |
642 } // namespace shell_integration_linux | 642 } // namespace shell_integration_linux |
OLD | NEW |