OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/signin/ios/browser/account_consistency_service.h" | 5 #include "components/signin/ios/browser/account_consistency_service.h" |
6 | 6 |
7 #import <WebKit/WebKit.h> | 7 #import <WebKit/WebKit.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
126 content_settings::CookieSettings::RegisterProfilePrefs(prefs_.registry()); | 126 content_settings::CookieSettings::RegisterProfilePrefs(prefs_.registry()); |
127 HostContentSettingsMap::RegisterProfilePrefs(prefs_.registry()); | 127 HostContentSettingsMap::RegisterProfilePrefs(prefs_.registry()); |
128 SigninManagerBase::RegisterProfilePrefs(prefs_.registry()); | 128 SigninManagerBase::RegisterProfilePrefs(prefs_.registry()); |
129 | 129 |
130 gaia_cookie_manager_service_.reset(new MockGaiaCookieManagerService()); | 130 gaia_cookie_manager_service_.reset(new MockGaiaCookieManagerService()); |
131 signin_client_.reset(new TestSigninClient(&prefs_)); | 131 signin_client_.reset(new TestSigninClient(&prefs_)); |
132 signin_manager_.reset(new FakeSigninManager( | 132 signin_manager_.reset(new FakeSigninManager( |
133 signin_client_.get(), nullptr, &account_tracker_service_, nullptr)); | 133 signin_client_.get(), nullptr, &account_tracker_service_, nullptr)); |
134 account_tracker_service_.Initialize(signin_client_.get()); | 134 account_tracker_service_.Initialize(signin_client_.get()); |
135 settings_map_ = new HostContentSettingsMap( | 135 settings_map_ = new HostContentSettingsMap( |
136 &prefs_, false /* incognito_profile */, false /* guest_profile */); | 136 &prefs_, false /* incognito_profile */, false /* guest_profile */, |
137 nullptr /* PrefServiceSyncable* */); | |
raymes
2016/06/29 03:50:01
nit: same here (should just be pref_service)
lshang
2016/06/30 05:03:36
We've changed to not pass in the pointer, so no ne
| |
137 cookie_settings_ = | 138 cookie_settings_ = |
138 new content_settings::CookieSettings(settings_map_.get(), &prefs_, ""); | 139 new content_settings::CookieSettings(settings_map_.get(), &prefs_, ""); |
139 ResetAccountConsistencyService(); | 140 ResetAccountConsistencyService(); |
140 } | 141 } |
141 | 142 |
142 void TearDown() override { | 143 void TearDown() override { |
143 account_consistency_service_->Shutdown(); | 144 account_consistency_service_->Shutdown(); |
144 settings_map_->ShutdownOnUIThread(); | 145 settings_map_->ShutdownOnUIThread(); |
145 web::BrowserState::GetActiveStateManager(&browser_state_)->SetActive(false); | 146 web::BrowserState::GetActiveStateManager(&browser_state_)->SetActive(false); |
146 PlatformTest::TearDown(); | 147 PlatformTest::TearDown(); |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
439 // Tests that main domains are added to the internal map when cookies are set in | 440 // Tests that main domains are added to the internal map when cookies are set in |
440 // reaction to signin. | 441 // reaction to signin. |
441 TEST_F(AccountConsistencyServiceTest, SigninAddCookieOnMainDomains) { | 442 TEST_F(AccountConsistencyServiceTest, SigninAddCookieOnMainDomains) { |
442 AddPageLoadedExpectation(kGoogleUrl, true /* continue_navigation */); | 443 AddPageLoadedExpectation(kGoogleUrl, true /* continue_navigation */); |
443 AddPageLoadedExpectation(kYoutubeUrl, true /* continue_navigation */); | 444 AddPageLoadedExpectation(kYoutubeUrl, true /* continue_navigation */); |
444 SignIn(); | 445 SignIn(); |
445 | 446 |
446 CheckDomainHasCookie(kGoogleDomain); | 447 CheckDomainHasCookie(kGoogleDomain); |
447 CheckDomainHasCookie(kYoutubeDomain); | 448 CheckDomainHasCookie(kYoutubeDomain); |
448 } | 449 } |
OLD | NEW |