| 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 return arg.mime_type() == mime_type && arg.data() == data; | |
| 20 } | |
| 21 | |
| 22 static ClipboardEvent MakeClipboardEvent(const std::string& mime_type, | 19 static ClipboardEvent MakeClipboardEvent(const std::string& mime_type, |
| 23 const std::string& data) { | 20 const std::string& data) { |
| 24 ClipboardEvent event; | 21 ClipboardEvent event; |
| 25 event.set_mime_type(mime_type); | 22 event.set_mime_type(mime_type); |
| 26 event.set_data(data); | 23 event.set_data(data); |
| 27 return event; | 24 return event; |
| 28 } | 25 } |
| 29 | 26 |
| 30 // Check that the filter only filters out events identical to the latest | 27 // Check that the filter only filters out events identical to the latest |
| 31 // clipboard item from the client. | 28 // clipboard item from the client. |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 99 |
| 103 filter.set_host_stub(&host_stub); | 100 filter.set_host_stub(&host_stub); |
| 104 filter.client_filter()->InjectClipboardEvent(event); | 101 filter.client_filter()->InjectClipboardEvent(event); |
| 105 | 102 |
| 106 filter.set_client_stub(&client_stub); | 103 filter.set_client_stub(&client_stub); |
| 107 filter.client_filter()->InjectClipboardEvent(event); | 104 filter.client_filter()->InjectClipboardEvent(event); |
| 108 } | 105 } |
| 109 | 106 |
| 110 } // namespace protocol | 107 } // namespace protocol |
| 111 } // namespace remoting | 108 } // namespace remoting |
| OLD | NEW |