| 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/sticky_keys/sticky_keys_overlay.h" | 5 #include "ash/sticky_keys/sticky_keys_overlay.h" |
| 6 | 6 |
| 7 #include "ash/common/wm_shell.h" | 7 #include "ash/common/wm_shell.h" |
| 8 #include "ash/display/window_tree_host_manager.h" | 8 #include "ash/display/window_tree_host_manager.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/sticky_keys/sticky_keys_controller.h" | 10 #include "ash/sticky_keys/sticky_keys_controller.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 // TODO: investigate failure in mash, http://crbug.com/696006. | 49 // TODO: investigate failure in mash, http://crbug.com/696006. |
| 50 if (WmShell::Get()->IsRunningInMash()) | 50 if (WmShell::Get()->IsRunningInMash()) |
| 51 return; | 51 return; |
| 52 | 52 |
| 53 // Add a secondary display to the left of the primary one. | 53 // Add a secondary display to the left of the primary one. |
| 54 UpdateDisplay("1280x1024,1980x1080"); | 54 UpdateDisplay("1280x1024,1980x1080"); |
| 55 display::DisplayIdList display_ids = | 55 display::DisplayIdList display_ids = |
| 56 display_manager()->GetCurrentDisplayIdList(); | 56 display_manager()->GetCurrentDisplayIdList(); |
| 57 int64_t primary_display_id = display_ids[0]; | 57 int64_t primary_display_id = display_ids[0]; |
| 58 int64_t secondary_display_id = display_ids[1]; | 58 int64_t secondary_display_id = display_ids[1]; |
| 59 // TODO: disabled as ScreenRotationAnimator does not work in mash, |
| 60 // http://crbug.com/696754. |
| 61 if (WmShell::Get()->IsRunningInMash()) |
| 62 return; |
| 59 display_manager()->SetLayoutForCurrentDisplays( | 63 display_manager()->SetLayoutForCurrentDisplays( |
| 60 display::test::CreateDisplayLayout(display_manager(), | 64 display::test::CreateDisplayLayout(display_manager(), |
| 61 display::DisplayPlacement::LEFT, 0)); | 65 display::DisplayPlacement::LEFT, 0)); |
| 62 | 66 |
| 63 // The overlay should belong to the secondary root window. | 67 // The overlay should belong to the secondary root window. |
| 64 StickyKeysOverlay overlay; | 68 StickyKeysOverlay overlay; |
| 65 views::Widget* overlay_widget = overlay.GetWidgetForTesting(); | 69 views::Widget* overlay_widget = overlay.GetWidgetForTesting(); |
| 66 WindowTreeHostManager* window_tree_host_manager = | 70 WindowTreeHostManager* window_tree_host_manager = |
| 67 Shell::GetInstance()->window_tree_host_manager(); | 71 Shell::GetInstance()->window_tree_host_manager(); |
| 68 EXPECT_EQ( | 72 EXPECT_EQ( |
| (...skipping 12 matching lines...) Expand all Loading... |
| 81 overlay.GetModifierKeyState(ui::EF_SHIFT_DOWN)); | 85 overlay.GetModifierKeyState(ui::EF_SHIFT_DOWN)); |
| 82 overlay.SetModifierKeyState(ui::EF_SHIFT_DOWN, STICKY_KEY_STATE_DISABLED); | 86 overlay.SetModifierKeyState(ui::EF_SHIFT_DOWN, STICKY_KEY_STATE_DISABLED); |
| 83 EXPECT_EQ(STICKY_KEY_STATE_DISABLED, | 87 EXPECT_EQ(STICKY_KEY_STATE_DISABLED, |
| 84 overlay.GetModifierKeyState(ui::EF_SHIFT_DOWN)); | 88 overlay.GetModifierKeyState(ui::EF_SHIFT_DOWN)); |
| 85 } | 89 } |
| 86 | 90 |
| 87 // Additional sticky key overlay tests that depend on chromeos::EventRewriter | 91 // Additional sticky key overlay tests that depend on chromeos::EventRewriter |
| 88 // are now in chrome/browser/chromeos/events/event_rewriter_unittest.cc . | 92 // are now in chrome/browser/chromeos/events/event_rewriter_unittest.cc . |
| 89 | 93 |
| 90 } // namespace ash | 94 } // namespace ash |
| OLD | NEW |