| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "blimp/net/test_common.h" | 5 #include "blimp/net/test_common.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/sys_byteorder.h" | 10 #include "base/sys_byteorder.h" |
| 11 #include "blimp/common/proto/blimp_message.pb.h" | 11 #include "blimp/common/proto/blimp_message.pb.h" |
| 12 #include "blimp/net/blimp_connection.h" | 12 #include "blimp/net/blimp_connection.h" |
| 13 #include "blimp/net/common.h" | 13 #include "blimp/net/common.h" |
| 14 #include "blimp/net/message_port.h" |
| 14 #include "net/base/io_buffer.h" | 15 #include "net/base/io_buffer.h" |
| 15 | 16 |
| 16 namespace blimp { | 17 namespace blimp { |
| 17 | 18 |
| 18 MockStreamSocket::MockStreamSocket() {} | 19 MockStreamSocket::MockStreamSocket() {} |
| 19 | 20 |
| 20 MockStreamSocket::~MockStreamSocket() {} | 21 MockStreamSocket::~MockStreamSocket() {} |
| 21 | 22 |
| 22 MockTransport::MockTransport() {} | 23 MockTransport::MockTransport() {} |
| 23 | 24 |
| 24 MockTransport::~MockTransport() {} | 25 MockTransport::~MockTransport() {} |
| 25 | 26 |
| 26 std::unique_ptr<BlimpConnection> MockTransport::TakeConnection() { | 27 std::unique_ptr<MessagePort> MockTransport::TakeMessagePort() { |
| 27 return base::WrapUnique(TakeConnectionPtr()); | 28 return base::WrapUnique(TakeMessagePortPtr()); |
| 28 } | 29 } |
| 29 | 30 |
| 30 const char* MockTransport::GetName() const { | 31 const char* MockTransport::GetName() const { |
| 31 return "mock"; | 32 return "mock"; |
| 32 } | 33 } |
| 33 | 34 |
| 34 MockConnectionHandler::MockConnectionHandler() {} | 35 MockConnectionHandler::MockConnectionHandler() {} |
| 35 | 36 |
| 36 MockConnectionHandler::~MockConnectionHandler() {} | 37 MockConnectionHandler::~MockConnectionHandler() {} |
| 37 | 38 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 } | 75 } |
| 75 | 76 |
| 76 bool BufferStartsWith(net::GrowableIOBuffer* buf, | 77 bool BufferStartsWith(net::GrowableIOBuffer* buf, |
| 77 size_t buf_size, | 78 size_t buf_size, |
| 78 const std::string& str) { | 79 const std::string& str) { |
| 79 return (buf_size >= str.size() && | 80 return (buf_size >= str.size() && |
| 80 str == std::string(buf->data(), str.size())); | 81 str == std::string(buf->data(), str.size())); |
| 81 } | 82 } |
| 82 | 83 |
| 83 } // namespace blimp | 84 } // namespace blimp |
| OLD | NEW |