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

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

Issue 2699633004: Revert of cros: ensure update check to complete at OOBE before allowing login (Closed)
Patch Set: Created 3 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
« no previous file with comments | « chrome/browser/chromeos/login/wizard_controller.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/chromeos/login/wizard_controller.h" 5 #include "chrome/browser/chromeos/login/wizard_controller.h"
6 6
7 #include "ash/common/accessibility_types.h" 7 #include "ash/common/accessibility_types.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 EXPECT_EQ("ethernet,wifi,cellular", 585 EXPECT_EQ("ethernet,wifi,cellular",
586 NetworkHandler::Get()->network_state_handler() 586 NetworkHandler::Get()->network_state_handler()
587 ->GetCheckPortalListForTest()); 587 ->GetCheckPortalListForTest());
588 588
589 WaitUntilTimezoneResolved(); 589 WaitUntilTimezoneResolved();
590 EXPECT_EQ("America/Anchorage", 590 EXPECT_EQ("America/Anchorage",
591 base::UTF16ToUTF8(chromeos::system::TimezoneSettings::GetInstance() 591 base::UTF16ToUTF8(chromeos::system::TimezoneSettings::GetInstance()
592 ->GetCurrentTimezoneID())); 592 ->GetCurrentTimezoneID()));
593 } 593 }
594 594
595 // This test verifies that if WizardController fails to check for update before
596 // the OOBE is marked complete, it goes back the network selection screen and
597 // thus prevents the user from proceeding to log in.
598 IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest,
599 ControlFlowErrorCheckingForUpdate) {
600 CheckCurrentScreen(OobeScreen::SCREEN_OOBE_NETWORK);
601 EXPECT_CALL(*mock_update_screen_, StartNetworkCheck()).Times(0);
602 EXPECT_CALL(*mock_eula_screen_, Show()).Times(1);
603 EXPECT_CALL(*mock_update_screen_, Show()).Times(0);
604 EXPECT_CALL(*mock_network_screen_, Hide()).Times(1);
605 OnExit(*mock_network_screen_, BaseScreenDelegate::NETWORK_CONNECTED);
606
607 CheckCurrentScreen(OobeScreen::SCREEN_OOBE_EULA);
608 EXPECT_CALL(*mock_eula_screen_, Hide()).Times(1);
609 EXPECT_CALL(*mock_update_screen_, StartNetworkCheck()).Times(1);
610 EXPECT_CALL(*mock_update_screen_, Show()).Times(1);
611 OnExit(*mock_eula_screen_, BaseScreenDelegate::EULA_ACCEPTED);
612
613 // Let update screen smooth time process (time = 0ms).
614 content::RunAllPendingInMessageLoop();
615
616 CheckCurrentScreen(OobeScreen::SCREEN_OOBE_UPDATE);
617 EXPECT_CALL(*mock_update_screen_, Hide()).Times(1);
618 EXPECT_CALL(*mock_eula_screen_, Show()).Times(0);
619 EXPECT_CALL(*mock_auto_enrollment_check_screen_, Show()).Times(0);
620 EXPECT_CALL(*mock_network_screen_, Show()).Times(1);
621 EXPECT_CALL(*mock_network_screen_, Hide()).Times(0); // last transition
622 OnExit(*mock_update_screen_,
623 BaseScreenDelegate::UPDATE_ERROR_CHECKING_FOR_UPDATE);
624 CheckCurrentScreen(OobeScreen::SCREEN_OOBE_NETWORK);
625 }
626
627 // This test verifies that if WizardController fails to apply a non-critical 595 // This test verifies that if WizardController fails to apply a non-critical
628 // update before the OOBE is marked complete, it allows the user to proceed to 596 // update before the OOBE is marked complete, it allows the user to proceed to
629 // log in. 597 // log in.
630 IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest, 598 IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest,
631 ControlFlowErrorUpdateNonCriticalUpdate) { 599 ControlFlowErrorUpdateNonCriticalUpdate) {
632 CheckCurrentScreen(OobeScreen::SCREEN_OOBE_NETWORK); 600 CheckCurrentScreen(OobeScreen::SCREEN_OOBE_NETWORK);
633 EXPECT_CALL(*mock_update_screen_, StartNetworkCheck()).Times(0); 601 EXPECT_CALL(*mock_update_screen_, StartNetworkCheck()).Times(0);
634 EXPECT_CALL(*mock_eula_screen_, Show()).Times(1); 602 EXPECT_CALL(*mock_eula_screen_, Show()).Times(1);
635 EXPECT_CALL(*mock_update_screen_, Show()).Times(0); 603 EXPECT_CALL(*mock_update_screen_, Show()).Times(0);
636 EXPECT_CALL(*mock_network_screen_, Hide()).Times(1); 604 EXPECT_CALL(*mock_network_screen_, Hide()).Times(1);
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 760
793 void SetUpOnMainThread() override { 761 void SetUpOnMainThread() override {
794 StartupUtils::MarkOobeCompleted(); // Pretend OOBE was complete. 762 StartupUtils::MarkOobeCompleted(); // Pretend OOBE was complete.
795 WizardControllerFlowTest::SetUpOnMainThread(); 763 WizardControllerFlowTest::SetUpOnMainThread();
796 } 764 }
797 765
798 private: 766 private:
799 DISALLOW_COPY_AND_ASSIGN(WizardControllerErrorUpdateAfterCompletedOobeTest); 767 DISALLOW_COPY_AND_ASSIGN(WizardControllerErrorUpdateAfterCompletedOobeTest);
800 }; 768 };
801 769
802 // This test verifies that if WizardController fails to check for update or 770 // This test verifies that if WizardController fails to apply an update, either
803 // apply an update (either critical or non-critical) after the OOBE is marked 771 // critical or non-critical, after the OOBE is marked complete, it allows the
804 // complete, it allows the user to proceed to log in. 772 // user to proceed to log in.
805 IN_PROC_BROWSER_TEST_P(WizardControllerErrorUpdateAfterCompletedOobeTest, 773 IN_PROC_BROWSER_TEST_P(WizardControllerErrorUpdateAfterCompletedOobeTest,
806 ControlFlowErrorUpdate) { 774 ControlFlowErrorUpdate) {
807 const BaseScreenDelegate::ExitCodes update_screen_exit_code = GetParam(); 775 const BaseScreenDelegate::ExitCodes update_screen_exit_code = GetParam();
808 CheckCurrentScreen(OobeScreen::SCREEN_OOBE_NETWORK); 776 CheckCurrentScreen(OobeScreen::SCREEN_OOBE_NETWORK);
809 EXPECT_CALL(*mock_update_screen_, StartNetworkCheck()).Times(0); 777 EXPECT_CALL(*mock_update_screen_, StartNetworkCheck()).Times(0);
810 EXPECT_CALL(*mock_eula_screen_, Show()).Times(1); 778 EXPECT_CALL(*mock_eula_screen_, Show()).Times(1);
811 EXPECT_CALL(*mock_update_screen_, Show()).Times(0); 779 EXPECT_CALL(*mock_update_screen_, Show()).Times(0);
812 EXPECT_CALL(*mock_network_screen_, Hide()).Times(1); 780 EXPECT_CALL(*mock_network_screen_, Hide()).Times(1);
813 OnExit(*mock_network_screen_, BaseScreenDelegate::NETWORK_CONNECTED); 781 OnExit(*mock_network_screen_, BaseScreenDelegate::NETWORK_CONNECTED);
814 782
(...skipping 16 matching lines...) Expand all
831 EXPECT_CALL(*mock_eula_screen_, Show()).Times(0); 799 EXPECT_CALL(*mock_eula_screen_, Show()).Times(0);
832 OnExit(*mock_auto_enrollment_check_screen_, 800 OnExit(*mock_auto_enrollment_check_screen_,
833 BaseScreenDelegate::ENTERPRISE_AUTO_ENROLLMENT_CHECK_COMPLETED); 801 BaseScreenDelegate::ENTERPRISE_AUTO_ENROLLMENT_CHECK_COMPLETED);
834 802
835 EXPECT_NE(nullptr, ExistingUserController::current_controller()); 803 EXPECT_NE(nullptr, ExistingUserController::current_controller());
836 } 804 }
837 805
838 INSTANTIATE_TEST_CASE_P( 806 INSTANTIATE_TEST_CASE_P(
839 WizardControllerErrorUpdateAfterCompletedOobe, 807 WizardControllerErrorUpdateAfterCompletedOobe,
840 WizardControllerErrorUpdateAfterCompletedOobeTest, 808 WizardControllerErrorUpdateAfterCompletedOobeTest,
841 testing::Values(BaseScreenDelegate::UPDATE_ERROR_CHECKING_FOR_UPDATE, 809 testing::Values(BaseScreenDelegate::UPDATE_ERROR_UPDATING,
842 BaseScreenDelegate::UPDATE_ERROR_UPDATING,
843 BaseScreenDelegate::UPDATE_ERROR_UPDATING_CRITICAL_UPDATE)); 810 BaseScreenDelegate::UPDATE_ERROR_UPDATING_CRITICAL_UPDATE));
844 811
845 class WizardControllerDeviceStateTest : public WizardControllerFlowTest { 812 class WizardControllerDeviceStateTest : public WizardControllerFlowTest {
846 protected: 813 protected:
847 WizardControllerDeviceStateTest() 814 WizardControllerDeviceStateTest()
848 : install_attributes_(ScopedStubInstallAttributes::CreateUnset()) { 815 : install_attributes_(ScopedStubInstallAttributes::CreateUnset()) {
849 fake_statistics_provider_.SetMachineStatistic( 816 fake_statistics_provider_.SetMachineStatistic(
850 system::kSerialNumberKey, "test"); 817 system::kSerialNumberKey, "test");
851 fake_statistics_provider_.SetMachineStatistic( 818 fake_statistics_provider_.SetMachineStatistic(
852 system::kActivateDateKey, "2000-01"); 819 system::kActivateDateKey, "2000-01");
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
1343 1310
1344 // TODO(dzhioev): Add tests for controller/host pairing flow. 1311 // TODO(dzhioev): Add tests for controller/host pairing flow.
1345 // http://crbug.com/375191 1312 // http://crbug.com/375191
1346 1313
1347 // TODO(khmel): Add tests for Arc OptIn flow. 1314 // TODO(khmel): Add tests for Arc OptIn flow.
1348 // http://crbug.com/651144 1315 // http://crbug.com/651144
1349 static_assert(BaseScreenDelegate::EXIT_CODES_COUNT == 25, 1316 static_assert(BaseScreenDelegate::EXIT_CODES_COUNT == 25,
1350 "tests for new control flow are missing"); 1317 "tests for new control flow are missing");
1351 1318
1352 } // namespace chromeos 1319 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/wizard_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698