| 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/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 146 |
| 147 | 147 |
| 148 // TemplateURLServiceSyncTest ------------------------------------------------- | 148 // TemplateURLServiceSyncTest ------------------------------------------------- |
| 149 | 149 |
| 150 class TemplateURLServiceSyncTest : public testing::Test { | 150 class TemplateURLServiceSyncTest : public testing::Test { |
| 151 public: | 151 public: |
| 152 typedef TemplateURLService::SyncDataMap SyncDataMap; | 152 typedef TemplateURLService::SyncDataMap SyncDataMap; |
| 153 | 153 |
| 154 TemplateURLServiceSyncTest(); | 154 TemplateURLServiceSyncTest(); |
| 155 | 155 |
| 156 virtual void SetUp() override; | 156 void SetUp() override; |
| 157 virtual void TearDown() override; | 157 void TearDown() override; |
| 158 | 158 |
| 159 TemplateURLService* model() { return test_util_a_->model(); } | 159 TemplateURLService* model() { return test_util_a_->model(); } |
| 160 // For readability, we redefine an accessor for Model A for use in tests that | 160 // For readability, we redefine an accessor for Model A for use in tests that |
| 161 // involve syncing two models. | 161 // involve syncing two models. |
| 162 TemplateURLService* model_a() { return test_util_a_->model(); } | 162 TemplateURLService* model_a() { return test_util_a_->model(); } |
| 163 TemplateURLService* model_b() { return test_util_b_->model(); } | 163 TemplateURLService* model_b() { return test_util_b_->model(); } |
| 164 TestingProfile* profile_a() { return test_util_a_->profile(); } | 164 TestingProfile* profile_a() { return test_util_a_->profile(); } |
| 165 TestChangeProcessor* processor() { return sync_processor_.get(); } | 165 TestChangeProcessor* processor() { return sync_processor_.get(); } |
| 166 scoped_ptr<syncer::SyncChangeProcessor> PassProcessor(); | 166 scoped_ptr<syncer::SyncChangeProcessor> PassProcessor(); |
| 167 scoped_ptr<syncer::SyncErrorFactory> CreateAndPassSyncErrorFactory(); | 167 scoped_ptr<syncer::SyncErrorFactory> CreateAndPassSyncErrorFactory(); |
| (...skipping 2063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2231 const char kNewGUID[] = "newdefault"; | 2231 const char kNewGUID[] = "newdefault"; |
| 2232 model()->Add(CreateTestTemplateURL(ASCIIToUTF16("what"), | 2232 model()->Add(CreateTestTemplateURL(ASCIIToUTF16("what"), |
| 2233 "http://thewhat.com/{searchTerms}", | 2233 "http://thewhat.com/{searchTerms}", |
| 2234 kNewGUID)); | 2234 kNewGUID)); |
| 2235 model()->SetUserSelectedDefaultSearchProvider( | 2235 model()->SetUserSelectedDefaultSearchProvider( |
| 2236 model()->GetTemplateURLForGUID(kNewGUID)); | 2236 model()->GetTemplateURLForGUID(kNewGUID)); |
| 2237 | 2237 |
| 2238 EXPECT_EQ(kNewGUID, profile_a()->GetTestingPrefService()->GetString( | 2238 EXPECT_EQ(kNewGUID, profile_a()->GetTestingPrefService()->GetString( |
| 2239 prefs::kSyncedDefaultSearchProviderGUID)); | 2239 prefs::kSyncedDefaultSearchProviderGUID)); |
| 2240 } | 2240 } |
| OLD | NEW |