| 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_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "base/json/json_file_value_serializer.h" | 10 #include "base/json/json_file_value_serializer.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 169 |
| 170 void ExtensionManifestTest::LoadAndExpectError( | 170 void ExtensionManifestTest::LoadAndExpectError( |
| 171 char const* manifest_name, | 171 char const* manifest_name, |
| 172 const std::string& expected_error, | 172 const std::string& expected_error, |
| 173 Extension::Location location, | 173 Extension::Location location, |
| 174 int flags) { | 174 int flags) { |
| 175 return LoadAndExpectError( | 175 return LoadAndExpectError( |
| 176 Manifest(manifest_name), expected_error, location, flags); | 176 Manifest(manifest_name), expected_error, location, flags); |
| 177 } | 177 } |
| 178 | 178 |
| 179 void ExtensionManifestTest::AddPattern(URLPatternSet* extent, | 179 void ExtensionManifestTest::AddPattern(extensions::URLPatternSet* extent, |
| 180 const std::string& pattern) { | 180 const std::string& pattern) { |
| 181 int schemes = URLPattern::SCHEME_ALL; | 181 int schemes = URLPattern::SCHEME_ALL; |
| 182 extent->AddPattern(URLPattern(schemes, pattern)); | 182 extent->AddPattern(URLPattern(schemes, pattern)); |
| 183 } | 183 } |
| 184 | 184 |
| 185 ExtensionManifestTest::Testcase::Testcase(std::string manifest_filename, | 185 ExtensionManifestTest::Testcase::Testcase(std::string manifest_filename, |
| 186 std::string expected_error, | 186 std::string expected_error, |
| 187 Extension::Location location, | 187 Extension::Location location, |
| 188 int flags) | 188 int flags) |
| 189 : manifest_filename_(manifest_filename), | 189 : manifest_filename_(manifest_filename), |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 break; | 237 break; |
| 238 case EXPECT_TYPE_SUCCESS: | 238 case EXPECT_TYPE_SUCCESS: |
| 239 for (size_t i = 0; i < num_testcases; ++i) { | 239 for (size_t i = 0; i < num_testcases; ++i) { |
| 240 LoadAndExpectSuccess(testcases[i].manifest_filename_.c_str(), | 240 LoadAndExpectSuccess(testcases[i].manifest_filename_.c_str(), |
| 241 testcases[i].location_, | 241 testcases[i].location_, |
| 242 testcases[i].flags_); | 242 testcases[i].flags_); |
| 243 } | 243 } |
| 244 break; | 244 break; |
| 245 } | 245 } |
| 246 } | 246 } |
| OLD | NEW |