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
3 // found in the LICENSE file.
5 #include "ash/sticky_keys/sticky_keys_overlay.h"
8 #include "ash/sticky_keys/sticky_keys_controller.h"
9 #include "ash/test/ash_test_base.h"
10 #include "ui/events/event.h"
14 class StickyKeysOverlayTest
: public test::AshTestBase
{
16 StickyKeysOverlayTest() {}
17 virtual ~StickyKeysOverlayTest() {}
20 TEST_F(StickyKeysOverlayTest
, OverlayVisibility
) {
21 StickyKeysOverlay overlay
;
22 EXPECT_FALSE(overlay
.is_visible());
24 EXPECT_TRUE(overlay
.is_visible());
27 TEST_F(StickyKeysOverlayTest
, ModifierKeyState
) {
28 StickyKeysOverlay overlay
;
29 overlay
.SetModifierKeyState(ui::EF_SHIFT_DOWN
, STICKY_KEY_STATE_DISABLED
);
30 overlay
.SetModifierKeyState(ui::EF_ALT_DOWN
, STICKY_KEY_STATE_LOCKED
);
31 overlay
.SetModifierKeyState(ui::EF_CONTROL_DOWN
, STICKY_KEY_STATE_ENABLED
);
33 EXPECT_EQ(STICKY_KEY_STATE_DISABLED
,
34 overlay
.GetModifierKeyState(ui::EF_SHIFT_DOWN
));
35 EXPECT_EQ(STICKY_KEY_STATE_LOCKED
,
36 overlay
.GetModifierKeyState(ui::EF_ALT_DOWN
));
37 EXPECT_EQ(STICKY_KEY_STATE_ENABLED
,
38 overlay
.GetModifierKeyState(ui::EF_CONTROL_DOWN
));
41 // Additional sticky key overlay tests that depend on chromeos::EventRewriter
42 // are now in chrome/browser/chromeos/events/event_rewriter_unittest.cc .