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

Side by Side Diff: chrome/browser/profile_resetter/profile_resetter_test_base.h

Issue 17274006: Reset profile: reset cookies and site data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits 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
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_PROFILE_RESETTER_PROFILE_RESETTER_TEST_BASE_H_
6 #define CHROME_BROWSER_PROFILE_RESETTER_PROFILE_RESETTER_TEST_BASE_H_
7
8 #include "content/public/test/test_utils.h"
9 #include "testing/gmock/include/gmock/gmock.h"
10
11 class ProfileResetter;
12
13 // The ProfileResetterMockObject is used to block the thread until
14 // ProfileResetter::Reset has completed:
15
16 // ProfileResetterMockObject mock_object;
17 // resetter_->Reset(ProfileResetter::ALL,
18 // base::Bind(&ProfileResetterMockObject::StopLoop,
19 // base::Unretained(&mock_object)));
20 // mock_object.RunLoop();
21 class ProfileResetterMockObject {
22 public:
23 ProfileResetterMockObject();
24 ~ProfileResetterMockObject();
25
26 void RunLoop();
27 void StopLoop();
28
29 private:
30 MOCK_METHOD0(Callback, void(void));
31
32 scoped_refptr<content::MessageLoopRunner> runner_;
33
34 DISALLOW_COPY_AND_ASSIGN(ProfileResetterMockObject);
35 };
36
37 // Base class for all ProfileResetter unit tests.
38 class ProfileResetterTestBase {
39 public:
40 ProfileResetterTestBase();
41 ~ProfileResetterTestBase();
42
43 protected:
44 testing::StrictMock<ProfileResetterMockObject> mock_object_;
45 scoped_ptr<ProfileResetter> resetter_;
46
47 private:
48 DISALLOW_COPY_AND_ASSIGN(ProfileResetterTestBase);
49 };
50
51 #endif // CHROME_BROWSER_PROFILE_RESETTER_PROFILE_RESETTER_TEST_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698