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

Side by Side Diff: chrome/browser/chromeos/login/wizard_controller_browsertest.cc

Issue 9348022: [cros] Use mocked URLFetcher and other mocks in ExistingUserController tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move Created 8 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/utf_string_conversions.h" 6 #include "base/utf_string_conversions.h"
7 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/browser_shutdown.h" 8 #include "chrome/browser/browser_shutdown.h"
9 #include "chrome/browser/chromeos/login/base_login_display_host.h" 9 #include "chrome/browser/chromeos/login/base_login_display_host.h"
10 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_screen. h" 10 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_screen. h"
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 237
238 IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest, 238 IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest,
239 ControlFlowEnterpriseAutoEnrollmentCompleted) { 239 ControlFlowEnterpriseAutoEnrollmentCompleted) {
240 CommandLine::ForCurrentProcess()->AppendSwitchASCII( 240 CommandLine::ForCurrentProcess()->AppendSwitchASCII(
241 switches::kLoginScreen, 241 switches::kLoginScreen,
242 WizardController::kLoginScreenName); 242 WizardController::kLoginScreenName);
243 243
244 EXPECT_EQ(controller()->GetNetworkScreen(), controller()->current_screen()); 244 EXPECT_EQ(controller()->GetNetworkScreen(), controller()->current_screen());
245 EXPECT_CALL(*mock_update_screen_, StartUpdate()).Times(0); 245 EXPECT_CALL(*mock_update_screen_, StartUpdate()).Times(0);
246 246
247 LoginUtils::Set(new MockLoginUtils(kUsername, kPassword)); 247 LoginUtils::Set(new TestLoginUtils(kUsername, kPassword));
248 MockConsumer mock_consumer; 248 MockConsumer mock_consumer;
249 249
250 // Must have a pending signin to resume after auto-enrollment: 250 // Must have a pending signin to resume after auto-enrollment:
251 BaseLoginDisplayHost::default_host()->StartSignInScreen(); 251 BaseLoginDisplayHost::default_host()->StartSignInScreen();
252 EXPECT_FALSE(ExistingUserController::current_controller() == NULL); 252 EXPECT_FALSE(ExistingUserController::current_controller() == NULL);
253 ExistingUserController::current_controller()->DoAutoEnrollment(); 253 ExistingUserController::current_controller()->DoAutoEnrollment();
254 ExistingUserController::current_controller()->set_login_status_consumer( 254 ExistingUserController::current_controller()->set_login_status_consumer(
255 &mock_consumer); 255 &mock_consumer);
256 // This calls StartWizard, destroying the current controller() and its mocks; 256 // This calls StartWizard, destroying the current controller() and its mocks;
257 // don't set expectations on those objects. 257 // don't set expectations on those objects.
(...skipping 13 matching lines...) Expand all
271 MessageLoop::current()->RunAllPending(); 271 MessageLoop::current()->RunAllPending();
272 set_controller(NULL); 272 set_controller(NULL);
273 } 273 }
274 274
275 // TODO(nkostylev): Add test for WebUI accelerators http://crosbug.com/22571 275 // TODO(nkostylev): Add test for WebUI accelerators http://crosbug.com/22571
276 276
277 COMPILE_ASSERT(ScreenObserver::EXIT_CODES_COUNT == 15, 277 COMPILE_ASSERT(ScreenObserver::EXIT_CODES_COUNT == 15,
278 add_tests_for_new_control_flow_you_just_introduced); 278 add_tests_for_new_control_flow_you_just_introduced);
279 279
280 } // namespace chromeos 280 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/wizard_controller.cc ('k') | chrome/browser/signin/token_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698