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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_WEBDATA_COMMON_WEB_DATA_SERVICE_TEST_UTIL_H__
6 #define COMPONENTS_WEBDATA_COMMON_WEB_DATA_SERVICE_TEST_UTIL_H__
8 #include "base/basictypes.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"
12 #include "components/signin/core/browser/webdata/token_web_data.h"
14 // Base class for mocks of WebDataService, that does nothing in
16 class MockWebDataServiceWrapperBase
: public WebDataServiceWrapper
{
18 MockWebDataServiceWrapperBase();
19 virtual ~MockWebDataServiceWrapperBase();
21 virtual void Shutdown() OVERRIDE
;
24 DISALLOW_COPY_AND_ASSIGN(MockWebDataServiceWrapperBase
);
27 // Pass your fake WebDataService in the constructor and this will
28 // serve it up via GetWebData().
29 class MockWebDataServiceWrapper
: public MockWebDataServiceWrapperBase
{
31 MockWebDataServiceWrapper(
32 scoped_refptr
<WebDataService
> fake_service
,
33 scoped_refptr
<autofill::AutofillWebDataService
> fake_autofill
,
34 scoped_refptr
<TokenWebData
> fake_token
);
36 virtual ~MockWebDataServiceWrapper();
38 virtual scoped_refptr
<autofill::AutofillWebDataService
>
39 GetAutofillWebData() OVERRIDE
;
41 virtual scoped_refptr
<TokenWebData
> GetTokenWebData() OVERRIDE
;
43 virtual scoped_refptr
<WebDataService
> GetWebData() OVERRIDE
;
46 scoped_refptr
<autofill::AutofillWebDataService
> fake_autofill_web_data_
;
47 scoped_refptr
<TokenWebData
> fake_token_web_data_
;
48 scoped_refptr
<WebDataService
> fake_web_data_
;
51 DISALLOW_COPY_AND_ASSIGN(MockWebDataServiceWrapper
);
54 #endif // COMPONENTS_WEBDATA_COMMON_WEB_DATA_SERVICE_TEST_UTIL_H__