Chromium Code Reviews| Index: components/search_engines/search_engines_test_util.h |
| diff --git a/components/search_engines/search_engines_test_util.h b/components/search_engines/search_engines_test_util.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7ddcd50d52f854042098eeeda8ca4da9c1002b58 |
| --- /dev/null |
| +++ b/components/search_engines/search_engines_test_util.h |
| @@ -0,0 +1,38 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_SEARCH_ENGINES_SEARCH_ENGINES_TEST_UTIL_H_ |
| +#define COMPONENTS_SEARCH_ENGINES_SEARCH_ENGINES_TEST_UTIL_H_ |
| + |
| +#include <memory> |
| +#include <string> |
| + |
| +struct TemplateURLData; |
| + |
| +namespace sync_preferences { |
| +class TestingPrefServiceSyncable; |
| +} |
| + |
| +// Generates a TemplateURLData structure useful for tests filled with values |
| +// autogenerated from |provider_name|. |
| +std::unique_ptr<TemplateURLData> GenerateDummyTemplateURLData( |
|
Peter Kasting
2017/02/07 00:42:45
Are you going to eliminate the identically-named f
Alexander Yashkin
2017/02/07 08:09:20
Created https://codereview.chromium.org/2686453002
|
| + const std::string& provider_name); |
| + |
| +// Checks that the two TemplateURLs are similar. Does not check the id, the |
| +// date_created or the last_modified time. Neither pointer should be null. |
| +void ExpectSimilar(const TemplateURLData* expected, |
| + const TemplateURLData* actual); |
| + |
| +// Writes default search engine |extension_data| into the extension-controlled |
| +// preference in |prefs|. |
| +void SetExtensionDefaultSearchInPrefs( |
| + sync_preferences::TestingPrefServiceSyncable* prefs, |
| + const TemplateURLData& extension_data); |
| + |
| +// Removes the extension-controlled default search engine preference from |
| +// |prefs|. |
| +void RemoveExtensionDefaultSearchFromPrefs( |
| + sync_preferences::TestingPrefServiceSyncable* prefs); |
| + |
| +#endif // COMPONENTS_SEARCH_ENGINES_SEARCH_ENGINES_TEST_UTIL_H_ |