| 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/ime/tray_ime_chromeos.h" | 5 #include "ash/system/ime/tray_ime_chromeos.h" |
| 6 | 6 |
| 7 #include "ash/common/accessibility_delegate.h" | 7 #include "ash/common/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/system/tray/system_tray_notifier.h" | 10 #include "ash/system/tray/system_tray_notifier.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 EXPECT_TRUE(default_view()->visible()); | 135 EXPECT_TRUE(default_view()->visible()); |
| 136 } | 136 } |
| 137 | 137 |
| 138 // Tests that clicking on the keyboard toggle causes the virtual keyboard | 138 // Tests that clicking on the keyboard toggle causes the virtual keyboard |
| 139 // to toggle between enabled and disabled. | 139 // to toggle between enabled and disabled. |
| 140 TEST_F(TrayIMETest, PerformActionOnDetailedView) { | 140 TEST_F(TrayIMETest, PerformActionOnDetailedView) { |
| 141 SetIMELength(0); | 141 SetIMELength(0); |
| 142 test::VirtualKeyboardTestHelper::SuppressKeyboard(); | 142 test::VirtualKeyboardTestHelper::SuppressKeyboard(); |
| 143 EXPECT_FALSE(keyboard::IsKeyboardEnabled()); | 143 EXPECT_FALSE(keyboard::IsKeyboardEnabled()); |
| 144 views::View* toggle = GetScrollChildView(0); | 144 views::View* toggle = GetScrollChildView(0); |
| 145 ui::GestureEvent tap(0, 0, 0, base::TimeDelta(), | 145 ui::GestureEvent tap(0, 0, 0, base::TimeTicks(), |
| 146 ui::GestureEventDetails(ui::ET_GESTURE_TAP)); | 146 ui::GestureEventDetails(ui::ET_GESTURE_TAP)); |
| 147 // Enable the keyboard. | 147 // Enable the keyboard. |
| 148 toggle->OnGestureEvent(&tap); | 148 toggle->OnGestureEvent(&tap); |
| 149 EXPECT_TRUE(keyboard::IsKeyboardEnabled()); | 149 EXPECT_TRUE(keyboard::IsKeyboardEnabled()); |
| 150 EXPECT_TRUE(default_view()->visible()); | 150 EXPECT_TRUE(default_view()->visible()); |
| 151 // With no IMEs the toggle should be the first child. | 151 // With no IMEs the toggle should be the first child. |
| 152 toggle = GetScrollChildView(0); | 152 toggle = GetScrollChildView(0); |
| 153 // Clicking again should disable the keyboard. | 153 // Clicking again should disable the keyboard. |
| 154 tap = ui::GestureEvent(0, 0, 0, base::TimeDelta(), | 154 tap = ui::GestureEvent(0, 0, 0, base::TimeTicks(), |
| 155 ui::GestureEventDetails(ui::ET_GESTURE_TAP)); | 155 ui::GestureEventDetails(ui::ET_GESTURE_TAP)); |
| 156 toggle->OnGestureEvent(&tap); | 156 toggle->OnGestureEvent(&tap); |
| 157 EXPECT_FALSE(keyboard::IsKeyboardEnabled()); | 157 EXPECT_FALSE(keyboard::IsKeyboardEnabled()); |
| 158 EXPECT_TRUE(default_view()->visible()); | 158 EXPECT_TRUE(default_view()->visible()); |
| 159 } | 159 } |
| 160 | 160 |
| 161 } // namespace ash | 161 } // namespace ash |
| OLD | NEW |