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

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

Issue 101473003: Do not allow creating dummy notifier id from production, for safety. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ash/shell.h" 5 #include "ash/shell.h"
6 #include "ash/system/system_notifier.h" 6 #include "ash/system/system_notifier.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/chromeos/login/login_manager_test.h" 8 #include "chrome/browser/chromeos/login/login_manager_test.h"
9 #include "chrome/browser/chromeos/login/startup_utils.h" 9 #include "chrome/browser/chromeos/login/startup_utils.h"
10 #include "chrome/browser/chromeos/login/user_adding_screen.h" 10 #include "chrome/browser/chromeos/login/user_adding_screen.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 IN_PROC_BROWSER_TEST_F(LoginStateNotificationBlockerChromeOSBrowserTest, 82 IN_PROC_BROWSER_TEST_F(LoginStateNotificationBlockerChromeOSBrowserTest,
83 PRE_BaseTest) { 83 PRE_BaseTest) {
84 RegisterUser(kTestUsers[0]); 84 RegisterUser(kTestUsers[0]);
85 RegisterUser(kTestUsers[1]); 85 RegisterUser(kTestUsers[1]);
86 chromeos::StartupUtils::MarkOobeCompleted(); 86 chromeos::StartupUtils::MarkOobeCompleted();
87 } 87 }
88 88
89 IN_PROC_BROWSER_TEST_F(LoginStateNotificationBlockerChromeOSBrowserTest, 89 IN_PROC_BROWSER_TEST_F(LoginStateNotificationBlockerChromeOSBrowserTest,
90 BaseTest) { 90 BaseTest) {
91 CreateBlocker(); 91 CreateBlocker();
92 message_center::NotifierId notifier_id; 92 message_center::NotifierId notifier_id(
93 message_center::NotifierId::APPLICATION, "test-notifier");
93 94
94 // Logged in as a normal user. 95 // Logged in as a normal user.
95 EXPECT_CALL(login_utils(), DoBrowserLaunch(_, _)).Times(1); 96 EXPECT_CALL(login_utils(), DoBrowserLaunch(_, _)).Times(1);
96 LoginUser(kTestUsers[0]); 97 LoginUser(kTestUsers[0]);
97 EXPECT_EQ(1, GetStateChangedCountAndReset()); 98 EXPECT_EQ(1, GetStateChangedCountAndReset());
98 EXPECT_TRUE(ShouldShowNotificationAsPopup(notifier_id)); 99 EXPECT_TRUE(ShouldShowNotificationAsPopup(notifier_id));
99 100
100 // Multi-login user switch. 101 // Multi-login user switch.
101 chromeos::UserAddingScreen::Get()->Start(); 102 chromeos::UserAddingScreen::Get()->Start();
102 content::RunAllPendingInMessageLoop(); 103 content::RunAllPendingInMessageLoop();
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 content::RunAllPendingInMessageLoop(); 138 content::RunAllPendingInMessageLoop();
138 EXPECT_EQ(1, GetStateChangedCountAndReset()); 139 EXPECT_EQ(1, GetStateChangedCountAndReset());
139 EXPECT_TRUE(ShouldShowNotificationAsPopup(notifier_id)); 140 EXPECT_TRUE(ShouldShowNotificationAsPopup(notifier_id));
140 141
141 // Multi-login user switch off. 142 // Multi-login user switch off.
142 chromeos::UserAddingScreen::Get()->Cancel(); 143 chromeos::UserAddingScreen::Get()->Cancel();
143 content::RunAllPendingInMessageLoop(); 144 content::RunAllPendingInMessageLoop();
144 EXPECT_EQ(1, GetStateChangedCountAndReset()); 145 EXPECT_EQ(1, GetStateChangedCountAndReset());
145 EXPECT_TRUE(ShouldShowNotificationAsPopup(notifier_id)); 146 EXPECT_TRUE(ShouldShowNotificationAsPopup(notifier_id));
146 } 147 }
OLDNEW
« no previous file with comments | « ash/shell/window_type_launcher.cc ('k') | chrome/browser/notifications/login_state_notification_blocker_chromeos_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698