OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/browser/chromeos/status/data_promo_notification.h" | 5 #include "chrome/browser/chromeos/status/data_promo_notification.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" | 9 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" |
10 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" | 10 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 user_manager_enabler_.reset(); | 79 user_manager_enabler_.reset(); |
80 data_promo_notification_.reset(); | 80 data_promo_notification_.reset(); |
81 NetworkHandler::Shutdown(); | 81 NetworkHandler::Shutdown(); |
82 DBusThreadManager::Shutdown(); | 82 DBusThreadManager::Shutdown(); |
83 testing::Test::TearDown(); | 83 testing::Test::TearDown(); |
84 } | 84 } |
85 | 85 |
86 protected: | 86 protected: |
87 void SetupUser() { | 87 void SetupUser() { |
88 scoped_ptr<FakeChromeUserManager> user_manager(new FakeChromeUserManager()); | 88 scoped_ptr<FakeChromeUserManager> user_manager(new FakeChromeUserManager()); |
89 user_manager->AddUser(kTestUserName); | 89 const AccountId test_account_id(AccountId::FromUserEmail(kTestUserName)); |
90 user_manager->LoginUser(kTestUserName); | 90 user_manager->AddUser(test_account_id); |
| 91 user_manager->LoginUser(test_account_id); |
91 user_manager_enabler_.reset( | 92 user_manager_enabler_.reset( |
92 new ScopedUserManagerEnabler(user_manager.release())); | 93 new ScopedUserManagerEnabler(user_manager.release())); |
93 | 94 |
94 profile_manager_.reset( | 95 profile_manager_.reset( |
95 new TestingProfileManager(TestingBrowserProcess::GetGlobal())); | 96 new TestingProfileManager(TestingBrowserProcess::GetGlobal())); |
96 ASSERT_TRUE(profile_manager_->SetUp()); | 97 ASSERT_TRUE(profile_manager_->SetUp()); |
97 profile_manager_->SetLoggedIn(true); | 98 profile_manager_->SetLoggedIn(true); |
98 ASSERT_TRUE(user_manager::UserManager::Get()->GetPrimaryUser()); | 99 ASSERT_TRUE(user_manager::UserManager::Get()->GetPrimaryUser()); |
99 | 100 |
100 LoginState::Initialize(); | 101 LoginState::Initialize(); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 152 |
152 ui::NetworkConnect::Get()->ConnectToNetwork(kCellularServicePath); | 153 ui::NetworkConnect::Get()->ConnectToNetwork(kCellularServicePath); |
153 base::RunLoop().RunUntilIdle(); | 154 base::RunLoop().RunUntilIdle(); |
154 // Connecting to cellular network (which here makes it the default network) | 155 // Connecting to cellular network (which here makes it the default network) |
155 // should trigger the Data Saver notification. | 156 // should trigger the Data Saver notification. |
156 EXPECT_TRUE(message_center->FindVisibleNotificationById(kNotificationId)); | 157 EXPECT_TRUE(message_center->FindVisibleNotificationById(kNotificationId)); |
157 } | 158 } |
158 | 159 |
159 } // namespace test | 160 } // namespace test |
160 } // namespace chromeos | 161 } // namespace chromeos |
OLD | NEW |