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 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" | 5 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/json/json_file_value_serializer.h" | 9 #include "base/json/json_file_value_serializer.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 ExtensionManifestTest::Testcase::Testcase(std::string manifest_filename, | 210 ExtensionManifestTest::Testcase::Testcase(std::string manifest_filename, |
211 std::string expected_error) | 211 std::string expected_error) |
212 : manifest_filename_(manifest_filename), | 212 : manifest_filename_(manifest_filename), |
213 expected_error_(expected_error), | 213 expected_error_(expected_error), |
214 location_(extensions::Manifest::INTERNAL), | 214 location_(extensions::Manifest::INTERNAL), |
215 flags_(Extension::NO_FLAGS) { | 215 flags_(Extension::NO_FLAGS) { |
216 } | 216 } |
217 | 217 |
218 ExtensionManifestTest::Testcase::Testcase(std::string manifest_filename) | 218 ExtensionManifestTest::Testcase::Testcase(std::string manifest_filename) |
219 : manifest_filename_(manifest_filename), | 219 : manifest_filename_(manifest_filename), |
220 expected_error_(""), | |
221 location_(extensions::Manifest::INTERNAL), | 220 location_(extensions::Manifest::INTERNAL), |
222 flags_(Extension::NO_FLAGS) { | 221 flags_(Extension::NO_FLAGS) {} |
223 } | |
224 | 222 |
225 ExtensionManifestTest::Testcase::Testcase( | 223 ExtensionManifestTest::Testcase::Testcase( |
226 std::string manifest_filename, | 224 std::string manifest_filename, |
227 extensions::Manifest::Location location, | 225 extensions::Manifest::Location location, |
228 int flags) | 226 int flags) |
229 : manifest_filename_(manifest_filename), | 227 : manifest_filename_(manifest_filename), |
230 expected_error_(""), | |
231 location_(location), | 228 location_(location), |
232 flags_(flags) { | 229 flags_(flags) {} |
233 } | |
234 | 230 |
235 void ExtensionManifestTest::RunTestcases(const Testcase* testcases, | 231 void ExtensionManifestTest::RunTestcases(const Testcase* testcases, |
236 size_t num_testcases, | 232 size_t num_testcases, |
237 EXPECT_TYPE type) { | 233 EXPECT_TYPE type) { |
238 switch (type) { | 234 switch (type) { |
239 case EXPECT_TYPE_ERROR: | 235 case EXPECT_TYPE_ERROR: |
240 for (size_t i = 0; i < num_testcases; ++i) { | 236 for (size_t i = 0; i < num_testcases; ++i) { |
241 LoadAndExpectError(testcases[i].manifest_filename_.c_str(), | 237 LoadAndExpectError(testcases[i].manifest_filename_.c_str(), |
242 testcases[i].expected_error_, | 238 testcases[i].expected_error_, |
243 testcases[i].location_, | 239 testcases[i].location_, |
(...skipping 10 matching lines...) Expand all Loading... |
254 break; | 250 break; |
255 case EXPECT_TYPE_SUCCESS: | 251 case EXPECT_TYPE_SUCCESS: |
256 for (size_t i = 0; i < num_testcases; ++i) { | 252 for (size_t i = 0; i < num_testcases; ++i) { |
257 LoadAndExpectSuccess(testcases[i].manifest_filename_.c_str(), | 253 LoadAndExpectSuccess(testcases[i].manifest_filename_.c_str(), |
258 testcases[i].location_, | 254 testcases[i].location_, |
259 testcases[i].flags_); | 255 testcases[i].flags_); |
260 } | 256 } |
261 break; | 257 break; |
262 } | 258 } |
263 } | 259 } |
OLD | NEW |