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

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

Issue 2694923005: Appropriate handling for Cellular First devices. (Closed)
Patch Set: now with tests Created 3 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
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 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after
1294 WizardController::default_controller()->AdvanceToScreen( 1294 WizardController::default_controller()->AdvanceToScreen(
1295 OobeScreen::SCREEN_OOBE_ENROLLMENT); 1295 OobeScreen::SCREEN_OOBE_ENROLLMENT);
1296 CheckCurrentScreen(OobeScreen::SCREEN_OOBE_ENROLLMENT); 1296 CheckCurrentScreen(OobeScreen::SCREEN_OOBE_ENROLLMENT);
1297 } 1297 }
1298 1298
1299 IN_PROC_BROWSER_TEST_F(WizardControllerOobeResumeTest, 1299 IN_PROC_BROWSER_TEST_F(WizardControllerOobeResumeTest,
1300 ControlFlowResumeInterruptedOobe) { 1300 ControlFlowResumeInterruptedOobe) {
1301 EXPECT_EQ(OobeScreen::SCREEN_OOBE_ENROLLMENT, GetFirstScreen()); 1301 EXPECT_EQ(OobeScreen::SCREEN_OOBE_ENROLLMENT, GetFirstScreen());
1302 } 1302 }
1303 1303
1304 class WizardControllerCellularFirstTest : public WizardControllerFlowTest {
1305 protected:
1306 WizardControllerCellularFirstTest() {}
1307
1308 void SetUpCommandLine(base::CommandLine* command_line) override {
1309 command_line->AppendSwitch(switches::kCellularFirst);
1310 }
1311
1312 private:
1313 DISALLOW_COPY_AND_ASSIGN(WizardControllerCellularFirstTest);
1314 };
1315
1316 IN_PROC_BROWSER_TEST_F(WizardControllerCellularFirstTest, CellularFirstFlow) {
xiyuan 2017/02/28 20:26:41 I am not sure how this test differs from ControlFl
kumarniranjan 2017/02/28 21:49:33 As we discussed, it is the same test, and it has b
1317 CheckCurrentScreen(OobeScreen::SCREEN_OOBE_NETWORK);
1318
1319 WaitUntilJSIsReady();
1320
1321 // Check visibility of the header bar.
1322 ASSERT_FALSE(JSExecuteBooleanExpression("$('login-header-bar').hidden"));
1323
1324 EXPECT_CALL(*mock_network_screen_, Hide()).Times(1);
1325 EXPECT_CALL(*mock_eula_screen_, Show()).Times(1);
1326 OnExit(*mock_network_screen_, BaseScreenDelegate::NETWORK_CONNECTED);
1327
1328 CheckCurrentScreen(OobeScreen::SCREEN_OOBE_EULA);
1329
1330 // Header bar should still be visible.
1331 ASSERT_FALSE(JSExecuteBooleanExpression("$('login-header-bar').hidden"));
1332
1333 EXPECT_CALL(*mock_eula_screen_, Hide()).Times(1);
1334 EXPECT_CALL(*mock_update_screen_, StartNetworkCheck()).Times(1);
1335 EXPECT_CALL(*mock_update_screen_, Show()).Times(1);
1336 // Enable TimeZone resolve
1337 InitTimezoneResolver();
1338 OnExit(*mock_eula_screen_, BaseScreenDelegate::EULA_ACCEPTED);
1339 EXPECT_TRUE(GetGeolocationProvider());
1340
1341 // Let update screen smooth time process (time = 0ms).
1342 content::RunAllPendingInMessageLoop();
1343
1344 CheckCurrentScreen(OobeScreen::SCREEN_OOBE_UPDATE);
1345 EXPECT_CALL(*mock_update_screen_, Hide()).Times(1);
1346 EXPECT_CALL(*mock_auto_enrollment_check_screen_, Show()).Times(1);
1347 OnExit(*mock_update_screen_, BaseScreenDelegate::UPDATE_INSTALLED);
1348
1349 CheckCurrentScreen(OobeScreen::SCREEN_AUTO_ENROLLMENT_CHECK);
1350 EXPECT_CALL(*mock_auto_enrollment_check_screen_, Hide()).Times(0);
1351 EXPECT_CALL(*mock_eula_screen_, Show()).Times(0);
1352 OnExit(*mock_auto_enrollment_check_screen_,
1353 BaseScreenDelegate::ENTERPRISE_AUTO_ENROLLMENT_CHECK_COMPLETED);
1354
1355 EXPECT_FALSE(ExistingUserController::current_controller() == NULL);
1356 EXPECT_EQ("ethernet,wifi,cellular", NetworkHandler::Get()
1357 ->network_state_handler()
1358 ->GetCheckPortalListForTest());
1359
1360 WaitUntilTimezoneResolved();
1361 EXPECT_EQ("America/Anchorage",
1362 base::UTF16ToUTF8(chromeos::system::TimezoneSettings::GetInstance()
1363 ->GetCurrentTimezoneID()));
1364 }
1365
1304 // TODO(dzhioev): Add test emaulating device with wrong HWID. 1366 // TODO(dzhioev): Add test emaulating device with wrong HWID.
1305 1367
1306 // TODO(nkostylev): Add test for WebUI accelerators http://crosbug.com/22571 1368 // TODO(nkostylev): Add test for WebUI accelerators http://crosbug.com/22571
1307 1369
1308 // TODO(merkulova): Add tests for bluetooth HID detection screen variations when 1370 // TODO(merkulova): Add tests for bluetooth HID detection screen variations when
1309 // UI and logic is ready. http://crbug.com/127016 1371 // UI and logic is ready. http://crbug.com/127016
1310 1372
1311 // TODO(dzhioev): Add tests for controller/host pairing flow. 1373 // TODO(dzhioev): Add tests for controller/host pairing flow.
1312 // http://crbug.com/375191 1374 // http://crbug.com/375191
1313 1375
1314 // TODO(khmel): Add tests for ARC OptIn flow. 1376 // TODO(khmel): Add tests for ARC OptIn flow.
1315 // http://crbug.com/651144 1377 // http://crbug.com/651144
1316 static_assert(BaseScreenDelegate::EXIT_CODES_COUNT == 25, 1378 static_assert(BaseScreenDelegate::EXIT_CODES_COUNT == 25,
1317 "tests for new control flow are missing"); 1379 "tests for new control flow are missing");
1318 1380
1319 } // namespace chromeos 1381 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698