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/sync/profile_sync_service_harness.h" | 8 #include "chrome/browser/sync/profile_sync_service_harness.h" |
9 #include "chrome/browser/sync/test/integration/search_engines_helper.h" | 9 #include "chrome/browser/sync/test/integration/search_engines_helper.h" |
10 #include "chrome/browser/sync/test/integration/sync_test.h" | 10 #include "chrome/browser/sync/test/integration/sync_test.h" |
11 | 11 |
12 using search_engines_helper::AddSearchEngine; | 12 using search_engines_helper::AddSearchEngine; |
13 using search_engines_helper::AllServicesMatch; | 13 using search_engines_helper::AllServicesMatch; |
14 using search_engines_helper::ChangeDefaultSearchProvider; | 14 using search_engines_helper::ChangeDefaultSearchProvider; |
15 using search_engines_helper::CreateTestTemplateURL; | 15 using search_engines_helper::CreateTestTemplateURL; |
16 using search_engines_helper::DeleteSearchEngineByKeyword; | |
17 using search_engines_helper::DeleteSearchEngineBySeed; | 16 using search_engines_helper::DeleteSearchEngineBySeed; |
18 using search_engines_helper::EditSearchEngine; | 17 using search_engines_helper::EditSearchEngine; |
19 using search_engines_helper::GetServiceForProfile; | 18 using search_engines_helper::GetServiceForProfile; |
20 using search_engines_helper::GetVerifierService; | 19 using search_engines_helper::GetVerifierService; |
21 using search_engines_helper::ServiceMatchesVerifier; | 20 using search_engines_helper::ServiceMatchesVerifier; |
22 | 21 |
23 class TwoClientSearchEnginesSyncTest : public SyncTest { | 22 class TwoClientSearchEnginesSyncTest : public SyncTest { |
24 public: | 23 public: |
25 TwoClientSearchEnginesSyncTest() : SyncTest(TWO_CLIENT) {} | 24 TwoClientSearchEnginesSyncTest() : SyncTest(TWO_CLIENT) {} |
26 virtual ~TwoClientSearchEnginesSyncTest() {} | 25 virtual ~TwoClientSearchEnginesSyncTest() {} |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 // client0: { SE0, SE1, SE2 } | 170 // client0: { SE0, SE1, SE2 } |
172 for (int i = 0; i < 3; ++i) { | 171 for (int i = 0; i < 3; ++i) { |
173 AddSearchEngine(0, i); | 172 AddSearchEngine(0, i); |
174 } | 173 } |
175 | 174 |
176 // client1: { SE0, SE2, SE3, SE0 + different URL } | 175 // client1: { SE0, SE2, SE3, SE0 + different URL } |
177 AddSearchEngine(1, 0); | 176 AddSearchEngine(1, 0); |
178 AddSearchEngine(1, 2); | 177 AddSearchEngine(1, 2); |
179 AddSearchEngine(1, 3); | 178 AddSearchEngine(1, 3); |
180 GetServiceForProfile(1)->Add(CreateTestTemplateURL(0, | 179 GetServiceForProfile(1)->Add(CreateTestTemplateURL(0, |
181 "http://www.somethingelse.com/", ASCIIToUTF16("somethingelse.com"), | 180 ASCIIToUTF16("somethingelse.com"), "http://www.somethingelse.com/", |
182 "somethingelse")); | 181 "somethingelse")); |
183 | 182 |
184 ASSERT_TRUE(AwaitQuiescence()); | 183 ASSERT_TRUE(AwaitQuiescence()); |
185 ASSERT_TRUE(AllServicesMatch()); | 184 ASSERT_TRUE(AllServicesMatch()); |
186 } | 185 } |
187 | 186 |
188 // TCM ID - 8906436. | 187 // TCM ID - 8906436. |
189 IN_PROC_BROWSER_TEST_F(TwoClientSearchEnginesSyncTest, DisableSync) { | 188 IN_PROC_BROWSER_TEST_F(TwoClientSearchEnginesSyncTest, DisableSync) { |
190 ASSERT_TRUE(SetupSync()); | 189 ASSERT_TRUE(SetupSync()); |
191 ASSERT_TRUE(AllServicesMatch()); | 190 ASSERT_TRUE(AllServicesMatch()); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 232 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
234 ASSERT_TRUE(AllServicesMatch()); | 233 ASSERT_TRUE(AllServicesMatch()); |
235 | 234 |
236 // Change the default on the first client and delete the old default. | 235 // Change the default on the first client and delete the old default. |
237 ChangeDefaultSearchProvider(0, 1); | 236 ChangeDefaultSearchProvider(0, 1); |
238 DeleteSearchEngineBySeed(0, 0); | 237 DeleteSearchEngineBySeed(0, 0); |
239 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 238 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
240 | 239 |
241 ASSERT_TRUE(AllServicesMatch()); | 240 ASSERT_TRUE(AllServicesMatch()); |
242 } | 241 } |
OLD | NEW |