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

Side by Side Diff: media/base/keyboard_event_counter_unittest.cc

Issue 2577573002: Removes mouse listeners from UserInputMonitor. (Closed)
Patch Set: Fix win by removing std::move. Created 3 years, 11 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 | « media/base/keyboard_event_counter.cc ('k') | media/base/user_input_monitor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 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.
4
5 #include "media/base/keyboard_event_counter.h"
6
7 #include <memory>
8
9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h"
11 #include "base/run_loop.h"
12 #include "build/build_config.h"
13 #include "testing/gmock/include/gmock/gmock.h"
14 #include "testing/gtest/include/gtest/gtest.h"
15 #include "third_party/skia/include/core/SkPoint.h"
16
17 namespace media {
18
19 TEST(KeyboardEventCounterTest, KeyPressCounter) {
20 KeyboardEventCounter counter;
21
22 EXPECT_EQ(0u, counter.GetKeyPressCount());
23
24 counter.OnKeyboardEvent(ui::ET_KEY_PRESSED, ui::VKEY_0);
25 EXPECT_EQ(1u, counter.GetKeyPressCount());
26
27 // Holding the same key without releasing it does not increase the count.
28 counter.OnKeyboardEvent(ui::ET_KEY_PRESSED, ui::VKEY_0);
29 EXPECT_EQ(1u, counter.GetKeyPressCount());
30
31 // Releasing the key does not affect the total count.
32 counter.OnKeyboardEvent(ui::ET_KEY_RELEASED, ui::VKEY_0);
33 EXPECT_EQ(1u, counter.GetKeyPressCount());
34
35 counter.OnKeyboardEvent(ui::ET_KEY_PRESSED, ui::VKEY_0);
36 counter.OnKeyboardEvent(ui::ET_KEY_RELEASED, ui::VKEY_0);
37 EXPECT_EQ(2u, counter.GetKeyPressCount());
38 }
39
40 } // namespace media
OLDNEW
« no previous file with comments | « media/base/keyboard_event_counter.cc ('k') | media/base/user_input_monitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698