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 #import "ios/chrome/browser/ui/authentication/signed_in_accounts_view_controller
.h" | 5 #import "ios/chrome/browser/ui/authentication/signed_in_accounts_view_controller
.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
10 #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" | 10 #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" |
11 #include "ios/chrome/browser/signin/authentication_service_factory.h" | 11 #include "ios/chrome/browser/signin/authentication_service_factory.h" |
12 #import "ios/chrome/browser/signin/authentication_service_fake.h" | 12 #import "ios/chrome/browser/signin/authentication_service_fake.h" |
13 #include "ios/chrome/test/block_cleanup_test.h" | 13 #include "ios/chrome/test/block_cleanup_test.h" |
14 #include "ios/public/provider/chrome/browser/signin/fake_chrome_identity_service
.h" | 14 #include "ios/public/provider/chrome/browser/signin/fake_chrome_identity_service
.h" |
15 #include "ios/web/public/test/test_web_thread_bundle.h" | 15 #include "ios/web/public/test/test_web_thread_bundle.h" |
16 #import "testing/gtest_mac.h" | 16 #import "testing/gtest_mac.h" |
17 #include "testing/platform_test.h" | 17 #include "testing/platform_test.h" |
18 | 18 |
| 19 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 20 #error "This file requires ARC support." |
| 21 #endif |
| 22 |
19 class SignedInAccountsViewControllerTest : public BlockCleanupTest { | 23 class SignedInAccountsViewControllerTest : public BlockCleanupTest { |
20 public: | 24 public: |
21 void SetUp() override { | 25 void SetUp() override { |
22 BlockCleanupTest::SetUp(); | 26 BlockCleanupTest::SetUp(); |
23 | 27 |
24 TestChromeBrowserState::Builder builder; | 28 TestChromeBrowserState::Builder builder; |
25 builder.AddTestingFactory( | 29 builder.AddTestingFactory( |
26 AuthenticationServiceFactory::GetInstance(), | 30 AuthenticationServiceFactory::GetInstance(), |
27 AuthenticationServiceFake::CreateAuthenticationService); | 31 AuthenticationServiceFake::CreateAuthenticationService); |
28 browser_state_ = builder.Build(); | 32 browser_state_ = builder.Build(); |
(...skipping 24 matching lines...) Expand all Loading... |
53 } | 57 } |
54 | 58 |
55 // Tests that the signed in accounts view should be presented when the accounts | 59 // Tests that the signed in accounts view should be presented when the accounts |
56 // have changed. | 60 // have changed. |
57 TEST_F(SignedInAccountsViewControllerTest, | 61 TEST_F(SignedInAccountsViewControllerTest, |
58 ShouldBePresentedForBrowserStateNecessary) { | 62 ShouldBePresentedForBrowserStateNecessary) { |
59 auth_service_->SetHaveAccountsChanged(true); | 63 auth_service_->SetHaveAccountsChanged(true); |
60 EXPECT_TRUE([SignedInAccountsViewController | 64 EXPECT_TRUE([SignedInAccountsViewController |
61 shouldBePresentedForBrowserState:browser_state_.get()]); | 65 shouldBePresentedForBrowserState:browser_state_.get()]); |
62 } | 66 } |
OLD | NEW |