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

Side by Side Diff: components/webdata/common/web_data_service_test_util.h

Issue 364343002: Kill WebDataService, move (WIN only) Password code into separate class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments and clean up Created 6 years, 5 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef COMPONENTS_WEBDATA_COMMON_WEB_DATA_SERVICE_TEST_UTIL_H__ 5 #ifndef COMPONENTS_WEBDATA_COMMON_WEB_DATA_SERVICE_TEST_UTIL_H__
6 #define COMPONENTS_WEBDATA_COMMON_WEB_DATA_SERVICE_TEST_UTIL_H__ 6 #define COMPONENTS_WEBDATA_COMMON_WEB_DATA_SERVICE_TEST_UTIL_H__
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "chrome/browser/webdata/web_data_service.h"
11 #include "chrome/browser/webdata/web_data_service_factory.h" 10 #include "chrome/browser/webdata/web_data_service_factory.h"
12 #include "components/signin/core/browser/webdata/token_web_data.h" 11 #include "components/signin/core/browser/webdata/token_web_data.h"
13 12
14 // Base class for mocks of WebDataService, that does nothing in 13 // Base class for mocks of WebDataService, that does nothing in
15 // Shutdown(). 14 // Shutdown().
16 class MockWebDataServiceWrapperBase : public WebDataServiceWrapper { 15 class MockWebDataServiceWrapperBase : public WebDataServiceWrapper {
17 public: 16 public:
18 MockWebDataServiceWrapperBase(); 17 MockWebDataServiceWrapperBase();
19 virtual ~MockWebDataServiceWrapperBase(); 18 virtual ~MockWebDataServiceWrapperBase();
20 19
21 virtual void Shutdown() OVERRIDE; 20 virtual void Shutdown() OVERRIDE;
22 21
23 private: 22 private:
24 DISALLOW_COPY_AND_ASSIGN(MockWebDataServiceWrapperBase); 23 DISALLOW_COPY_AND_ASSIGN(MockWebDataServiceWrapperBase);
25 }; 24 };
26 25
27 // Pass your fake WebDataService in the constructor and this will 26 // Pass your fake WebDataService in the constructor and this will
28 // serve it up via GetWebData(). 27 // serve it up via GetWebData().
29 class MockWebDataServiceWrapper : public MockWebDataServiceWrapperBase { 28 class MockWebDataServiceWrapper : public MockWebDataServiceWrapperBase {
30 public: 29 public:
31 MockWebDataServiceWrapper( 30 MockWebDataServiceWrapper(
32 scoped_refptr<WebDataService> fake_service,
33 scoped_refptr<autofill::AutofillWebDataService> fake_autofill, 31 scoped_refptr<autofill::AutofillWebDataService> fake_autofill,
34 scoped_refptr<TokenWebData> fake_token); 32 scoped_refptr<TokenWebData> fake_token);
35 33
36 virtual ~MockWebDataServiceWrapper(); 34 virtual ~MockWebDataServiceWrapper();
37 35
38 virtual scoped_refptr<autofill::AutofillWebDataService> 36 virtual scoped_refptr<autofill::AutofillWebDataService>
39 GetAutofillWebData() OVERRIDE; 37 GetAutofillWebData() OVERRIDE;
40 38
41 virtual scoped_refptr<TokenWebData> GetTokenWebData() OVERRIDE; 39 virtual scoped_refptr<TokenWebData> GetTokenWebData() OVERRIDE;
42 40
43 virtual scoped_refptr<WebDataService> GetWebData() OVERRIDE;
44
45 protected: 41 protected:
46 scoped_refptr<autofill::AutofillWebDataService> fake_autofill_web_data_; 42 scoped_refptr<autofill::AutofillWebDataService> fake_autofill_web_data_;
47 scoped_refptr<TokenWebData> fake_token_web_data_; 43 scoped_refptr<TokenWebData> fake_token_web_data_;
48 scoped_refptr<WebDataService> fake_web_data_;
49 44
50 private: 45 private:
51 DISALLOW_COPY_AND_ASSIGN(MockWebDataServiceWrapper); 46 DISALLOW_COPY_AND_ASSIGN(MockWebDataServiceWrapper);
52 }; 47 };
53 48
54 #endif // COMPONENTS_WEBDATA_COMMON_WEB_DATA_SERVICE_TEST_UTIL_H__ 49 #endif // COMPONENTS_WEBDATA_COMMON_WEB_DATA_SERVICE_TEST_UTIL_H__
OLDNEW
« no previous file with comments | « components/webdata/common/web_data_request_manager.h ('k') | components/webdata/common/web_data_service_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698