Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(451)

Side by Side Diff: net/websockets/websocket_handshake_stream_create_helper_test.cc

Issue 2003253002: [Devtools] Allow User-Agent header override for Websockets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tests Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/websockets/websocket_end_to_end_test.cc ('k') | net/websockets/websocket_stream.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_handshake_stream_create_helper.h" 5 #include "net/websockets/websocket_handshake_stream_create_helper.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 const std::string& extra_request_headers, 78 const std::string& extra_request_headers,
79 const std::string& extra_response_headers) { 79 const std::string& extra_response_headers) {
80 static const char kOrigin[] = "http://localhost"; 80 static const char kOrigin[] = "http://localhost";
81 WebSocketHandshakeStreamCreateHelper create_helper(&connect_delegate_, 81 WebSocketHandshakeStreamCreateHelper create_helper(&connect_delegate_,
82 sub_protocols); 82 sub_protocols);
83 create_helper.set_failure_message(&failure_message_); 83 create_helper.set_failure_message(&failure_message_);
84 84
85 std::unique_ptr<ClientSocketHandle> socket_handle = 85 std::unique_ptr<ClientSocketHandle> socket_handle =
86 socket_handle_factory_.CreateClientSocketHandle( 86 socket_handle_factory_.CreateClientSocketHandle(
87 WebSocketStandardRequest("/", "localhost", 87 WebSocketStandardRequest("/", "localhost",
88 url::Origin(GURL(kOrigin)), 88 url::Origin(GURL(kOrigin)), "",
89 extra_request_headers), 89 extra_request_headers),
90 WebSocketStandardResponse(extra_response_headers)); 90 WebSocketStandardResponse(extra_response_headers));
91 91
92 std::unique_ptr<WebSocketHandshakeStreamBase> handshake( 92 std::unique_ptr<WebSocketHandshakeStreamBase> handshake(
93 create_helper.CreateBasicStream(std::move(socket_handle), false)); 93 create_helper.CreateBasicStream(std::move(socket_handle), false));
94 94
95 // If in future the implementation type returned by CreateBasicStream() 95 // If in future the implementation type returned by CreateBasicStream()
96 // changes, this static_cast will be wrong. However, in that case the test 96 // changes, this static_cast will be wrong. However, in that case the test
97 // will fail and AddressSanitizer should identify the issue. 97 // will fail and AddressSanitizer should identify the issue.
98 static_cast<WebSocketBasicHandshakeStream*>(handshake.get()) 98 static_cast<WebSocketBasicHandshakeStream*>(handshake.get())
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 177
178 EXPECT_EQ( 178 EXPECT_EQ(
179 "permessage-deflate;" 179 "permessage-deflate;"
180 " client_max_window_bits=14; server_max_window_bits=14;" 180 " client_max_window_bits=14; server_max_window_bits=14;"
181 " server_no_context_takeover; client_no_context_takeover", 181 " server_no_context_takeover; client_no_context_takeover",
182 stream->GetExtensions()); 182 stream->GetExtensions());
183 } 183 }
184 184
185 } // namespace 185 } // namespace
186 } // namespace net 186 } // namespace net
OLDNEW
« no previous file with comments | « net/websockets/websocket_end_to_end_test.cc ('k') | net/websockets/websocket_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698