| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |