OLD | NEW |
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/path_service.h" | 6 #include "base/path_service.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/browser_shutdown.h" | 9 #include "chrome/browser/browser_shutdown.h" |
10 #include "chrome/browser/chromeos/cros/cros_library.h" | 10 #include "chrome/browser/chromeos/cros/cros_library.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "chrome/browser/chromeos/login/screens/reset_screen.h" | 23 #include "chrome/browser/chromeos/login/screens/reset_screen.h" |
24 #include "chrome/browser/chromeos/login/screens/user_image_screen.h" | 24 #include "chrome/browser/chromeos/login/screens/user_image_screen.h" |
25 #include "chrome/browser/chromeos/login/screens/wrong_hwid_screen.h" | 25 #include "chrome/browser/chromeos/login/screens/wrong_hwid_screen.h" |
26 #include "chrome/browser/chromeos/login/startup_utils.h" | 26 #include "chrome/browser/chromeos/login/startup_utils.h" |
27 #include "chrome/browser/chromeos/login/test_login_utils.h" | 27 #include "chrome/browser/chromeos/login/test_login_utils.h" |
28 #include "chrome/browser/chromeos/login/wizard_controller.h" | 28 #include "chrome/browser/chromeos/login/wizard_controller.h" |
29 #include "chrome/browser/chromeos/login/wizard_in_process_browser_test.h" | 29 #include "chrome/browser/chromeos/login/wizard_in_process_browser_test.h" |
30 #include "chrome/common/chrome_paths.h" | 30 #include "chrome/common/chrome_paths.h" |
31 #include "chrome/test/base/ui_test_utils.h" | 31 #include "chrome/test/base/ui_test_utils.h" |
32 #include "chromeos/chromeos_switches.h" | 32 #include "chromeos/chromeos_switches.h" |
33 #include "chromeos/chromeos_test_utils.h" | |
34 #include "grit/generated_resources.h" | 33 #include "grit/generated_resources.h" |
35 #include "testing/gmock/include/gmock/gmock.h" | 34 #include "testing/gmock/include/gmock/gmock.h" |
36 #include "testing/gtest/include/gtest/gtest.h" | 35 #include "testing/gtest/include/gtest/gtest.h" |
37 #include "third_party/icu/public/common/unicode/locid.h" | 36 #include "third_party/icu/public/common/unicode/locid.h" |
38 #include "ui/base/accelerators/accelerator.h" | 37 #include "ui/base/accelerators/accelerator.h" |
39 #include "ui/base/l10n/l10n_util.h" | 38 #include "ui/base/l10n/l10n_util.h" |
40 | 39 |
41 namespace chromeos { | 40 namespace chromeos { |
42 | 41 |
43 namespace { | 42 namespace { |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 EXPECT_FALSE(ExistingUserController::current_controller() == NULL); | 357 EXPECT_FALSE(ExistingUserController::current_controller() == NULL); |
359 } | 358 } |
360 | 359 |
361 class WizardControllerKioskFlowTest : public WizardControllerFlowTest { | 360 class WizardControllerKioskFlowTest : public WizardControllerFlowTest { |
362 protected: | 361 protected: |
363 WizardControllerKioskFlowTest() {} | 362 WizardControllerKioskFlowTest() {} |
364 | 363 |
365 // Overridden from InProcessBrowserTest: | 364 // Overridden from InProcessBrowserTest: |
366 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 365 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
367 base::FilePath test_data_dir; | 366 base::FilePath test_data_dir; |
368 ASSERT_TRUE(chromeos::test_utils::GetTestDataPath( | 367 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir); |
369 "app_mode", "kiosk_manifest", &test_data_dir)); | |
370 command_line->AppendSwitchPath( | 368 command_line->AppendSwitchPath( |
371 switches::kAppOemManifestFile, | 369 switches::kAppOemManifestFile, |
372 test_data_dir.AppendASCII("kiosk_manifest.json")); | 370 test_data_dir.Append(FILE_PATH_LITERAL( |
| 371 "chromeos/app_mode/kiosk_manifest/kiosk_manifest.json"))); |
373 } | 372 } |
374 | 373 |
375 private: | 374 private: |
376 DISALLOW_COPY_AND_ASSIGN(WizardControllerKioskFlowTest); | 375 DISALLOW_COPY_AND_ASSIGN(WizardControllerKioskFlowTest); |
377 }; | 376 }; |
378 | 377 |
379 IN_PROC_BROWSER_TEST_F(WizardControllerKioskFlowTest, | 378 IN_PROC_BROWSER_TEST_F(WizardControllerKioskFlowTest, |
380 ControlFlowKioskForcedEnrollment) { | 379 ControlFlowKioskForcedEnrollment) { |
381 EXPECT_CALL(*mock_enrollment_screen_->actor(), | 380 EXPECT_CALL(*mock_enrollment_screen_->actor(), |
382 SetParameters(mock_enrollment_screen_, | 381 SetParameters(mock_enrollment_screen_, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 } | 418 } |
420 | 419 |
421 // TODO(dzhioev): Add test emaulating device with wrong HWID. | 420 // TODO(dzhioev): Add test emaulating device with wrong HWID. |
422 | 421 |
423 // TODO(nkostylev): Add test for WebUI accelerators http://crosbug.com/22571 | 422 // TODO(nkostylev): Add test for WebUI accelerators http://crosbug.com/22571 |
424 | 423 |
425 COMPILE_ASSERT(ScreenObserver::EXIT_CODES_COUNT == 15, | 424 COMPILE_ASSERT(ScreenObserver::EXIT_CODES_COUNT == 15, |
426 add_tests_for_new_control_flow_you_just_introduced); | 425 add_tests_for_new_control_flow_you_just_introduced); |
427 | 426 |
428 } // namespace chromeos | 427 } // namespace chromeos |
OLD | NEW |