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

Side by Side Diff: chrome/browser/chromeos/status/data_promo_notification_unittest.cc

Issue 1412813003: This CL replaces user_manager::UserID with AccountId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@468875--Chrome-OS-handles-deletion-of-Gmail-account-poorly--Create-AccountID-structure-part2--user_names
Patch Set: Fix Win GN build. Created 5 years, 1 month 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 (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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698