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

Side by Side Diff: chrome/browser/notifications/message_center_notifications_unittest.cc

Issue 890293002: Fixing crash upon window manager creation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed Created 5 years, 10 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 "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/prefs/testing_pref_service.h" 6 #include "base/prefs/testing_pref_service.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/test/test_timeouts.h" 9 #include "base/test/test_timeouts.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 notification_manager()->Update(GetANotification("test"), &profile)); 139 notification_manager()->Update(GetANotification("test"), &profile));
140 EXPECT_TRUE(message_center()->NotificationCount() == 1); 140 EXPECT_TRUE(message_center()->NotificationCount() == 1);
141 } 141 }
142 142
143 #if defined(OS_CHROMEOS) 143 #if defined(OS_CHROMEOS)
144 TEST_F(MessageCenterNotificationManagerTest, MultiUserUpdates) { 144 TEST_F(MessageCenterNotificationManagerTest, MultiUserUpdates) {
145 TestingProfile profile; 145 TestingProfile profile;
146 std::string active_user_id = multi_user_util::GetUserIDFromProfile(&profile); 146 std::string active_user_id = multi_user_util::GetUserIDFromProfile(&profile);
147 chrome::MultiUserWindowManagerChromeOS* multi_user_window_manager = 147 chrome::MultiUserWindowManagerChromeOS* multi_user_window_manager =
148 new chrome::MultiUserWindowManagerChromeOS(active_user_id); 148 new chrome::MultiUserWindowManagerChromeOS(active_user_id);
149 multi_user_window_manager->Init();
149 chrome::MultiUserWindowManager::SetInstanceForTest( 150 chrome::MultiUserWindowManager::SetInstanceForTest(
150 multi_user_window_manager, 151 multi_user_window_manager,
151 chrome::MultiUserWindowManager::MULTI_PROFILE_MODE_SEPARATED); 152 chrome::MultiUserWindowManager::MULTI_PROFILE_MODE_SEPARATED);
152 scoped_ptr<MultiUserNotificationBlockerChromeOS> blocker( 153 scoped_ptr<MultiUserNotificationBlockerChromeOS> blocker(
153 new MultiUserNotificationBlockerChromeOS( 154 new MultiUserNotificationBlockerChromeOS(
154 message_center::MessageCenter::Get(), 155 message_center::MessageCenter::Get(),
155 active_user_id)); 156 active_user_id));
156 EXPECT_EQ(0u, message_center()->NotificationCount()); 157 EXPECT_EQ(0u, message_center()->NotificationCount());
157 notification_manager()->Add(GetANotification("test"), &profile); 158 notification_manager()->Add(GetANotification("test"), &profile);
158 EXPECT_EQ(1u, message_center()->NotificationCount()); 159 EXPECT_EQ(1u, message_center()->NotificationCount());
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 TestingProfile profile; 205 TestingProfile profile;
205 notification_manager()->Add(GetANotification("test"), &profile); 206 notification_manager()->Add(GetANotification("test"), &profile);
206 message_center()->SetVisibility(message_center::VISIBILITY_MESSAGE_CENTER); 207 message_center()->SetVisibility(message_center::VISIBILITY_MESSAGE_CENTER);
207 run_loop()->RunUntilIdle(); 208 run_loop()->RunUntilIdle();
208 EXPECT_FALSE(notification_manager()->FirstRunTimerIsActive()); 209 EXPECT_FALSE(notification_manager()->FirstRunTimerIsActive());
209 EXPECT_FALSE(DidFirstRunPref()); 210 EXPECT_FALSE(DidFirstRunPref());
210 } 211 }
211 212
212 #endif 213 #endif
213 } // namespace message_center 214 } // namespace message_center
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698