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

Side by Side Diff: components/search_engines/search_engines_test_util.cc

Issue 2639153002: Make extensions DSE persistent in browser prefs (Reland) (Closed)
Patch Set: Minor fix after review, round 7 Created 3 years, 9 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #include "components/search_engines/search_engines_test_util.h" 5 #include "components/search_engines/search_engines_test_util.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "components/search_engines/default_search_manager.h" 10 #include "components/search_engines/default_search_manager.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 EXPECT_EQ(expected->search_url_post_params, actual->search_url_post_params); 47 EXPECT_EQ(expected->search_url_post_params, actual->search_url_post_params);
48 EXPECT_EQ(expected->suggestions_url_post_params, 48 EXPECT_EQ(expected->suggestions_url_post_params,
49 actual->suggestions_url_post_params); 49 actual->suggestions_url_post_params);
50 EXPECT_EQ(expected->instant_url_post_params, actual->instant_url_post_params); 50 EXPECT_EQ(expected->instant_url_post_params, actual->instant_url_post_params);
51 EXPECT_EQ(expected->image_url_post_params, actual->image_url_post_params); 51 EXPECT_EQ(expected->image_url_post_params, actual->image_url_post_params);
52 52
53 EXPECT_EQ(expected->favicon_url, actual->favicon_url); 53 EXPECT_EQ(expected->favicon_url, actual->favicon_url);
54 EXPECT_EQ(expected->safe_for_autoreplace, actual->safe_for_autoreplace); 54 EXPECT_EQ(expected->safe_for_autoreplace, actual->safe_for_autoreplace);
55 EXPECT_EQ(expected->input_encodings, actual->input_encodings); 55 EXPECT_EQ(expected->input_encodings, actual->input_encodings);
56 EXPECT_EQ(expected->alternate_urls, actual->alternate_urls); 56 EXPECT_EQ(expected->alternate_urls, actual->alternate_urls);
57 EXPECT_EQ(expected->search_terms_replacement_key, 57 EXPECT_TRUE(TemplateURL::SearchTermsReplacementKeysMatch(
58 actual->search_terms_replacement_key); 58 expected->search_terms_replacement_key,
59 actual->search_terms_replacement_key));
59 } 60 }
60 61
61 void SetExtensionDefaultSearchInPrefs( 62 void SetExtensionDefaultSearchInPrefs(
62 sync_preferences::TestingPrefServiceSyncable* prefs, 63 sync_preferences::TestingPrefServiceSyncable* prefs,
63 const TemplateURLData& data) { 64 const TemplateURLData& data) {
64 std::unique_ptr<base::DictionaryValue> entry = 65 std::unique_ptr<base::DictionaryValue> entry =
65 TemplateURLDataToDictionary(data); 66 TemplateURLDataToDictionary(data);
66 prefs->SetExtensionPref( 67 prefs->SetExtensionPref(
67 DefaultSearchManager::kDefaultSearchProviderDataPrefName, 68 DefaultSearchManager::kDefaultSearchProviderDataPrefName,
68 entry.release()); 69 entry.release());
69 } 70 }
70 71
71 void RemoveExtensionDefaultSearchFromPrefs( 72 void RemoveExtensionDefaultSearchFromPrefs(
72 sync_preferences::TestingPrefServiceSyncable* prefs) { 73 sync_preferences::TestingPrefServiceSyncable* prefs) {
73 prefs->RemoveExtensionPref( 74 prefs->RemoveExtensionPref(
74 DefaultSearchManager::kDefaultSearchProviderDataPrefName); 75 DefaultSearchManager::kDefaultSearchProviderDataPrefName);
75 } 76 }
OLDNEW
« no previous file with comments | « components/search_engines/default_search_manager_unittest.cc ('k') | components/search_engines/template_url.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698