| 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/protocol_mock_objects.h" | 5 #include "remoting/protocol/protocol_mock_objects.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 MockCursorShapeStub::~MockCursorShapeStub() {} | 44 MockCursorShapeStub::~MockCursorShapeStub() {} |
| 45 | 45 |
| 46 MockVideoStub::MockVideoStub() {} | 46 MockVideoStub::MockVideoStub() {} |
| 47 | 47 |
| 48 MockVideoStub::~MockVideoStub() {} | 48 MockVideoStub::~MockVideoStub() {} |
| 49 | 49 |
| 50 MockSession::MockSession() {} | 50 MockSession::MockSession() {} |
| 51 | 51 |
| 52 MockSession::~MockSession() {} | 52 MockSession::~MockSession() {} |
| 53 | 53 |
| 54 void MockSession::AddPlugin(SessionPlugin* plugin) { |
| 55 DCHECK(plugin); |
| 56 for (const auto& message : attachments_) { |
| 57 if (message.attachments) { |
| 58 plugin->OnIncomingMessage(*(message.attachments)); |
| 59 } |
| 60 } |
| 61 } |
| 62 |
| 63 void MockSession::SetAttachment(size_t round, |
| 64 std::unique_ptr<buzz::XmlElement> attachment) { |
| 65 while (attachments_.size() <= round) { |
| 66 attachments_.emplace_back(); |
| 67 } |
| 68 attachments_[round].AddAttachment(std::move(attachment)); |
| 69 } |
| 70 |
| 54 MockSessionManager::MockSessionManager() {} | 71 MockSessionManager::MockSessionManager() {} |
| 55 | 72 |
| 56 MockSessionManager::~MockSessionManager() {} | 73 MockSessionManager::~MockSessionManager() {} |
| 57 | 74 |
| 58 MockPairingRegistryDelegate::MockPairingRegistryDelegate() { | 75 MockPairingRegistryDelegate::MockPairingRegistryDelegate() { |
| 59 } | 76 } |
| 60 | 77 |
| 61 MockPairingRegistryDelegate::~MockPairingRegistryDelegate() { | 78 MockPairingRegistryDelegate::~MockPairingRegistryDelegate() { |
| 62 } | 79 } |
| 63 | 80 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 void SynchronousPairingRegistry::PostTask( | 122 void SynchronousPairingRegistry::PostTask( |
| 106 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 123 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 107 const tracked_objects::Location& from_here, | 124 const tracked_objects::Location& from_here, |
| 108 const base::Closure& task) { | 125 const base::Closure& task) { |
| 109 DCHECK(task_runner->BelongsToCurrentThread()); | 126 DCHECK(task_runner->BelongsToCurrentThread()); |
| 110 task.Run(); | 127 task.Run(); |
| 111 } | 128 } |
| 112 | 129 |
| 113 } // namespace protocol | 130 } // namespace protocol |
| 114 } // namespace remoting | 131 } // namespace remoting |
| OLD | NEW |