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

Side by Side Diff: chrome/browser/signin/signin_error_notifier_ash_unittest.cc

Issue 809313009: Make the SigninErrorController a PKS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Copyrighted: 2015 Created 5 years, 11 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
OLDNEW
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.h"
13 #include "chrome/browser/signin/profile_oauth2_token_service_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/profile_oauth2_token_service.h" 20 #include "components/signin/core/browser/profile_oauth2_token_service.h"
Roger Tawa OOO till Jul 10th 2015/01/08 22:30:54 I think you can remove this header and the factory
Mike Lerman 2015/01/09 14:27:07 Removed the PO2TS header. Factory was already remo
21 #include "components/signin/core/browser/signin_error_controller.h" 21 #include "components/signin/core/browser/signin_error_controller.h"
22 #include "components/signin/core/browser/signin_manager.h" 22 #include "components/signin/core/browser/signin_manager.h"
23 #include "content/public/test/test_browser_thread_bundle.h" 23 #include "content/public/test/test_browser_thread_bundle.h"
24 #include "testing/gtest/include/gtest/gtest.h" 24 #include "testing/gtest/include/gtest/gtest.h"
25 #include "ui/message_center/notification.h" 25 #include "ui/message_center/notification.h"
26 26
27 #if defined(OS_WIN) 27 #if defined(OS_WIN)
28 #include "chrome/browser/ui/ash/ash_util.h" 28 #include "chrome/browser/ui/ash/ash_util.h"
29 #include "ui/aura/test/test_screen.h" 29 #include "ui/aura/test/test_screen.h"
30 #include "ui/gfx/screen.h" 30 #include "ui/gfx/screen.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 TestingBrowserProcess::GetGlobal(); 77 TestingBrowserProcess::GetGlobal();
78 AshTestBase::SetUp(); 78 AshTestBase::SetUp();
79 79
80 // Set up screen for Windows. 80 // Set up screen for Windows.
81 #if defined(OS_WIN) 81 #if defined(OS_WIN)
82 test_screen_.reset(aura::TestScreen::Create(gfx::Size())); 82 test_screen_.reset(aura::TestScreen::Create(gfx::Size()));
83 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen_.get()); 83 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen_.get());
84 gfx::Screen::SetScreenTypeDelegate(new ScreenTypeDelegateDesktop); 84 gfx::Screen::SetScreenTypeDelegate(new ScreenTypeDelegateDesktop);
85 #endif 85 #endif
86 86
87 error_controller_ = 87 error_controller_ = SigninErrorControllerFactory::GetForProfile(
88 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_.get())-> 88 profile_.get());
89 signin_error_controller();
90 SigninErrorNotifierFactory::GetForProfile(profile_.get()); 89 SigninErrorNotifierFactory::GetForProfile(profile_.get());
91 notification_ui_manager_ = g_browser_process->notification_ui_manager(); 90 notification_ui_manager_ = g_browser_process->notification_ui_manager();
92 } 91 }
93 92
94 void TearDown() override { 93 void TearDown() override {
95 #if defined(OS_WIN) 94 #if defined(OS_WIN)
96 test_screen_.reset(); 95 test_screen_.reset();
97 #endif 96 #endif
98 profile_manager_.reset(); 97 profile_manager_.reset();
99 98
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 EXPECT_FALSE(notification->title().empty()); 250 EXPECT_FALSE(notification->title().empty());
252 EXPECT_FALSE(notification->message().empty()); 251 EXPECT_FALSE(notification->message().empty());
253 EXPECT_EQ((size_t)1, notification->buttons().size()); 252 EXPECT_EQ((size_t)1, notification->buttons().size());
254 } 253 }
255 } 254 }
256 } 255 }
257 #endif 256 #endif
258 257
259 } // namespace test 258 } // namespace test
260 } // namespace ash 259 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698