Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2292)

Side by Side Diff: chrome/browser/sync/profile_sync_service_autofill_unittest.cc

Issue 9232011: sync: Make ProfileSyncService a ProfileKeyedService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <set> 5 #include <set>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 profile_.ResetRequestContext(); 394 profile_.ResetRequestContext();
395 AbstractProfileSyncServiceTest::TearDown(); 395 AbstractProfileSyncServiceTest::TearDown();
396 } 396 }
397 397
398 void StartSyncService(const base::Closure& callback, 398 void StartSyncService(const base::Closure& callback,
399 bool will_fail_association, 399 bool will_fail_association,
400 syncable::ModelType type) { 400 syncable::ModelType type) {
401 AbstractAutofillFactory* factory = GetFactory(type); 401 AbstractAutofillFactory* factory = GetFactory(type);
402 SigninManager* signin = new SigninManager(); 402 SigninManager* signin = new SigninManager();
403 signin->SetAuthenticatedUsername("test_user"); 403 signin->SetAuthenticatedUsername("test_user");
404 ProfileSyncComponentsFactoryMock* components_factory =
405 new ProfileSyncComponentsFactoryMock();
404 service_.reset( 406 service_.reset(
405 new TestProfileSyncService(&factory_, 407 new TestProfileSyncService(components_factory,
406 &profile_, 408 &profile_,
407 signin, 409 signin,
408 ProfileSyncService::AUTO_START, 410 ProfileSyncService::AUTO_START,
409 false, 411 false,
410 callback)); 412 callback));
411 EXPECT_CALL(profile_, GetProfileSyncService()).WillRepeatedly( 413 EXPECT_CALL(profile_, GetProfileSyncService()).WillRepeatedly(
412 Return(service_.get())); 414 Return(service_.get()));
413 DataTypeController* data_type_controller = 415 DataTypeController* data_type_controller =
414 factory->CreateDataTypeController(&factory_, 416 factory->CreateDataTypeController(components_factory,
415 &profile_, 417 &profile_,
416 service_.get()); 418 service_.get());
417 SyncBackendHostForProfileSyncTest:: 419 SyncBackendHostForProfileSyncTest::
418 SetDefaultExpectationsForWorkerCreation(&profile_); 420 SetDefaultExpectationsForWorkerCreation(&profile_);
419 421
420 factory->SetExpectation(&factory_, 422 factory->SetExpectation(components_factory,
421 service_.get(), 423 service_.get(),
422 web_data_service_.get(), 424 web_data_service_.get(),
423 data_type_controller); 425 data_type_controller);
424 426
425 EXPECT_CALL(factory_, CreateDataTypeManager(_, _)). 427 EXPECT_CALL(*components_factory, CreateDataTypeManager(_, _)).
426 WillOnce(ReturnNewDataTypeManager()); 428 WillOnce(ReturnNewDataTypeManager());
427 429
428 EXPECT_CALL(*personal_data_manager_, IsDataLoaded()). 430 EXPECT_CALL(*personal_data_manager_, IsDataLoaded()).
429 WillRepeatedly(Return(true)); 431 WillRepeatedly(Return(true));
430 432
431 // We need tokens to get the tests going 433 // We need tokens to get the tests going
432 token_service_->IssueAuthTokenForTest(GaiaConstants::kSyncService, "token"); 434 token_service_->IssueAuthTokenForTest(GaiaConstants::kSyncService, "token");
433 435
434 EXPECT_CALL(profile_, GetTokenService()). 436 EXPECT_CALL(profile_, GetTokenService()).
435 WillRepeatedly(Return(token_service_.get())); 437 WillRepeatedly(Return(token_service_.get()));
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
1236 std::vector<AutofillEntry> sync_entries; 1238 std::vector<AutofillEntry> sync_entries;
1237 std::vector<AutofillProfile> sync_profiles; 1239 std::vector<AutofillProfile> sync_profiles;
1238 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); 1240 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles));
1239 EXPECT_EQ(3U, sync_entries.size()); 1241 EXPECT_EQ(3U, sync_entries.size());
1240 EXPECT_EQ(0U, sync_profiles.size()); 1242 EXPECT_EQ(0U, sync_profiles.size());
1241 for (size_t i = 0; i < sync_entries.size(); i++) { 1243 for (size_t i = 0; i < sync_entries.size(); i++) {
1242 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() 1244 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name()
1243 << ", " << sync_entries[i].key().value(); 1245 << ", " << sync_entries[i].key().value();
1244 } 1246 }
1245 } 1247 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service.cc ('k') | chrome/browser/sync/profile_sync_service_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698