Implement listing tests to a JSON file for iOS gtest test launcher
[chromium-blink-merge.git] / ash / sticky_keys / sticky_keys_overlay_unittest.cc
blobb6078255bb72b2d8ed6a4efe022721518e5430e2
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"
7 #include "ash/shell.h"
8 #include "ash/sticky_keys/sticky_keys_controller.h"
9 #include "ash/test/ash_test_base.h"
10 #include "ui/events/event.h"
12 namespace ash {
14 class StickyKeysOverlayTest : public test::AshTestBase {
15 public:
16 StickyKeysOverlayTest() {}
17 virtual ~StickyKeysOverlayTest() {}
20 TEST_F(StickyKeysOverlayTest, OverlayVisibility) {
21 StickyKeysOverlay overlay;
22 EXPECT_FALSE(overlay.is_visible());
23 overlay.Show(true);
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);
32 overlay.SetModifierKeyState(ui::EF_COMMAND_DOWN, STICKY_KEY_STATE_LOCKED);
34 EXPECT_EQ(STICKY_KEY_STATE_DISABLED,
35 overlay.GetModifierKeyState(ui::EF_SHIFT_DOWN));
36 EXPECT_EQ(STICKY_KEY_STATE_LOCKED,
37 overlay.GetModifierKeyState(ui::EF_ALT_DOWN));
38 EXPECT_EQ(STICKY_KEY_STATE_ENABLED,
39 overlay.GetModifierKeyState(ui::EF_CONTROL_DOWN));
40 EXPECT_EQ(STICKY_KEY_STATE_LOCKED,
41 overlay.GetModifierKeyState(ui::EF_COMMAND_DOWN));
44 // Additional sticky key overlay tests that depend on chromeos::EventRewriter
45 // are now in chrome/browser/chromeos/events/event_rewriter_unittest.cc .
47 } // namespace ash