| 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/clipboard_echo_filter.h" | 5 #include "remoting/protocol/clipboard_echo_filter.h" |
| 6 | 6 |
| 7 #include "remoting/proto/event.pb.h" | 7 #include "remoting/proto/event.pb.h" |
| 8 #include "remoting/protocol/protocol_mock_objects.h" | 8 #include "remoting/protocol/protocol_mock_objects.h" |
| 9 #include "remoting/protocol/test_event_matchers.h" |
| 9 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 12 |
| 12 using ::testing::_; | 13 using ::testing::_; |
| 13 using ::testing::InSequence; | 14 using ::testing::InSequence; |
| 14 | 15 |
| 15 namespace remoting { | 16 namespace remoting { |
| 16 namespace protocol { | 17 namespace protocol { |
| 17 | 18 |
| 18 MATCHER_P2(EqualsClipboardEvent, mime_type, data, "") { | 19 using test::EqualsClipboardEvent; |
| 19 return arg.mime_type() == mime_type && arg.data() == data; | |
| 20 } | |
| 21 | 20 |
| 22 static ClipboardEvent MakeClipboardEvent(const std::string& mime_type, | 21 static ClipboardEvent MakeClipboardEvent(const std::string& mime_type, |
| 23 const std::string& data) { | 22 const std::string& data) { |
| 24 ClipboardEvent event; | 23 ClipboardEvent event; |
| 25 event.set_mime_type(mime_type); | 24 event.set_mime_type(mime_type); |
| 26 event.set_data(data); | 25 event.set_data(data); |
| 27 return event; | 26 return event; |
| 28 } | 27 } |
| 29 | 28 |
| 30 // Check that the filter only filters out events identical to the latest | 29 // Check that the filter only filters out events identical to the latest |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 101 |
| 103 filter.set_host_stub(&host_stub); | 102 filter.set_host_stub(&host_stub); |
| 104 filter.client_filter()->InjectClipboardEvent(event); | 103 filter.client_filter()->InjectClipboardEvent(event); |
| 105 | 104 |
| 106 filter.set_client_stub(&client_stub); | 105 filter.set_client_stub(&client_stub); |
| 107 filter.client_filter()->InjectClipboardEvent(event); | 106 filter.client_filter()->InjectClipboardEvent(event); |
| 108 } | 107 } |
| 109 | 108 |
| 110 } // namespace protocol | 109 } // namespace protocol |
| 111 } // namespace remoting | 110 } // namespace remoting |
| OLD | NEW |