| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 SigninManager* signin_manager) | 55 SigninManager* signin_manager) |
| 56 : AccountConsistencyService(browser_state, | 56 : AccountConsistencyService(browser_state, |
| 57 account_reconcilor, | 57 account_reconcilor, |
| 58 cookie_settings, | 58 cookie_settings, |
| 59 gaia_cookie_manager_service, | 59 gaia_cookie_manager_service, |
| 60 signin_client, | 60 signin_client, |
| 61 signin_manager), | 61 signin_manager), |
| 62 mock_web_view_(nil) {} | 62 mock_web_view_(nil) {} |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 WKWebView* CreateWKWebView() override { | 65 WKWebView* CreateWKWebView() override NS_RETURNS_RETAINED { |
| 66 if (!mock_web_view_) { | 66 if (!mock_web_view_) { |
| 67 mock_web_view_ = [OCMockObject niceMockForClass:[WKWebView class]]; | 67 mock_web_view_ = [OCMockObject niceMockForClass:[WKWebView class]]; |
| 68 } | 68 } |
| 69 return [mock_web_view_ retain]; | 69 return [mock_web_view_ retain]; |
| 70 } | 70 } |
| 71 id mock_web_view_; | 71 id mock_web_view_; |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 // Mock AccountReconcilor to catch call to OnReceivedManageAccountsResponse. | 74 // Mock AccountReconcilor to catch call to OnReceivedManageAccountsResponse. |
| 75 class MockAccountReconcilor : public AccountReconcilor { | 75 class MockAccountReconcilor : public AccountReconcilor { |
| (...skipping 363 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 | 439 // Tests that main domains are added to the internal map when cookies are set in |
| 440 // reaction to signin. | 440 // reaction to signin. |
| 441 TEST_F(AccountConsistencyServiceTest, SigninAddCookieOnMainDomains) { | 441 TEST_F(AccountConsistencyServiceTest, SigninAddCookieOnMainDomains) { |
| 442 AddPageLoadedExpectation(kGoogleUrl, true /* continue_navigation */); | 442 AddPageLoadedExpectation(kGoogleUrl, true /* continue_navigation */); |
| 443 AddPageLoadedExpectation(kYoutubeUrl, true /* continue_navigation */); | 443 AddPageLoadedExpectation(kYoutubeUrl, true /* continue_navigation */); |
| 444 SignIn(); | 444 SignIn(); |
| 445 | 445 |
| 446 CheckDomainHasCookie(kGoogleDomain); | 446 CheckDomainHasCookie(kGoogleDomain); |
| 447 CheckDomainHasCookie(kYoutubeDomain); | 447 CheckDomainHasCookie(kYoutubeDomain); |
| 448 } | 448 } |
| OLD | NEW |