Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(312)

Side by Side Diff: chrome/common/extensions/manifest_tests/extension_manifest_test.cc

Issue 15836003: Update chrome/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 return Extension::Create(path.DirName(), location, *value, flags, error); 115 return Extension::Create(path.DirName(), location, *value, flags, error);
116 } 116 }
117 117
118 scoped_refptr<Extension> ExtensionManifestTest::LoadAndExpectSuccess( 118 scoped_refptr<Extension> ExtensionManifestTest::LoadAndExpectSuccess(
119 const Manifest& manifest, 119 const Manifest& manifest,
120 extensions::Manifest::Location location, 120 extensions::Manifest::Location location,
121 int flags) { 121 int flags) {
122 std::string error; 122 std::string error;
123 scoped_refptr<Extension> extension = 123 scoped_refptr<Extension> extension =
124 LoadExtension(manifest, &error, location, flags); 124 LoadExtension(manifest, &error, location, flags);
125 EXPECT_TRUE(extension) << manifest.name(); 125 EXPECT_TRUE(extension.get()) << manifest.name();
126 EXPECT_EQ("", error) << manifest.name(); 126 EXPECT_EQ("", error) << manifest.name();
127 return extension; 127 return extension;
128 } 128 }
129 129
130 scoped_refptr<Extension> ExtensionManifestTest::LoadAndExpectSuccess( 130 scoped_refptr<Extension> ExtensionManifestTest::LoadAndExpectSuccess(
131 char const* manifest_name, 131 char const* manifest_name,
132 extensions::Manifest::Location location, 132 extensions::Manifest::Location location,
133 int flags) { 133 int flags) {
134 return LoadAndExpectSuccess(Manifest(manifest_name), location, flags); 134 return LoadAndExpectSuccess(Manifest(manifest_name), location, flags);
135 } 135 }
136 136
137 scoped_refptr<Extension> ExtensionManifestTest::LoadAndExpectWarning( 137 scoped_refptr<Extension> ExtensionManifestTest::LoadAndExpectWarning(
138 const Manifest& manifest, 138 const Manifest& manifest,
139 const std::string& expected_warning, 139 const std::string& expected_warning,
140 extensions::Manifest::Location location, 140 extensions::Manifest::Location location,
141 int flags) { 141 int flags) {
142 std::string error; 142 std::string error;
143 scoped_refptr<Extension> extension = 143 scoped_refptr<Extension> extension =
144 LoadExtension(manifest, &error, location, flags); 144 LoadExtension(manifest, &error, location, flags);
145 EXPECT_TRUE(extension) << manifest.name(); 145 EXPECT_TRUE(extension.get()) << manifest.name();
146 EXPECT_EQ("", error) << manifest.name(); 146 EXPECT_EQ("", error) << manifest.name();
147 EXPECT_EQ(1u, extension->install_warnings().size()); 147 EXPECT_EQ(1u, extension->install_warnings().size());
148 EXPECT_EQ(expected_warning, extension->install_warnings()[0].message); 148 EXPECT_EQ(expected_warning, extension->install_warnings()[0].message);
149 return extension; 149 return extension;
150 } 150 }
151 151
152 scoped_refptr<Extension> ExtensionManifestTest::LoadAndExpectWarning( 152 scoped_refptr<Extension> ExtensionManifestTest::LoadAndExpectWarning(
153 char const* manifest_name, 153 char const* manifest_name,
154 const std::string& expected_warning, 154 const std::string& expected_warning,
155 extensions::Manifest::Location location, 155 extensions::Manifest::Location location,
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 testcase.location_, 250 testcase.location_,
251 testcase.flags_); 251 testcase.flags_);
252 break; 252 break;
253 case EXPECT_TYPE_SUCCESS: 253 case EXPECT_TYPE_SUCCESS:
254 LoadAndExpectSuccess(testcase.manifest_filename_.c_str(), 254 LoadAndExpectSuccess(testcase.manifest_filename_.c_str(),
255 testcase.location_, 255 testcase.location_,
256 testcase.flags_); 256 testcase.flags_);
257 break; 257 break;
258 } 258 }
259 } 259 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698