OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef EXTENSIONS_COMMON_MANIFEST_TEST_H_ | 5 #ifndef EXTENSIONS_COMMON_MANIFEST_TEST_H_ |
6 #define EXTENSIONS_COMMON_MANIFEST_TEST_H_ | 6 #define EXTENSIONS_COMMON_MANIFEST_TEST_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 123 |
124 // used to differentiate between calls to LoadAndExpectError, | 124 // used to differentiate between calls to LoadAndExpectError, |
125 // LoadAndExpectWarning and LoadAndExpectSuccess via function RunTestcases. | 125 // LoadAndExpectWarning and LoadAndExpectSuccess via function RunTestcases. |
126 enum ExpectType { | 126 enum ExpectType { |
127 EXPECT_TYPE_ERROR, | 127 EXPECT_TYPE_ERROR, |
128 EXPECT_TYPE_WARNING, | 128 EXPECT_TYPE_WARNING, |
129 EXPECT_TYPE_SUCCESS | 129 EXPECT_TYPE_SUCCESS |
130 }; | 130 }; |
131 | 131 |
132 struct Testcase { | 132 struct Testcase { |
133 std::string manifest_filename_; | 133 const std::string manifest_filename_; |
134 std::string expected_error_; // only used for ExpectedError tests | 134 std::string expected_error_; // only used for ExpectedError tests |
135 extensions::Manifest::Location location_; | 135 extensions::Manifest::Location location_; |
136 int flags_; | 136 int flags_; |
137 | 137 |
138 Testcase(std::string manifest_filename, std::string expected_error, | 138 Testcase(const std::string& manifest_filename, |
139 extensions::Manifest::Location location, int flags); | 139 const std::string& expected_error, |
| 140 extensions::Manifest::Location location, |
| 141 int flags); |
140 | 142 |
141 Testcase(std::string manifest_filename, std::string expected_error); | 143 Testcase(const std::string& manifest_filename, |
| 144 const std::string& expected_error); |
142 | 145 |
143 explicit Testcase(std::string manifest_filename); | 146 explicit Testcase(const std::string& manifest_filename); |
144 | 147 |
145 Testcase(std::string manifest_filename, | 148 Testcase(const std::string& manifest_filename, |
146 extensions::Manifest::Location location, | 149 extensions::Manifest::Location location, |
147 int flags); | 150 int flags); |
148 }; | 151 }; |
149 | 152 |
150 void RunTestcases(const Testcase* testcases, | 153 void RunTestcases(const Testcase* testcases, |
151 size_t num_testcases, | 154 size_t num_testcases, |
152 ExpectType type); | 155 ExpectType type); |
153 | 156 |
154 void RunTestcase(const Testcase& testcase, ExpectType type); | 157 void RunTestcase(const Testcase& testcase, ExpectType type); |
155 | 158 |
156 bool enable_apps_; | 159 bool enable_apps_; |
157 | 160 |
158 private: | 161 private: |
159 DISALLOW_COPY_AND_ASSIGN(ManifestTest); | 162 DISALLOW_COPY_AND_ASSIGN(ManifestTest); |
160 }; | 163 }; |
161 | 164 |
162 } // namespace extensions | 165 } // namespace extensions |
163 | 166 |
164 #endif // EXTENSIONS_COMMON_MANIFEST_TEST_H_ | 167 #endif // EXTENSIONS_COMMON_MANIFEST_TEST_H_ |
OLD | NEW |