OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
6 #include "chrome/browser/browser_process.h" | 6 #include "chrome/browser/browser_process.h" |
7 #include "chrome/browser/chromeos/login/enterprise_enrollment_screen.h" | 7 #include "chrome/browser/chromeos/login/enterprise_enrollment_screen.h" |
8 #include "chrome/browser/chromeos/login/existing_user_controller.h" | 8 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
9 #include "chrome/browser/chromeos/login/language_switch_menu.h" | 9 #include "chrome/browser/chromeos/login/language_switch_menu.h" |
10 #include "chrome/browser/chromeos/login/mock_eula_screen.h" | 10 #include "chrome/browser/chromeos/login/mock_eula_screen.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 #define MOCK(mock_var, screen_name, mocked_class, actor_class) \ | 43 #define MOCK(mock_var, screen_name, mocked_class, actor_class) \ |
44 mock_var = new MockOutShowHide<mocked_class, actor_class>( \ | 44 mock_var = new MockOutShowHide<mocked_class, actor_class>( \ |
45 controller(), new actor_class); \ | 45 controller(), new actor_class); \ |
46 controller()->screen_name.reset(mock_var); \ | 46 controller()->screen_name.reset(mock_var); \ |
47 EXPECT_CALL(*mock_var, Show()).Times(0); \ | 47 EXPECT_CALL(*mock_var, Show()).Times(0); \ |
48 EXPECT_CALL(*mock_var, Hide()).Times(0); | 48 EXPECT_CALL(*mock_var, Hide()).Times(0); |
49 | 49 |
50 #define MOCK_OLD(mock_var, screen_name, mocked_class) \ | 50 #define MOCK_OLD(mock_var, screen_name, mocked_class) \ |
51 mock_var = new MockOutShowHide<mocked_class, int>( \ | 51 mock_var = new MockOutShowHide<mocked_class, int>( \ |
52 static_cast<ViewsOobeDisplay*>(controller()->oobe_display_.get())); \ | 52 static_cast<ViewsOobeDisplay*>(controller()->oobe_display_)); \ |
53 controller()->screen_name.reset(mock_var); \ | 53 controller()->screen_name.reset(mock_var); \ |
54 EXPECT_CALL(*mock_var, Show()).Times(0); \ | 54 EXPECT_CALL(*mock_var, Show()).Times(0); \ |
55 EXPECT_CALL(*mock_var, Hide()).Times(0); | 55 EXPECT_CALL(*mock_var, Hide()).Times(0); |
56 | 56 |
57 class WizardControllerTest : public WizardInProcessBrowserTest { | 57 class WizardControllerTest : public WizardInProcessBrowserTest { |
58 protected: | 58 protected: |
59 WizardControllerTest() : WizardInProcessBrowserTest( | 59 WizardControllerTest() : WizardInProcessBrowserTest( |
60 WizardController::kTestNoScreenName) {} | 60 WizardController::kTestNoScreenName) {} |
61 virtual ~WizardControllerTest() {} | 61 virtual ~WizardControllerTest() {} |
62 | 62 |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 // This test is supposed to fail on official build. | 253 // This test is supposed to fail on official build. |
254 #define MAYBE_Accelerators DISABLED_Accelerators | 254 #define MAYBE_Accelerators DISABLED_Accelerators |
255 #else | 255 #else |
256 #define MAYBE_Accelerators Accelerators | 256 #define MAYBE_Accelerators Accelerators |
257 #endif | 257 #endif |
258 | 258 |
259 IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest, MAYBE_Accelerators) { | 259 IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest, MAYBE_Accelerators) { |
260 //TODO(altimofeev): do not depend on the display realization. | 260 //TODO(altimofeev): do not depend on the display realization. |
261 | 261 |
262 ViewsOobeDisplay* display = | 262 ViewsOobeDisplay* display = |
263 static_cast<ViewsOobeDisplay*>(controller()->oobe_display_.get()); | 263 static_cast<ViewsOobeDisplay*>(controller()->oobe_display_); |
264 views::View* contents = display->contents_; | 264 views::View* contents = display->contents_; |
265 | 265 |
266 EXPECT_EQ(controller()->GetNetworkScreen(), controller()->current_screen()); | 266 EXPECT_EQ(controller()->GetNetworkScreen(), controller()->current_screen()); |
267 | 267 |
268 views::Accelerator accel_network_screen(ui::VKEY_N, false, true, true); | 268 views::Accelerator accel_network_screen(ui::VKEY_N, false, true, true); |
269 views::Accelerator accel_update_screen(ui::VKEY_U, false, true, true); | 269 views::Accelerator accel_update_screen(ui::VKEY_U, false, true, true); |
270 views::Accelerator accel_image_screen(ui::VKEY_I, false, true, true); | 270 views::Accelerator accel_image_screen(ui::VKEY_I, false, true, true); |
271 views::Accelerator accel_eula_screen(ui::VKEY_E, false, true, true); | 271 views::Accelerator accel_eula_screen(ui::VKEY_E, false, true, true); |
272 views::Accelerator accel_enterprise_enrollment_screen( | 272 views::Accelerator accel_enterprise_enrollment_screen( |
273 ui::VKEY_P, false, true, true); | 273 ui::VKEY_P, false, true, true); |
(...skipping 28 matching lines...) Expand all Loading... |
302 focus_manager = contents->GetFocusManager(); | 302 focus_manager = contents->GetFocusManager(); |
303 EXPECT_CALL(*mock_eula_screen_, Show()).Times(1); | 303 EXPECT_CALL(*mock_eula_screen_, Show()).Times(1); |
304 EXPECT_TRUE(focus_manager->ProcessAccelerator(accel_eula_screen)); | 304 EXPECT_TRUE(focus_manager->ProcessAccelerator(accel_eula_screen)); |
305 EXPECT_EQ(controller()->GetEulaScreen(), controller()->current_screen()); | 305 EXPECT_EQ(controller()->GetEulaScreen(), controller()->current_screen()); |
306 } | 306 } |
307 | 307 |
308 COMPILE_ASSERT(ScreenObserver::EXIT_CODES_COUNT == 17, | 308 COMPILE_ASSERT(ScreenObserver::EXIT_CODES_COUNT == 17, |
309 add_tests_for_new_control_flow_you_just_introduced); | 309 add_tests_for_new_control_flow_you_just_introduced); |
310 | 310 |
311 } // namespace chromeos | 311 } // namespace chromeos |
OLD | NEW |