OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "remoting/protocol/input_filter.h" | 5 #include "remoting/protocol/input_filter.h" |
6 | 6 |
| 7 #include <stdint.h> |
| 8 |
7 #include "remoting/proto/event.pb.h" | 9 #include "remoting/proto/event.pb.h" |
8 #include "remoting/protocol/protocol_mock_objects.h" | 10 #include "remoting/protocol/protocol_mock_objects.h" |
9 #include "remoting/protocol/test_event_matchers.h" | 11 #include "remoting/protocol/test_event_matchers.h" |
10 #include "testing/gmock/include/gmock/gmock.h" | 12 #include "testing/gmock/include/gmock/gmock.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
12 | 14 |
13 using ::testing::_; | 15 using ::testing::_; |
14 | 16 |
15 namespace remoting { | 17 namespace remoting { |
16 namespace protocol { | 18 namespace protocol { |
17 | 19 |
18 using test::EqualsKeyEvent; | 20 using test::EqualsKeyEvent; |
19 using test::EqualsMouseMoveEvent; | 21 using test::EqualsMouseMoveEvent; |
20 using test::EqualsTextEvent; | 22 using test::EqualsTextEvent; |
21 | 23 |
22 static KeyEvent NewKeyEvent(uint32 usb_keycode, bool pressed) { | 24 static KeyEvent NewKeyEvent(uint32_t usb_keycode, bool pressed) { |
23 KeyEvent event; | 25 KeyEvent event; |
24 event.set_usb_keycode(usb_keycode); | 26 event.set_usb_keycode(usb_keycode); |
25 event.set_pressed(pressed); | 27 event.set_pressed(pressed); |
26 return event; | 28 return event; |
27 } | 29 } |
28 | 30 |
29 static TextEvent NewTextEvent(const std::string& text) { | 31 static TextEvent NewTextEvent(const std::string& text) { |
30 TextEvent event; | 32 TextEvent event; |
31 event.set_text(text); | 33 event.set_text(text); |
32 return event; | 34 return event; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 77 |
76 // Verify that the filter ignores events if not configured. | 78 // Verify that the filter ignores events if not configured. |
77 TEST(InputFilterTest, IgnoreEventsIfNotConfigured) { | 79 TEST(InputFilterTest, IgnoreEventsIfNotConfigured) { |
78 InputFilter input_filter; | 80 InputFilter input_filter; |
79 | 81 |
80 InjectTestSequence(&input_filter); | 82 InjectTestSequence(&input_filter); |
81 } | 83 } |
82 | 84 |
83 } // namespace protocol | 85 } // namespace protocol |
84 } // namespace remoting | 86 } // namespace remoting |
OLD | NEW |