OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "net/websockets/websocket_stream.h" | 5 #include "net/websockets/websocket_stream.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 MockWrite (&writes)[writes_count]) { | 55 MockWrite (&writes)[writes_count]) { |
56 std::unique_ptr<SequencedSocketData> socket_data( | 56 std::unique_ptr<SequencedSocketData> socket_data( |
57 new SequencedSocketData(reads, reads_count, writes, writes_count)); | 57 new SequencedSocketData(reads, reads_count, writes, writes_count)); |
58 socket_data->set_connect_data(MockConnect(SYNCHRONOUS, OK)); | 58 socket_data->set_connect_data(MockConnect(SYNCHRONOUS, OK)); |
59 return socket_data; | 59 return socket_data; |
60 } | 60 } |
61 | 61 |
62 // Builder for a SequencedSocketData that expects nothing. This does not | 62 // Builder for a SequencedSocketData that expects nothing. This does not |
63 // set the connect data, so the calling code must do that explicitly. | 63 // set the connect data, so the calling code must do that explicitly. |
64 std::unique_ptr<SequencedSocketData> BuildNullSocketData() { | 64 std::unique_ptr<SequencedSocketData> BuildNullSocketData() { |
65 return base::WrapUnique(new SequencedSocketData(NULL, 0, NULL, 0)); | 65 return base::MakeUnique<SequencedSocketData>(NULL, 0, NULL, 0); |
66 } | 66 } |
67 | 67 |
68 class MockWeakTimer : public base::MockTimer, | 68 class MockWeakTimer : public base::MockTimer, |
69 public base::SupportsWeakPtr<MockWeakTimer> { | 69 public base::SupportsWeakPtr<MockWeakTimer> { |
70 public: | 70 public: |
71 MockWeakTimer(bool retain_user_task, bool is_repeating) | 71 MockWeakTimer(bool retain_user_task, bool is_repeating) |
72 : MockTimer(retain_user_task, is_repeating) {} | 72 : MockTimer(retain_user_task, is_repeating) {} |
73 }; | 73 }; |
74 | 74 |
75 static url::Origin LocalhostOrigin() { | 75 static url::Origin LocalhostOrigin() { |
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1256 LocalhostOrigin(), LocalhostUrl(), "", | 1256 LocalhostOrigin(), LocalhostUrl(), "", |
1257 std::move(socket_data)); | 1257 std::move(socket_data)); |
1258 WaitUntilConnectDone(); | 1258 WaitUntilConnectDone(); |
1259 EXPECT_TRUE(has_failed()); | 1259 EXPECT_TRUE(has_failed()); |
1260 EXPECT_EQ("Establishing a tunnel via proxy server failed.", | 1260 EXPECT_EQ("Establishing a tunnel via proxy server failed.", |
1261 failure_message()); | 1261 failure_message()); |
1262 } | 1262 } |
1263 | 1263 |
1264 } // namespace | 1264 } // namespace |
1265 } // namespace net | 1265 } // namespace net |
OLD | NEW |