| 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/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/system/tray/system_tray_notifier.h" | 10 #include "ash/system/tray/system_tray_notifier.h" |
| 11 #include "ash/test/ash_test_base.h" | 11 #include "ash/test/ash_test_base.h" |
| 12 #include "ash/test/status_area_widget_test_helper.h" | 12 #include "ash/test/status_area_widget_test_helper.h" |
| 13 #include "ash/test/virtual_keyboard_test_helper.h" | 13 #include "ash/test/virtual_keyboard_test_helper.h" |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "ui/keyboard/keyboard_switches.h" | |
| 16 #include "ui/keyboard/keyboard_util.h" | 15 #include "ui/keyboard/keyboard_util.h" |
| 17 | 16 |
| 18 namespace ash { | 17 namespace ash { |
| 19 | 18 |
| 20 class TrayIMETest : public test::AshTestBase { | 19 class TrayIMETest : public test::AshTestBase { |
| 21 public: | 20 public: |
| 22 TrayIMETest() {} | 21 TrayIMETest() {} |
| 23 ~TrayIMETest() override {} | 22 ~TrayIMETest() override {} |
| 24 | 23 |
| 25 TrayIME* tray() { return tray_.get(); } | 24 TrayIME* tray() { return tray_.get(); } |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 93 |
| 95 views::View* TrayIMETest::GetScrollChildView(int index) { | 94 views::View* TrayIMETest::GetScrollChildView(int index) { |
| 96 TrayDetailsView* details = static_cast<TrayDetailsView*>(detailed_view()); | 95 TrayDetailsView* details = static_cast<TrayDetailsView*>(detailed_view()); |
| 97 views::View* content = details->scroll_content(); | 96 views::View* content = details->scroll_content(); |
| 98 EXPECT_TRUE(content); | 97 EXPECT_TRUE(content); |
| 99 EXPECT_GT(content->child_count(), index); | 98 EXPECT_GT(content->child_count(), index); |
| 100 return content->child_at(index); | 99 return content->child_at(index); |
| 101 } | 100 } |
| 102 | 101 |
| 103 void TrayIMETest::SetUp() { | 102 void TrayIMETest::SetUp() { |
| 104 base::CommandLine::ForCurrentProcess()->AppendSwitch( | |
| 105 keyboard::switches::kEnableAutoVirtualKeyboard); | |
| 106 test::AshTestBase::SetUp(); | 103 test::AshTestBase::SetUp(); |
| 107 SetUpForStatusAreaWidget(StatusAreaWidgetTestHelper::GetStatusAreaWidget()); | 104 SetUpForStatusAreaWidget(StatusAreaWidgetTestHelper::GetStatusAreaWidget()); |
| 108 } | 105 } |
| 109 | 106 |
| 110 void TrayIMETest::TearDown() { | 107 void TrayIMETest::TearDown() { |
| 111 SetAccessibilityKeyboardEnabled(false); | 108 SetAccessibilityKeyboardEnabled(false); |
| 112 TearDownViews(); | 109 TearDownViews(); |
| 113 test::AshTestBase::TearDown(); | 110 test::AshTestBase::TearDown(); |
| 114 } | 111 } |
| 115 | 112 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 toggle = GetScrollChildView(0); | 152 toggle = GetScrollChildView(0); |
| 156 // Clicking again should disable the keyboard. | 153 // Clicking again should disable the keyboard. |
| 157 tap = ui::GestureEvent(0, 0, 0, base::TimeDelta(), | 154 tap = ui::GestureEvent(0, 0, 0, base::TimeDelta(), |
| 158 ui::GestureEventDetails(ui::ET_GESTURE_TAP)); | 155 ui::GestureEventDetails(ui::ET_GESTURE_TAP)); |
| 159 toggle->OnGestureEvent(&tap); | 156 toggle->OnGestureEvent(&tap); |
| 160 EXPECT_FALSE(keyboard::IsKeyboardEnabled()); | 157 EXPECT_FALSE(keyboard::IsKeyboardEnabled()); |
| 161 EXPECT_TRUE(default_view()->visible()); | 158 EXPECT_TRUE(default_view()->visible()); |
| 162 } | 159 } |
| 163 | 160 |
| 164 } // namespace ash | 161 } // namespace ash |
| OLD | NEW |