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

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

Issue 15701022: [Sync] Add support for sync Persistence Errors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move bookmark change into separate patch Created 7 years, 5 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/memory/scoped_vector.h" 6 #include "base/memory/scoped_vector.h"
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "chrome/browser/search_engines/search_terms_data.h" 10 #include "chrome/browser/search_engines/search_terms_data.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 } 117 }
118 118
119 TestChangeProcessor::~TestChangeProcessor() { 119 TestChangeProcessor::~TestChangeProcessor() {
120 } 120 }
121 121
122 syncer::SyncError TestChangeProcessor::ProcessSyncChanges( 122 syncer::SyncError TestChangeProcessor::ProcessSyncChanges(
123 const tracked_objects::Location& from_here, 123 const tracked_objects::Location& from_here,
124 const syncer::SyncChangeList& change_list) { 124 const syncer::SyncChangeList& change_list) {
125 if (erroneous_) 125 if (erroneous_)
126 return syncer::SyncError( 126 return syncer::SyncError(
127 FROM_HERE, "Some error.", syncer::SEARCH_ENGINES); 127 FROM_HERE,
128 syncer::SyncError::DATATYPE_ERROR,
129 "Some error.",
130 syncer::SEARCH_ENGINES);
128 131
129 change_map_.erase(change_map_.begin(), change_map_.end()); 132 change_map_.erase(change_map_.begin(), change_map_.end());
130 for (syncer::SyncChangeList::const_iterator iter = change_list.begin(); 133 for (syncer::SyncChangeList::const_iterator iter = change_list.begin();
131 iter != change_list.end(); ++iter) 134 iter != change_list.end(); ++iter)
132 change_map_[GetGUID(iter->sync_data())] = *iter; 135 change_map_[GetGUID(iter->sync_data())] = *iter;
133 return syncer::SyncError(); 136 return syncer::SyncError();
134 } 137 }
135 138
136 139
137 // SyncChangeProcessorDelegate ------------------------------------------------ 140 // SyncChangeProcessorDelegate ------------------------------------------------
(...skipping 2123 matching lines...) Expand 10 before | Expand all | Expand 10 after
2261 syncer::SyncMergeResult merge_result = model()->MergeDataAndStartSyncing( 2264 syncer::SyncMergeResult merge_result = model()->MergeDataAndStartSyncing(
2262 syncer::SEARCH_ENGINES, list, PassProcessor(), 2265 syncer::SEARCH_ENGINES, list, PassProcessor(),
2263 CreateAndPassSyncErrorFactory()); 2266 CreateAndPassSyncErrorFactory());
2264 2267
2265 const TemplateURL* result_turl = model()->GetTemplateURLForGUID("default"); 2268 const TemplateURL* result_turl = model()->GetTemplateURLForGUID("default");
2266 EXPECT_TRUE(result_turl); 2269 EXPECT_TRUE(result_turl);
2267 EXPECT_EQ(default_turl->keyword(), result_turl->keyword()); 2270 EXPECT_EQ(default_turl->keyword(), result_turl->keyword());
2268 EXPECT_EQ(default_turl->short_name(), result_turl->short_name()); 2271 EXPECT_EQ(default_turl->short_name(), result_turl->short_name());
2269 EXPECT_EQ(default_turl->url(), result_turl->url()); 2272 EXPECT_EQ(default_turl->url(), result_turl->url());
2270 } 2273 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698