| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/signin/signin_error_notifier_ash.h" | 5 #include "chrome/browser/signin/signin_error_notifier_ash.h" |
| 6 | 6 |
| 7 #include "ash/test/ash_test_base.h" | 7 #include "ash/test/ash_test_base.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/notifications/notification.h" | 10 #include "chrome/browser/notifications/notification.h" |
| 11 #include "chrome/browser/notifications/notification_ui_manager.h" | 11 #include "chrome/browser/notifications/notification_ui_manager.h" |
| 12 #include "chrome/browser/signin/fake_signin_manager.h" | 12 #include "chrome/browser/signin/fake_signin_manager_builder.h" |
| 13 #include "chrome/browser/signin/signin_error_controller_factory.h" | 13 #include "chrome/browser/signin/signin_error_controller_factory.h" |
| 14 #include "chrome/browser/signin/signin_error_notifier_factory_ash.h" | 14 #include "chrome/browser/signin/signin_error_notifier_factory_ash.h" |
| 15 #include "chrome/browser/signin/signin_manager_factory.h" | 15 #include "chrome/browser/signin/signin_manager_factory.h" |
| 16 #include "chrome/test/base/testing_browser_process.h" | 16 #include "chrome/test/base/testing_browser_process.h" |
| 17 #include "chrome/test/base/testing_profile.h" | 17 #include "chrome/test/base/testing_profile.h" |
| 18 #include "chrome/test/base/testing_profile_manager.h" | 18 #include "chrome/test/base/testing_profile_manager.h" |
| 19 #include "components/signin/core/browser/fake_auth_status_provider.h" | 19 #include "components/signin/core/browser/fake_auth_status_provider.h" |
| 20 #include "components/signin/core/browser/signin_error_controller.h" | 20 #include "components/signin/core/browser/signin_error_controller.h" |
| 21 #include "components/signin/core/browser/signin_manager.h" | 21 #include "components/signin/core/browser/signin_manager.h" |
| 22 #include "content/public/test/test_browser_thread_bundle.h" | 22 #include "content/public/test/test_browser_thread_bundle.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 DISALLOW_COPY_AND_ASSIGN(ScreenTypeDelegateDesktop); | 56 DISALLOW_COPY_AND_ASSIGN(ScreenTypeDelegateDesktop); |
| 57 }; | 57 }; |
| 58 #endif | 58 #endif |
| 59 | 59 |
| 60 class SigninErrorNotifierTest : public AshTestBase { | 60 class SigninErrorNotifierTest : public AshTestBase { |
| 61 public: | 61 public: |
| 62 void SetUp() override { | 62 void SetUp() override { |
| 63 // Create a signed-in profile. | 63 // Create a signed-in profile. |
| 64 TestingProfile::Builder builder; | 64 TestingProfile::Builder builder; |
| 65 builder.AddTestingFactory(SigninManagerFactory::GetInstance(), | 65 builder.AddTestingFactory(SigninManagerFactory::GetInstance(), |
| 66 FakeSigninManagerBase::Build); | 66 BuildFakeSigninManagerBase); |
| 67 profile_ = builder.Build(); | 67 profile_ = builder.Build(); |
| 68 profile_->set_profile_name(kTestAccountId); | 68 profile_->set_profile_name(kTestAccountId); |
| 69 | 69 |
| 70 profile_manager_.reset( | 70 profile_manager_.reset( |
| 71 new TestingProfileManager(TestingBrowserProcess::GetGlobal())); | 71 new TestingProfileManager(TestingBrowserProcess::GetGlobal())); |
| 72 ASSERT_TRUE(profile_manager_->SetUp()); | 72 ASSERT_TRUE(profile_manager_->SetUp()); |
| 73 | 73 |
| 74 TestingBrowserProcess::GetGlobal(); | 74 TestingBrowserProcess::GetGlobal(); |
| 75 AshTestBase::SetUp(); | 75 AshTestBase::SetUp(); |
| 76 | 76 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 EXPECT_FALSE(notification->title().empty()); | 245 EXPECT_FALSE(notification->title().empty()); |
| 246 EXPECT_FALSE(notification->message().empty()); | 246 EXPECT_FALSE(notification->message().empty()); |
| 247 EXPECT_EQ((size_t)1, notification->buttons().size()); | 247 EXPECT_EQ((size_t)1, notification->buttons().size()); |
| 248 } | 248 } |
| 249 } | 249 } |
| 250 } | 250 } |
| 251 #endif | 251 #endif |
| 252 | 252 |
| 253 } // namespace test | 253 } // namespace test |
| 254 } // namespace ash | 254 } // namespace ash |
| OLD | NEW |