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

Side by Side Diff: chrome/browser/search_engines/template_url_service_sync_unittest.cc

Issue 7669052: Added DataTypeController integration and UI surfacing for syncing Search Engines. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fixed notification registration. Created 9 years, 3 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 #include "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/string_util.h" 6 #include "base/string_util.h"
7 #include "base/time.h" 7 #include "base/time.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/search_engines/template_url.h" 9 #include "chrome/browser/search_engines/template_url.h"
10 #include "chrome/browser/search_engines/template_url_service.h" 10 #include "chrome/browser/search_engines/template_url_service.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 void AssertEquals(const TemplateURL& expected, 151 void AssertEquals(const TemplateURL& expected,
152 const TemplateURL& actual) const { 152 const TemplateURL& actual) const {
153 ASSERT_TRUE(TemplateURLRef::SameUrlRefs(expected.url(), actual.url())); 153 ASSERT_TRUE(TemplateURLRef::SameUrlRefs(expected.url(), actual.url()));
154 ASSERT_TRUE(TemplateURLRef::SameUrlRefs(expected.suggestions_url(), 154 ASSERT_TRUE(TemplateURLRef::SameUrlRefs(expected.suggestions_url(),
155 actual.suggestions_url())); 155 actual.suggestions_url()));
156 ASSERT_EQ(expected.keyword(), actual.keyword()); 156 ASSERT_EQ(expected.keyword(), actual.keyword());
157 ASSERT_EQ(expected.short_name(), actual.short_name()); 157 ASSERT_EQ(expected.short_name(), actual.short_name());
158 ASSERT_EQ(JoinString(expected.input_encodings(), ';'), 158 ASSERT_EQ(JoinString(expected.input_encodings(), ';'),
159 JoinString(actual.input_encodings(), ';')); 159 JoinString(actual.input_encodings(), ';'));
160 ASSERT_TRUE(expected.GetFaviconURL() == actual.GetFaviconURL()); 160 ASSERT_TRUE(expected.GetFaviconURL() == actual.GetFaviconURL());
161 ASSERT_EQ(expected.id(), actual.id());
162 ASSERT_EQ(expected.safe_for_autoreplace(), actual.safe_for_autoreplace()); 161 ASSERT_EQ(expected.safe_for_autoreplace(), actual.safe_for_autoreplace());
163 ASSERT_EQ(expected.show_in_default_list(), actual.show_in_default_list()); 162 ASSERT_EQ(expected.show_in_default_list(), actual.show_in_default_list());
164 ASSERT_TRUE(expected.date_created() == actual.date_created()); 163 ASSERT_TRUE(expected.date_created() == actual.date_created());
165 ASSERT_TRUE(expected.last_modified() == actual.last_modified()); 164 ASSERT_TRUE(expected.last_modified() == actual.last_modified());
166 } 165 }
167 166
168 // Expect that two SyncDataLists have equal contents, in terms of the 167 // Expect that two SyncDataLists have equal contents, in terms of the
169 // sync_guid, keyword, and url fields. 168 // sync_guid, keyword, and url fields.
170 void AssertEquals(const SyncDataList& data1, 169 void AssertEquals(const SyncDataList& data1,
171 const SyncDataList& data2) const { 170 const SyncDataList& data2) const {
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after
973 ASSERT_FALSE(error.IsSet()); 972 ASSERT_FALSE(error.IsSet());
974 973
975 SyncChangeList changes; 974 SyncChangeList changes;
976 changes.push_back(CreateTestSyncChange( 975 changes.push_back(CreateTestSyncChange(
977 SyncChange::ACTION_UPDATE, 976 SyncChange::ACTION_UPDATE,
978 CreateTestTemplateURL("newkeyword", "http://new.com", "key2"))); 977 CreateTestTemplateURL("newkeyword", "http://new.com", "key2")));
979 processor()->set_erroneous(true); 978 processor()->set_erroneous(true);
980 error = model()->ProcessSyncChanges(FROM_HERE, changes); 979 error = model()->ProcessSyncChanges(FROM_HERE, changes);
981 EXPECT_TRUE(error.IsSet()); 980 EXPECT_TRUE(error.IsSet());
982 } 981 }
OLDNEW
« no previous file with comments | « chrome/browser/search_engines/template_url_service.cc ('k') | chrome/browser/sync/glue/search_engine_data_type_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698