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

Side by Side Diff: chrome/browser/chromeos/login/ui/user_adding_screen_browsertest.cc

Issue 287083003: Multi-profile flag cleanup (Closed) Base URL: https://chromium.googlesource.com/chromium/src
Patch Set: Created 6 years, 7 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 "ash/session/session_state_delegate.h" 5 #include "ash/session/session_state_delegate.h"
6 #include "ash/shell.h" 6 #include "ash/shell.h"
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "chrome/browser/chrome_notification_types.h" 8 #include "chrome/browser/chrome_notification_types.h"
9 #include "chrome/browser/chromeos/login/lock/screen_locker.h" 9 #include "chrome/browser/chromeos/login/lock/screen_locker.h"
10 #include "chrome/browser/chromeos/login/lock/screen_locker_tester.h" 10 #include "chrome/browser/chromeos/login/lock/screen_locker_tester.h"
11 #include "chrome/browser/chromeos/login/login_manager_test.h" 11 #include "chrome/browser/chromeos/login/login_manager_test.h"
12 #include "chrome/browser/chromeos/login/startup_utils.h" 12 #include "chrome/browser/chromeos/login/startup_utils.h"
13 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" 13 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h"
14 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" 14 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h"
15 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" 15 #include "chrome/browser/chromeos/login/ui/webui_login_view.h"
16 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h" 16 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h"
17 #include "chrome/browser/chromeos/login/users/user_manager.h" 17 #include "chrome/browser/chromeos/login/users/user_manager.h"
18 #include "chrome/common/chrome_switches.h" 18 #include "chrome/common/chrome_switches.h"
Nikita (slow) 2014/05/19 14:27:15 nit: not used
19 #include "chrome/common/pref_names.h" 19 #include "chrome/common/pref_names.h"
20 #include "chrome/test/base/in_process_browser_test.h" 20 #include "chrome/test/base/in_process_browser_test.h"
21 #include "content/public/test/test_utils.h" 21 #include "content/public/test/test_utils.h"
22 #include "testing/gtest/include/gtest/gtest.h" 22 #include "testing/gtest/include/gtest/gtest.h"
23 23
24 using namespace testing; 24 using namespace testing;
25 25
26 namespace { 26 namespace {
27 27
28 const char* kTestUsers[] = {"test-user1@gmail.com", 28 const char* kTestUsers[] = {"test-user1@gmail.com",
29 "test-user2@gmail.com", 29 "test-user2@gmail.com",
30 "test-user3@gmail.com"}; 30 "test-user3@gmail.com"};
31 31
32 } // anonymous namespace 32 } // anonymous namespace
33 33
34 namespace chromeos { 34 namespace chromeos {
35 35
36 class UserAddingScreenTest : public LoginManagerTest, 36 class UserAddingScreenTest : public LoginManagerTest,
37 public UserAddingScreen::Observer { 37 public UserAddingScreen::Observer {
38 public: 38 public:
39 UserAddingScreenTest() : LoginManagerTest(false), 39 UserAddingScreenTest() : LoginManagerTest(false),
40 user_adding_started_(0), 40 user_adding_started_(0),
41 user_adding_finished_(0) { 41 user_adding_finished_(0) {
42 } 42 }
43 43
44 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
45 LoginManagerTest::SetUpCommandLine(command_line);
46 command_line->AppendSwitch(::switches::kMultiProfiles);
47 }
48
49 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { 44 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE {
50 LoginManagerTest::SetUpInProcessBrowserTestFixture(); 45 LoginManagerTest::SetUpInProcessBrowserTestFixture();
51 UserAddingScreen::Get()->AddObserver(this); 46 UserAddingScreen::Get()->AddObserver(this);
52 } 47 }
53 48
54 virtual void OnUserAddingFinished() OVERRIDE { ++user_adding_finished_; } 49 virtual void OnUserAddingFinished() OVERRIDE { ++user_adding_finished_; }
55 50
56 virtual void OnUserAddingStarted() OVERRIDE { ++user_adding_started_; } 51 virtual void OnUserAddingStarted() OVERRIDE { ++user_adding_started_; }
57 52
58 void SetUserCanLock(User* user, bool can_lock) { 53 void SetUserCanLock(User* user, bool can_lock) {
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 content::NotificationService::AllSources()).Wait(); 257 content::NotificationService::AllSources()).Wait();
263 258
264 UserAddingScreen::Get()->Start(); 259 UserAddingScreen::Get()->Start();
265 content::RunAllPendingInMessageLoop(); 260 content::RunAllPendingInMessageLoop();
266 CheckScreenIsVisible(); 261 CheckScreenIsVisible();
267 UserAddingScreen::Get()->Cancel(); 262 UserAddingScreen::Get()->Cancel();
268 content::RunAllPendingInMessageLoop(); 263 content::RunAllPendingInMessageLoop();
269 } 264 }
270 265
271 } // namespace chromeos 266 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698