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

Side by Side Diff: net/websockets/websocket_test_util.h

Issue 170843007: Introduce url::Origin to represent Web Origin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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
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 #ifndef NET_WEBSOCKETS_WEBSOCKET_TEST_UTIL_H_ 5 #ifndef NET_WEBSOCKETS_WEBSOCKET_TEST_UTIL_H_
6 #define NET_WEBSOCKETS_WEBSOCKET_TEST_UTIL_H_ 6 #define NET_WEBSOCKETS_WEBSOCKET_TEST_UTIL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 20 matching lines...) Expand all
31 uint64 current_; 31 uint64 current_;
32 }; 32 };
33 33
34 // Alternate version of WebSocketStream::CreateAndConnectStream() for testing 34 // Alternate version of WebSocketStream::CreateAndConnectStream() for testing
35 // use only. The difference is the use of a |create_helper| argument in place of 35 // use only. The difference is the use of a |create_helper| argument in place of
36 // |requested_subprotocols|. Implemented in websocket_stream.cc. 36 // |requested_subprotocols|. Implemented in websocket_stream.cc.
37 NET_EXPORT_PRIVATE extern scoped_ptr<WebSocketStreamRequest> 37 NET_EXPORT_PRIVATE extern scoped_ptr<WebSocketStreamRequest>
38 CreateAndConnectStreamForTesting( 38 CreateAndConnectStreamForTesting(
39 const GURL& socket_url, 39 const GURL& socket_url,
40 scoped_ptr<WebSocketHandshakeStreamCreateHelper> create_helper, 40 scoped_ptr<WebSocketHandshakeStreamCreateHelper> create_helper,
41 const GURL& origin, 41 const std::string& origin,
42 URLRequestContext* url_request_context, 42 URLRequestContext* url_request_context,
43 const BoundNetLog& net_log, 43 const BoundNetLog& net_log,
44 scoped_ptr<WebSocketStream::ConnectDelegate> connect_delegate); 44 scoped_ptr<WebSocketStream::ConnectDelegate> connect_delegate);
45 45
46 // Generates a standard WebSocket handshake request. The challenge key used is 46 // Generates a standard WebSocket handshake request. The challenge key used is
47 // "dGhlIHNhbXBsZSBub25jZQ==". Each header in |extra_headers| must be terminated 47 // "dGhlIHNhbXBsZSBub25jZQ==". Each header in |extra_headers| must be terminated
48 // with "\r\n". 48 // with "\r\n".
49 extern std::string WebSocketStandardRequest(const std::string& path, 49 extern std::string WebSocketStandardRequest(const std::string& path,
50 const std::string& origin, 50 const std::string& origin,
51 const std::string& extra_headers); 51 const std::string& extra_headers);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 WebSocketDeterministicMockClientSocketFactoryMaker maker_; 105 WebSocketDeterministicMockClientSocketFactoryMaker maker_;
106 TestURLRequestContext url_request_context_; 106 TestURLRequestContext url_request_context_;
107 TestNetworkDelegate network_delegate_; 107 TestNetworkDelegate network_delegate_;
108 108
109 DISALLOW_COPY_AND_ASSIGN(WebSocketTestURLRequestContextHost); 109 DISALLOW_COPY_AND_ASSIGN(WebSocketTestURLRequestContextHost);
110 }; 110 };
111 111
112 } // namespace net 112 } // namespace net
113 113
114 #endif // NET_WEBSOCKETS_WEBSOCKET_TEST_UTIL_H_ 114 #endif // NET_WEBSOCKETS_WEBSOCKET_TEST_UTIL_H_
OLDNEW
« net/websockets/websocket_channel.h ('K') | « net/websockets/websocket_stream_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698