| 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/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/time.h" | 8 #include "base/time.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/search_engines/search_terms_data.h" | 10 #include "chrome/browser/search_engines/search_terms_data.h" |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 } | 324 } |
| 325 EXPECT_EQ(0U, map2.size()); | 325 EXPECT_EQ(0U, map2.size()); |
| 326 } | 326 } |
| 327 | 327 |
| 328 syncer::SyncChange TemplateURLServiceSyncTest::CreateTestSyncChange( | 328 syncer::SyncChange TemplateURLServiceSyncTest::CreateTestSyncChange( |
| 329 syncer::SyncChange::SyncChangeType type, | 329 syncer::SyncChange::SyncChangeType type, |
| 330 TemplateURL* turl) const { | 330 TemplateURL* turl) const { |
| 331 // We take control of the TemplateURL so make sure it's cleaned up after | 331 // We take control of the TemplateURL so make sure it's cleaned up after |
| 332 // we create data out of it. | 332 // we create data out of it. |
| 333 scoped_ptr<TemplateURL> scoped_turl(turl); | 333 scoped_ptr<TemplateURL> scoped_turl(turl); |
| 334 return syncer::SyncChange(type, | 334 return syncer::SyncChange( |
| 335 FROM_HERE, |
| 336 type, |
| 335 TemplateURLService::CreateSyncDataFromTemplateURL(*scoped_turl)); | 337 TemplateURLService::CreateSyncDataFromTemplateURL(*scoped_turl)); |
| 336 } | 338 } |
| 337 | 339 |
| 338 syncer::SyncDataList TemplateURLServiceSyncTest::CreateInitialSyncData() const { | 340 syncer::SyncDataList TemplateURLServiceSyncTest::CreateInitialSyncData() const { |
| 339 syncer::SyncDataList list; | 341 syncer::SyncDataList list; |
| 340 | 342 |
| 341 scoped_ptr<TemplateURL> turl(CreateTestTemplateURL(ASCIIToUTF16("key1"), | 343 scoped_ptr<TemplateURL> turl(CreateTestTemplateURL(ASCIIToUTF16("key1"), |
| 342 "http://key1.com", "key1", 90)); | 344 "http://key1.com", "key1", 90)); |
| 343 list.push_back(TemplateURLService::CreateSyncDataFromTemplateURL(*turl)); | 345 list.push_back(TemplateURLService::CreateSyncDataFromTemplateURL(*turl)); |
| 344 turl.reset(CreateTestTemplateURL(ASCIIToUTF16("key2"), "http://key2.com", | 346 turl.reset(CreateTestTemplateURL(ASCIIToUTF16("key2"), "http://key2.com", |
| (...skipping 1641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1986 // A local change to the Google base URL should update the keyword and | 1988 // A local change to the Google base URL should update the keyword and |
| 1987 // generate a sync change. | 1989 // generate a sync change. |
| 1988 test_util_a_.SetGoogleBaseURL(GURL("http://google.co.in/")); | 1990 test_util_a_.SetGoogleBaseURL(GURL("http://google.co.in/")); |
| 1989 EXPECT_EQ(ASCIIToUTF16("google.co.in"), synced_turl->keyword()); | 1991 EXPECT_EQ(ASCIIToUTF16("google.co.in"), synced_turl->keyword()); |
| 1990 EXPECT_EQ(1U, processor()->change_list_size()); | 1992 EXPECT_EQ(1U, processor()->change_list_size()); |
| 1991 ASSERT_TRUE(processor()->contains_guid("guid")); | 1993 ASSERT_TRUE(processor()->contains_guid("guid")); |
| 1992 syncer::SyncChange change(processor()->change_for_guid("guid")); | 1994 syncer::SyncChange change(processor()->change_for_guid("guid")); |
| 1993 EXPECT_EQ(syncer::SyncChange::ACTION_UPDATE, change.change_type()); | 1995 EXPECT_EQ(syncer::SyncChange::ACTION_UPDATE, change.change_type()); |
| 1994 EXPECT_EQ("google.co.in", GetKeyword(change.sync_data())); | 1996 EXPECT_EQ("google.co.in", GetKeyword(change.sync_data())); |
| 1995 } | 1997 } |
| OLD | NEW |