| 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/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
| 6 #include "chrome/browser/search_engines/template_url.h" | 6 #include "chrome/browser/search_engines/template_url.h" |
| 7 #include "chrome/browser/search_engines/template_url_service.h" | 7 #include "chrome/browser/search_engines/template_url_service.h" |
| 8 #include "chrome/browser/search_engines/template_url_service_factory.h" | 8 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 9 #include "chrome/browser/sync/profile_sync_service_harness.h" | 9 #include "chrome/browser/sync/profile_sync_service_harness.h" |
| 10 #include "chrome/browser/sync/test/integration/search_engines_helper.h" | 10 #include "chrome/browser/sync/test/integration/search_engines_helper.h" |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 // TCM ID - 9004196. | 138 // TCM ID - 9004196. |
| 139 IN_PROC_BROWSER_TEST_F(TwoClientSearchEnginesSyncTest, ConflictKeyword) { | 139 IN_PROC_BROWSER_TEST_F(TwoClientSearchEnginesSyncTest, ConflictKeyword) { |
| 140 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 140 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 141 DisableVerifier(); | 141 DisableVerifier(); |
| 142 ASSERT_TRUE(search_engines_helper::AllServicesMatch()); | 142 ASSERT_TRUE(search_engines_helper::AllServicesMatch()); |
| 143 | 143 |
| 144 // Add a different search engine to each client, but make their keywords | 144 // Add a different search engine to each client, but make their keywords |
| 145 // conflict. | 145 // conflict. |
| 146 search_engines_helper::AddSearchEngine(0, 0); | 146 search_engines_helper::AddSearchEngine(0, 0); |
| 147 search_engines_helper::AddSearchEngine(1, 1); | 147 search_engines_helper::AddSearchEngine(1, 1); |
| 148 TemplateURLService* service = search_engines_helper::GetServiceForProfile(1); | 148 TemplateURLService* service = search_engines_helper::GetServiceForBrowserConte
xt(1); |
| 149 TemplateURL* turl = service->GetTemplateURLForKeyword(ASCIIToUTF16("test1")); | 149 TemplateURL* turl = service->GetTemplateURLForKeyword(ASCIIToUTF16("test1")); |
| 150 EXPECT_TRUE(turl); | 150 EXPECT_TRUE(turl); |
| 151 service->ResetTemplateURL(turl, turl->short_name(), ASCIIToUTF16("test0"), | 151 service->ResetTemplateURL(turl, turl->short_name(), ASCIIToUTF16("test0"), |
| 152 turl->url()); | 152 turl->url()); |
| 153 | 153 |
| 154 ASSERT_TRUE(AwaitQuiescence()); | 154 ASSERT_TRUE(AwaitQuiescence()); |
| 155 ASSERT_TRUE(search_engines_helper::AllServicesMatch()); | 155 ASSERT_TRUE(search_engines_helper::AllServicesMatch()); |
| 156 } | 156 } |
| 157 | 157 |
| 158 // TCM ID - 9004187. | 158 // TCM ID - 9004187. |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 229 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 230 ASSERT_TRUE(search_engines_helper::AllServicesMatch()); | 230 ASSERT_TRUE(search_engines_helper::AllServicesMatch()); |
| 231 | 231 |
| 232 // Change the default on the first client and delete the old default. | 232 // Change the default on the first client and delete the old default. |
| 233 search_engines_helper::ChangeDefaultSearchProvider(0, 1); | 233 search_engines_helper::ChangeDefaultSearchProvider(0, 1); |
| 234 search_engines_helper::DeleteSearchEngineBySeed(0, 0); | 234 search_engines_helper::DeleteSearchEngineBySeed(0, 0); |
| 235 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 235 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 236 | 236 |
| 237 ASSERT_TRUE(search_engines_helper::AllServicesMatch()); | 237 ASSERT_TRUE(search_engines_helper::AllServicesMatch()); |
| 238 } | 238 } |
| OLD | NEW |