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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 const Manifest& manifest, | 120 const Manifest& manifest, |
121 const std::string& expected_warning, | 121 const std::string& expected_warning, |
122 Extension::Location location, | 122 Extension::Location location, |
123 int flags) { | 123 int flags) { |
124 std::string error; | 124 std::string error; |
125 scoped_refptr<Extension> extension = | 125 scoped_refptr<Extension> extension = |
126 LoadExtension(manifest, &error, location, flags); | 126 LoadExtension(manifest, &error, location, flags); |
127 EXPECT_TRUE(extension) << manifest.name(); | 127 EXPECT_TRUE(extension) << manifest.name(); |
128 EXPECT_EQ("", error) << manifest.name(); | 128 EXPECT_EQ("", error) << manifest.name(); |
129 EXPECT_EQ(1u, extension->install_warnings().size()); | 129 EXPECT_EQ(1u, extension->install_warnings().size()); |
130 EXPECT_EQ(expected_warning, extension->install_warnings()[0]); | 130 EXPECT_EQ(expected_warning, extension->install_warnings()[0].message); |
131 return extension; | 131 return extension; |
132 } | 132 } |
133 | 133 |
134 scoped_refptr<Extension> ExtensionManifestTest::LoadAndExpectWarning( | 134 scoped_refptr<Extension> ExtensionManifestTest::LoadAndExpectWarning( |
135 char const* manifest_name, | 135 char const* manifest_name, |
136 const std::string& expected_warning, | 136 const std::string& expected_warning, |
137 Extension::Location location, | 137 Extension::Location location, |
138 int flags) { | 138 int flags) { |
139 return LoadAndExpectWarning( | 139 return LoadAndExpectWarning( |
140 Manifest(manifest_name), expected_warning, location, flags); | 140 Manifest(manifest_name), expected_warning, location, flags); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 break; | 234 break; |
235 case EXPECT_TYPE_SUCCESS: | 235 case EXPECT_TYPE_SUCCESS: |
236 for (size_t i = 0; i < num_testcases; ++i) { | 236 for (size_t i = 0; i < num_testcases; ++i) { |
237 LoadAndExpectSuccess(testcases[i].manifest_filename_.c_str(), | 237 LoadAndExpectSuccess(testcases[i].manifest_filename_.c_str(), |
238 testcases[i].location_, | 238 testcases[i].location_, |
239 testcases[i].flags_); | 239 testcases[i].flags_); |
240 } | 240 } |
241 break; | 241 break; |
242 } | 242 } |
243 } | 243 } |
OLD | NEW |