| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/api/socket/tls_socket.h" | 5 #include "extensions/browser/api/socket/tls_socket.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 class TLSSocketTest : public ::testing::Test { | 118 class TLSSocketTest : public ::testing::Test { |
| 119 public: | 119 public: |
| 120 TLSSocketTest() {} | 120 TLSSocketTest() {} |
| 121 | 121 |
| 122 void SetUp() override { | 122 void SetUp() override { |
| 123 net::AddressList address_list; | 123 net::AddressList address_list; |
| 124 // |ssl_socket_| is owned by |socket_|. TLSSocketTest keeps a pointer to | 124 // |ssl_socket_| is owned by |socket_|. TLSSocketTest keeps a pointer to |
| 125 // it to expect invocations from TLSSocket to |ssl_socket_|. | 125 // it to expect invocations from TLSSocket to |ssl_socket_|. |
| 126 scoped_ptr<MockSSLClientSocket> ssl_sock(new MockSSLClientSocket); | 126 scoped_ptr<MockSSLClientSocket> ssl_sock(new MockSSLClientSocket); |
| 127 ssl_socket_ = ssl_sock.get(); | 127 ssl_socket_ = ssl_sock.get(); |
| 128 socket_.reset(new TLSSocket(ssl_sock.Pass(), "test_extension_id")); | 128 socket_.reset(new TLSSocket(std::move(ssl_sock), "test_extension_id")); |
| 129 EXPECT_CALL(*ssl_socket_, Disconnect()).Times(1); | 129 EXPECT_CALL(*ssl_socket_, Disconnect()).Times(1); |
| 130 }; | 130 }; |
| 131 | 131 |
| 132 void TearDown() override { | 132 void TearDown() override { |
| 133 ssl_socket_ = NULL; | 133 ssl_socket_ = NULL; |
| 134 socket_.reset(); | 134 socket_.reset(); |
| 135 }; | 135 }; |
| 136 | 136 |
| 137 protected: | 137 protected: |
| 138 MockSSLClientSocket* ssl_socket_; | 138 MockSSLClientSocket* ssl_socket_; |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 total_bytes_written += amount_written_invocation; | 313 total_bytes_written += amount_written_invocation; |
| 314 cb.first.Run(amount_written_invocation); | 314 cb.first.Run(amount_written_invocation); |
| 315 } | 315 } |
| 316 | 316 |
| 317 ASSERT_EQ(total_bytes_requested, total_bytes_written) | 317 ASSERT_EQ(total_bytes_requested, total_bytes_written) |
| 318 << "There should be exactly as many bytes written as originally " | 318 << "There should be exactly as many bytes written as originally " |
| 319 << "requested to Write()."; | 319 << "requested to Write()."; |
| 320 } | 320 } |
| 321 | 321 |
| 322 } // namespace extensions | 322 } // namespace extensions |
| OLD | NEW |