1 // Copyright 2014 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 CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_FACTORY_TEST_UTIL_H_
6 #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_FACTORY_TEST_UTIL_H_
10 #include "base/basictypes.h"
12 class TemplateURLService
;
15 // TemplateURLServiceFactoryTestUtil initializes TemplateURLServiceFactory to
16 // return a valid TemplateURLService instance for the given profile.
17 class TemplateURLServiceFactoryTestUtil
{
19 explicit TemplateURLServiceFactoryTestUtil(TestingProfile
* profile
);
20 virtual ~TemplateURLServiceFactoryTestUtil();
22 // Makes sure the load was successful.
25 // Set the managed preferences for the default search provider and trigger
26 // notification. If |alternate_url| is empty, uses an empty list of alternate
27 // URLs, otherwise use a list containing a single entry.
28 void SetManagedDefaultSearchPreferences(
30 const std::string
& name
,
31 const std::string
& keyword
,
32 const std::string
& search_url
,
33 const std::string
& suggest_url
,
34 const std::string
& icon_url
,
35 const std::string
& encodings
,
36 const std::string
& alternate_url
,
37 const std::string
& search_terms_replacement_key
);
39 // Remove all the managed preferences for the default search provider and
40 // trigger notification.
41 void RemoveManagedDefaultSearchPreferences();
43 // Returns the TemplateURLService.
44 TemplateURLService
* model() const;
47 TestingProfile
* profile_
;
49 DISALLOW_COPY_AND_ASSIGN(TemplateURLServiceFactoryTestUtil
);
52 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_FACTORY_TEST_UTIL_H_