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

Side by Side Diff: chrome/browser/profile_resetter/profile_resetter_unittest.cc

Issue 16907002: Update Android 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
« no previous file with comments | « cc/resources/raster_worker_pool.cc ('k') | content/browser/android/edge_effect.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/browser/profile_resetter/profile_resetter.h" 5 #include "chrome/browser/profile_resetter/profile_resetter.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "chrome/browser/extensions/extension_service_unittest.h" 9 #include "chrome/browser/extensions/extension_service_unittest.h"
10 #include "chrome/browser/prefs/session_startup_pref.h" 10 #include "chrome/browser/prefs/session_startup_pref.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 ThemeService* theme_service = 169 ThemeService* theme_service =
170 ThemeServiceFactory::GetForProfile(profile_.get()); 170 ThemeServiceFactory::GetForProfile(profile_.get());
171 EXPECT_FALSE(theme_service->UsingDefaultTheme()); 171 EXPECT_FALSE(theme_service->UsingDefaultTheme());
172 #endif 172 #endif
173 173
174 scoped_refptr<Extension> ext2 = CreateExtension( 174 scoped_refptr<Extension> ext2 = CreateExtension(
175 "example2", 175 "example2",
176 base::FilePath(FILE_PATH_LITERAL("//nonexistent")), 176 base::FilePath(FILE_PATH_LITERAL("//nonexistent")),
177 Manifest::INVALID_LOCATION, 177 Manifest::INVALID_LOCATION,
178 false); 178 false);
179 service_->AddExtension(ext2); 179 service_->AddExtension(ext2.get());
180 // Components and external policy extensions shouldn't be deleted. 180 // Components and external policy extensions shouldn't be deleted.
181 scoped_refptr<Extension> ext3 = CreateExtension( 181 scoped_refptr<Extension> ext3 = CreateExtension(
182 "example3", 182 "example3",
183 base::FilePath(FILE_PATH_LITERAL("//nonexistent2")), 183 base::FilePath(FILE_PATH_LITERAL("//nonexistent2")),
184 Manifest::COMPONENT, 184 Manifest::COMPONENT,
185 false); 185 false);
186 service_->AddExtension(ext3); 186 service_->AddExtension(ext3.get());
187 scoped_refptr<Extension> ext4 = CreateExtension( 187 scoped_refptr<Extension> ext4 =
188 "example4", 188 CreateExtension("example4",
189 base::FilePath(FILE_PATH_LITERAL("//nonexistent3")), 189 base::FilePath(FILE_PATH_LITERAL("//nonexistent3")),
190 Manifest::EXTERNAL_POLICY_DOWNLOAD, 190 Manifest::EXTERNAL_POLICY_DOWNLOAD,
191 false); 191 false);
192 service_->AddExtension(ext4); 192 service_->AddExtension(ext4.get());
193 EXPECT_EQ(4u, service_->extensions()->size()); 193 EXPECT_EQ(4u, service_->extensions()->size());
194 194
195 resetter_->Reset( 195 resetter_->Reset(
196 ProfileResetter::EXTENSIONS, 196 ProfileResetter::EXTENSIONS,
197 ProfileResetter::DISABLE_EXTENSIONS, 197 ProfileResetter::DISABLE_EXTENSIONS,
198 base::Bind(&MockObject::StopLoop, base::Unretained(&mock_object_))); 198 base::Bind(&MockObject::StopLoop, base::Unretained(&mock_object_)));
199 mock_object_.RunLoop(); 199 mock_object_.RunLoop();
200 200
201 EXPECT_EQ(2u, service_->extensions()->size()); 201 EXPECT_EQ(2u, service_->extensions()->size());
202 EXPECT_TRUE(service_->extensions()->Contains(ext3->id())); 202 EXPECT_TRUE(service_->extensions()->Contains(ext3->id()));
(...skipping 26 matching lines...) Expand all
229 TEST_F(ProfileResetterTest, ResetFewFlags) { 229 TEST_F(ProfileResetterTest, ResetFewFlags) {
230 // mock_object_ is a StrictMock, so we verify that it is called only once. 230 // mock_object_ is a StrictMock, so we verify that it is called only once.
231 resetter_->Reset( 231 resetter_->Reset(
232 ProfileResetter::DEFAULT_SEARCH_ENGINE | ProfileResetter::HOMEPAGE, 232 ProfileResetter::DEFAULT_SEARCH_ENGINE | ProfileResetter::HOMEPAGE,
233 ProfileResetter::DISABLE_EXTENSIONS, 233 ProfileResetter::DISABLE_EXTENSIONS,
234 base::Bind(&MockObject::StopLoop, base::Unretained(&mock_object_))); 234 base::Bind(&MockObject::StopLoop, base::Unretained(&mock_object_)));
235 mock_object_.RunLoop(); 235 mock_object_.RunLoop();
236 } 236 }
237 237
238 } // namespace 238 } // namespace
OLDNEW
« no previous file with comments | « cc/resources/raster_worker_pool.cc ('k') | content/browser/android/edge_effect.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698