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

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

Issue 16296002: 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) 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/prefs/session_startup_pref.h" 9 #include "chrome/browser/prefs/session_startup_pref.h"
10 #include "chrome/browser/search_engines/template_url_service_test_util.h" 10 #include "chrome/browser/search_engines/template_url_service_test_util.h"
11 #include "chrome/common/pref_names.h" 11 #include "chrome/common/pref_names.h"
12 #include "chrome/test/base/testing_profile.h" 12 #include "chrome/test/base/testing_profile.h"
13 #include "content/public/test/test_utils.h" 13 #include "content/public/test/test_utils.h"
14 #include "testing/gmock/include/gmock/gmock.h" 14 #include "testing/gmock/include/gmock/gmock.h"
15 15
16 namespace { 16 namespace {
17 17
18 class MockObject { 18 class MockObject {
19 public: 19 public:
20 void RunLoop() { 20 void RunLoop() {
21 EXPECT_CALL(*this, Callback()); 21 EXPECT_CALL(*this, Callback());
22 runner_ = new content::MessageLoopRunner; 22 runner_ = new content::MessageLoopRunner;
23 runner_->Run(); 23 runner_->Run();
24 } 24 }
25 25
26 void StopLoop() { 26 void StopLoop() {
27 DCHECK(runner_); 27 DCHECK(runner_.get());
28 Callback(); 28 Callback();
29 runner_->Quit(); 29 runner_->Quit();
30 } 30 }
31 31
32 private: 32 private:
33 MOCK_METHOD0(Callback, void(void)); 33 MOCK_METHOD0(Callback, void(void));
34 34
35 scoped_refptr<content::MessageLoopRunner> runner_; 35 scoped_refptr<content::MessageLoopRunner> runner_;
36 }; 36 };
37 37
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 TEST_F(ProfileResetterTest, ResetExtensionsAll) { 145 TEST_F(ProfileResetterTest, ResetExtensionsAll) {
146 // mock_object_ is a StrictMock, so we verify that it is called only once. 146 // mock_object_ is a StrictMock, so we verify that it is called only once.
147 resetter_->Reset( 147 resetter_->Reset(
148 ProfileResetter::ALL, 148 ProfileResetter::ALL,
149 ProfileResetter::UNINSTALL_EXTENSIONS, 149 ProfileResetter::UNINSTALL_EXTENSIONS,
150 base::Bind(&MockObject::StopLoop, base::Unretained(&mock_object_))); 150 base::Bind(&MockObject::StopLoop, base::Unretained(&mock_object_)));
151 mock_object_.RunLoop(); 151 mock_object_.RunLoop();
152 } 152 }
153 153
154 } // namespace 154 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/printing/print_view_manager.cc ('k') | chrome/browser/profiles/off_the_record_profile_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698