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

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

Issue 148513010: Eliminate ProfileOAuth2TokenService being a BCKS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Response to review Created 6 years, 10 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/bind_helpers.h" 12 #include "base/bind_helpers.h"
13 #include "base/callback.h" 13 #include "base/callback.h"
14 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
15 #include "base/location.h" 15 #include "base/location.h"
16 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
17 #include "base/memory/scoped_ptr.h" 17 #include "base/memory/scoped_ptr.h"
18 #include "base/message_loop/message_loop.h" 18 #include "base/message_loop/message_loop.h"
19 #include "base/strings/string16.h" 19 #include "base/strings/string16.h"
20 #include "base/strings/utf_string_conversions.h" 20 #include "base/strings/utf_string_conversions.h"
21 #include "base/synchronization/waitable_event.h" 21 #include "base/synchronization/waitable_event.h"
22 #include "base/time/time.h" 22 #include "base/time/time.h"
23 #include "chrome/browser/autofill/personal_data_manager_factory.h" 23 #include "chrome/browser/autofill/personal_data_manager_factory.h"
24 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h" 24 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h"
25 #include "chrome/browser/signin/fake_profile_oauth2_token_service_wrapper.h"
25 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" 26 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
26 #include "chrome/browser/signin/signin_manager.h" 27 #include "chrome/browser/signin/signin_manager.h"
27 #include "chrome/browser/signin/signin_manager_factory.h" 28 #include "chrome/browser/signin/signin_manager_factory.h"
28 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" 29 #include "chrome/browser/sync/abstract_profile_sync_service_test.h"
29 #include "chrome/browser/sync/glue/autofill_data_type_controller.h" 30 #include "chrome/browser/sync/glue/autofill_data_type_controller.h"
30 #include "chrome/browser/sync/glue/autofill_profile_data_type_controller.h" 31 #include "chrome/browser/sync/glue/autofill_profile_data_type_controller.h"
31 #include "chrome/browser/sync/glue/generic_change_processor.h" 32 #include "chrome/browser/sync/glue/generic_change_processor.h"
32 #include "chrome/browser/sync/glue/shared_change_processor.h" 33 #include "chrome/browser/sync/glue/shared_change_processor.h"
33 #include "chrome/browser/sync/profile_sync_components_factory.h" 34 #include "chrome/browser/sync/profile_sync_components_factory.h"
34 #include "chrome/browser/sync/profile_sync_service.h" 35 #include "chrome/browser/sync/profile_sync_service.h"
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 NOTREACHED(); 507 NOTREACHED();
507 return NULL; 508 return NULL;
508 } 509 }
509 } 510 }
510 511
511 virtual void SetUp() OVERRIDE { 512 virtual void SetUp() OVERRIDE {
512 AbstractProfileSyncServiceTest::SetUp(); 513 AbstractProfileSyncServiceTest::SetUp();
513 TestingProfile::Builder builder; 514 TestingProfile::Builder builder;
514 builder.AddTestingFactory( 515 builder.AddTestingFactory(
515 ProfileOAuth2TokenServiceFactory::GetInstance(), 516 ProfileOAuth2TokenServiceFactory::GetInstance(),
516 FakeProfileOAuth2TokenService::BuildAutoIssuingTokenService); 517 FakeProfileOAuth2TokenServiceWrapper::BuildAutoIssuingTokenService);
517 profile_ = builder.Build().Pass(); 518 profile_ = builder.Build().Pass();
518 web_database_.reset(new WebDatabaseFake(&autofill_table_)); 519 web_database_.reset(new WebDatabaseFake(&autofill_table_));
519 MockWebDataServiceWrapper* wrapper = 520 MockWebDataServiceWrapper* wrapper =
520 static_cast<MockWebDataServiceWrapper*>( 521 static_cast<MockWebDataServiceWrapper*>(
521 WebDataServiceFactory::GetInstance()->SetTestingFactoryAndUse( 522 WebDataServiceFactory::GetInstance()->SetTestingFactoryAndUse(
522 profile_.get(), BuildMockWebDataServiceWrapper)); 523 profile_.get(), BuildMockWebDataServiceWrapper));
523 web_data_service_ = 524 web_data_service_ =
524 static_cast<WebDataServiceFake*>(wrapper->GetAutofillWebData().get()); 525 static_cast<WebDataServiceFake*>(wrapper->GetAutofillWebData().get());
525 web_data_service_->SetDatabase(web_database_.get()); 526 web_data_service_->SetDatabase(web_database_.get());
526 527
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after
1413 std::vector<AutofillEntry> sync_entries; 1414 std::vector<AutofillEntry> sync_entries;
1414 std::vector<AutofillProfile> sync_profiles; 1415 std::vector<AutofillProfile> sync_profiles;
1415 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); 1416 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles));
1416 EXPECT_EQ(3U, sync_entries.size()); 1417 EXPECT_EQ(3U, sync_entries.size());
1417 EXPECT_EQ(0U, sync_profiles.size()); 1418 EXPECT_EQ(0U, sync_profiles.size());
1418 for (size_t i = 0; i < sync_entries.size(); i++) { 1419 for (size_t i = 0; i < sync_entries.size(); i++) {
1419 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() 1420 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name()
1420 << ", " << sync_entries[i].key().value(); 1421 << ", " << sync_entries[i].key().value();
1421 } 1422 }
1422 } 1423 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/signin_tracker_unittest.cc ('k') | chrome/browser/sync/profile_sync_service_password_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698