| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ash/system/chromeos/virtual_keyboard/tray_keyboard_lock.h" | 5 #include "ash/system/chromeos/virtual_keyboard/tray_keyboard_lock.h" |
| 6 | 6 |
| 7 #include "ash/accessibility_delegate.h" | 7 #include "ash/accessibility_delegate.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/system/status_area_widget.h" | 9 #include "ash/system/status_area_widget.h" |
| 10 #include "ash/test/ash_test_base.h" | 10 #include "ash/test/ash_test_base.h" |
| 11 #include "ash/test/status_area_widget_test_helper.h" | 11 #include "ash/test/status_area_widget_test_helper.h" |
| 12 #include "ash/test/virtual_keyboard_test_helper.h" | 12 #include "ash/test/virtual_keyboard_test_helper.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "ui/keyboard/keyboard_switches.h" | |
| 15 #include "ui/keyboard/keyboard_util.h" | 14 #include "ui/keyboard/keyboard_util.h" |
| 16 | 15 |
| 17 namespace ash { | 16 namespace ash { |
| 18 | 17 |
| 19 class TrayKeyboardLockTest : public test::AshTestBase { | 18 class TrayKeyboardLockTest : public test::AshTestBase { |
| 20 public: | 19 public: |
| 21 TrayKeyboardLockTest() {} | 20 TrayKeyboardLockTest() {} |
| 22 virtual ~TrayKeyboardLockTest() {} | 21 virtual ~TrayKeyboardLockTest() {} |
| 23 | 22 |
| 24 TrayKeyboardLock* tray() { return tray_.get(); } | 23 TrayKeyboardLock* tray() { return tray_.get(); } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 notification); | 68 notification); |
| 70 } | 69 } |
| 71 | 70 |
| 72 void TrayKeyboardLockTest::TearDownViews() { | 71 void TrayKeyboardLockTest::TearDownViews() { |
| 73 tray_view_.reset(); | 72 tray_view_.reset(); |
| 74 default_view_.reset(); | 73 default_view_.reset(); |
| 75 tray_.reset(); | 74 tray_.reset(); |
| 76 } | 75 } |
| 77 | 76 |
| 78 void TrayKeyboardLockTest::SetUp() { | 77 void TrayKeyboardLockTest::SetUp() { |
| 79 CommandLine::ForCurrentProcess()->AppendSwitch( | |
| 80 keyboard::switches::kAutoVirtualKeyboard); | |
| 81 test::AshTestBase::SetUp(); | 78 test::AshTestBase::SetUp(); |
| 82 SetUpForStatusAreaWidget(StatusAreaWidgetTestHelper::GetStatusAreaWidget()); | 79 SetUpForStatusAreaWidget(StatusAreaWidgetTestHelper::GetStatusAreaWidget()); |
| 83 } | 80 } |
| 84 | 81 |
| 85 void TrayKeyboardLockTest::TearDown() { | 82 void TrayKeyboardLockTest::TearDown() { |
| 86 SetAccessibilityKeyboardEnabled(false); | 83 SetAccessibilityKeyboardEnabled(false); |
| 87 TearDownViews(); | 84 TearDownViews(); |
| 88 test::AshTestBase::TearDown(); | 85 test::AshTestBase::TearDown(); |
| 89 } | 86 } |
| 90 | 87 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 121 |
| 125 tap = ui::GestureEvent( | 122 tap = ui::GestureEvent( |
| 126 0, 0, 0, base::TimeDelta(), ui::GestureEventDetails(ui::ET_GESTURE_TAP)); | 123 0, 0, 0, base::TimeDelta(), ui::GestureEventDetails(ui::ET_GESTURE_TAP)); |
| 127 default_view()->OnGestureEvent(&tap); | 124 default_view()->OnGestureEvent(&tap); |
| 128 EXPECT_FALSE(keyboard::IsKeyboardEnabled()); | 125 EXPECT_FALSE(keyboard::IsKeyboardEnabled()); |
| 129 EXPECT_TRUE(tray_view()->visible()); | 126 EXPECT_TRUE(tray_view()->visible()); |
| 130 EXPECT_TRUE(default_view()->visible()); | 127 EXPECT_TRUE(default_view()->visible()); |
| 131 } | 128 } |
| 132 | 129 |
| 133 } // namespace ash | 130 } // namespace ash |
| OLD | NEW |