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

Side by Side Diff: ash/sticky_keys/sticky_keys_overlay_unittest.cc

Issue 2886253002: mash: remove more shell/shelf WmWindow usage. (Closed)
Patch Set: Fix WmShelf::ForWindow. Created 3 years, 7 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/shell_unittest.cc ('k') | ash/system/palette/palette_utils.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/sticky_keys/sticky_keys_overlay.h" 5 #include "ash/sticky_keys/sticky_keys_overlay.h"
6 6
7 #include "ash/public/cpp/config.h" 7 #include "ash/public/cpp/config.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/shell_port.h" 9 #include "ash/shell_port.h"
10 #include "ash/sticky_keys/sticky_keys_controller.h" 10 #include "ash/sticky_keys/sticky_keys_controller.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 // http://crbug.com/696754. 61 // http://crbug.com/696754.
62 if (Shell::GetAshConfig() == Config::MASH) 62 if (Shell::GetAshConfig() == Config::MASH)
63 return; 63 return;
64 display_manager()->SetLayoutForCurrentDisplays( 64 display_manager()->SetLayoutForCurrentDisplays(
65 display::test::CreateDisplayLayout(display_manager(), 65 display::test::CreateDisplayLayout(display_manager(),
66 display::DisplayPlacement::LEFT, 0)); 66 display::DisplayPlacement::LEFT, 0));
67 67
68 // The overlay should belong to the secondary root window. 68 // The overlay should belong to the secondary root window.
69 StickyKeysOverlay overlay; 69 StickyKeysOverlay overlay;
70 views::Widget* overlay_widget = overlay.GetWidgetForTesting(); 70 views::Widget* overlay_widget = overlay.GetWidgetForTesting();
71 EXPECT_EQ(ShellPort::Get() 71 EXPECT_EQ(ShellPort::Get()->GetRootWindowForDisplayId(secondary_display_id),
72 ->GetRootWindowForDisplayId(secondary_display_id)
73 ->aura_window(),
74 overlay_widget->GetNativeWindow()->GetRootWindow()); 72 overlay_widget->GetNativeWindow()->GetRootWindow());
75 73
76 // Removing the second display should move the overlay to the primary root 74 // Removing the second display should move the overlay to the primary root
77 // window. 75 // window.
78 UpdateDisplay("1280x1024"); 76 UpdateDisplay("1280x1024");
79 EXPECT_EQ(ShellPort::Get() 77 EXPECT_EQ(ShellPort::Get()->GetRootWindowForDisplayId(primary_display_id),
80 ->GetRootWindowForDisplayId(primary_display_id)
81 ->aura_window(),
82 overlay_widget->GetNativeWindow()->GetRootWindow()); 78 overlay_widget->GetNativeWindow()->GetRootWindow());
83 79
84 overlay.SetModifierKeyState(ui::EF_SHIFT_DOWN, STICKY_KEY_STATE_ENABLED); 80 overlay.SetModifierKeyState(ui::EF_SHIFT_DOWN, STICKY_KEY_STATE_ENABLED);
85 EXPECT_EQ(STICKY_KEY_STATE_ENABLED, 81 EXPECT_EQ(STICKY_KEY_STATE_ENABLED,
86 overlay.GetModifierKeyState(ui::EF_SHIFT_DOWN)); 82 overlay.GetModifierKeyState(ui::EF_SHIFT_DOWN));
87 overlay.SetModifierKeyState(ui::EF_SHIFT_DOWN, STICKY_KEY_STATE_DISABLED); 83 overlay.SetModifierKeyState(ui::EF_SHIFT_DOWN, STICKY_KEY_STATE_DISABLED);
88 EXPECT_EQ(STICKY_KEY_STATE_DISABLED, 84 EXPECT_EQ(STICKY_KEY_STATE_DISABLED,
89 overlay.GetModifierKeyState(ui::EF_SHIFT_DOWN)); 85 overlay.GetModifierKeyState(ui::EF_SHIFT_DOWN));
90 } 86 }
91 87
92 // Additional sticky key overlay tests that depend on ui::EventRewriterChromeOS 88 // Additional sticky key overlay tests that depend on ui::EventRewriterChromeOS
93 // are now in chrome/browser/chromeos/events/event_rewriter_unittest.cc . 89 // are now in chrome/browser/chromeos/events/event_rewriter_unittest.cc .
94 90
95 } // namespace ash 91 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell_unittest.cc ('k') | ash/system/palette/palette_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698