Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Side by Side Diff: ash/common/system/ime/tray_ime_chromeos_unittest.cc

Issue 2738133003: Promotes a handful of members from WmShell to Shell (Closed)
Patch Set: merge Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/common/system/ime/tray_ime_chromeos.cc ('k') | ash/common/system/tray/system_tray.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/common/system/ime/tray_ime_chromeos.h" 5 #include "ash/common/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/common/accessibility_types.h" 8 #include "ash/common/accessibility_types.h"
9 #include "ash/common/system/chromeos/ime_menu/ime_list_view.h" 9 #include "ash/common/system/chromeos/ime_menu/ime_list_view.h"
10 #include "ash/common/system/tray/system_tray_notifier.h" 10 #include "ash/common/system/tray/system_tray_notifier.h"
11 #include "ash/common/wm_shell.h" 11 #include "ash/common/wm_shell.h"
12 #include "ash/shell.h"
12 #include "ash/test/ash_test_base.h" 13 #include "ash/test/ash_test_base.h"
13 #include "base/strings/utf_string_conversions.h" 14 #include "base/strings/utf_string_conversions.h"
14 #include "ui/events/devices/device_data_manager.h" 15 #include "ui/events/devices/device_data_manager.h"
15 #include "ui/keyboard/keyboard_util.h" 16 #include "ui/keyboard/keyboard_util.h"
16 17
17 namespace ash { 18 namespace ash {
18 19
19 class TrayIMETest : public test::AshTestBase { 20 class TrayIMETest : public test::AshTestBase {
20 public: 21 public:
21 TrayIMETest() {} 22 TrayIMETest() {}
(...skipping 30 matching lines...) Expand all
52 std::unique_ptr<views::View> detailed_view_; 53 std::unique_ptr<views::View> detailed_view_;
53 54
54 bool keyboard_suppressed_ = false; 55 bool keyboard_suppressed_ = false;
55 std::vector<ui::TouchscreenDevice> touchscreen_devices_to_restore_; 56 std::vector<ui::TouchscreenDevice> touchscreen_devices_to_restore_;
56 std::vector<ui::InputDevice> keyboard_devices_to_restore_; 57 std::vector<ui::InputDevice> keyboard_devices_to_restore_;
57 58
58 DISALLOW_COPY_AND_ASSIGN(TrayIMETest); 59 DISALLOW_COPY_AND_ASSIGN(TrayIMETest);
59 }; 60 };
60 61
61 void TrayIMETest::SetAccessibilityKeyboardEnabled(bool enabled) { 62 void TrayIMETest::SetAccessibilityKeyboardEnabled(bool enabled) {
62 WmShell::Get()->accessibility_delegate()->SetVirtualKeyboardEnabled(enabled); 63 Shell::GetInstance()->accessibility_delegate()->SetVirtualKeyboardEnabled(
64 enabled);
63 keyboard::SetAccessibilityKeyboardEnabled(enabled); 65 keyboard::SetAccessibilityKeyboardEnabled(enabled);
64 AccessibilityNotificationVisibility notification = 66 AccessibilityNotificationVisibility notification =
65 enabled ? A11Y_NOTIFICATION_SHOW : A11Y_NOTIFICATION_NONE; 67 enabled ? A11Y_NOTIFICATION_SHOW : A11Y_NOTIFICATION_NONE;
66 WmShell::Get()->system_tray_notifier()->NotifyAccessibilityModeChanged( 68 WmShell::Get()->system_tray_notifier()->NotifyAccessibilityModeChanged(
67 notification); 69 notification);
68 } 70 }
69 71
70 void TrayIMETest::SetIMELength(int length) { 72 void TrayIMETest::SetIMELength(int length) {
71 tray_->ime_list_.clear(); 73 tray_->ime_list_.clear();
72 IMEInfo ime; 74 IMEInfo ime;
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 // Clicking again should disable the keyboard. 197 // Clicking again should disable the keyboard.
196 toggle = GetToggleView(); 198 toggle = GetToggleView();
197 tap = ui::GestureEvent(0, 0, 0, base::TimeTicks(), 199 tap = ui::GestureEvent(0, 0, 0, base::TimeTicks(),
198 ui::GestureEventDetails(ui::ET_GESTURE_TAP)); 200 ui::GestureEventDetails(ui::ET_GESTURE_TAP));
199 toggle->OnGestureEvent(&tap); 201 toggle->OnGestureEvent(&tap);
200 EXPECT_FALSE(keyboard::IsKeyboardEnabled()); 202 EXPECT_FALSE(keyboard::IsKeyboardEnabled());
201 EXPECT_TRUE(default_view()->visible()); 203 EXPECT_TRUE(default_view()->visible());
202 } 204 }
203 205
204 } // namespace ash 206 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/ime/tray_ime_chromeos.cc ('k') | ash/common/system/tray/system_tray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698