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

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

Issue 2628333003: Cancel URLRequest with an appropriate code when WebSocket handshake succeeds (Closed)
Patch Set: fix Created 3 years, 11 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_stream_test.cc ('k') | no next file » | 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 #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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 // Allow a proxy to be set. Usage: 119 // Allow a proxy to be set. Usage:
120 // SetProxyConfig("proxy1:8000"); 120 // SetProxyConfig("proxy1:8000");
121 // Any syntax accepted by net::ProxyConfig::ParseFromString() will work. 121 // Any syntax accepted by net::ProxyConfig::ParseFromString() will work.
122 // Do not call after GetURLRequestContext() has been called. 122 // Do not call after GetURLRequestContext() has been called.
123 void SetProxyConfig(const std::string& proxy_rules); 123 void SetProxyConfig(const std::string& proxy_rules);
124 124
125 // Call after calling one of SetExpections() or AddRawExpectations(). The 125 // Call after calling one of SetExpections() or AddRawExpectations(). The
126 // returned pointer remains owned by this object. 126 // returned pointer remains owned by this object.
127 TestURLRequestContext* GetURLRequestContext(); 127 TestURLRequestContext* GetURLRequestContext();
128 128
129 const TestNetworkDelegate& network_delegate() const {
130 return network_delegate_;
131 }
132
129 private: 133 private:
130 WebSocketMockClientSocketFactoryMaker maker_; 134 WebSocketMockClientSocketFactoryMaker maker_;
131 TestURLRequestContext url_request_context_; 135 TestURLRequestContext url_request_context_;
132 TestNetworkDelegate network_delegate_; 136 TestNetworkDelegate network_delegate_;
133 std::unique_ptr<ProxyService> proxy_service_; 137 std::unique_ptr<ProxyService> proxy_service_;
134 bool url_request_context_initialized_; 138 bool url_request_context_initialized_;
135 139
136 DISALLOW_COPY_AND_ASSIGN(WebSocketTestURLRequestContextHost); 140 DISALLOW_COPY_AND_ASSIGN(WebSocketTestURLRequestContextHost);
137 }; 141 };
138 142
139 } // namespace net 143 } // namespace net
140 144
141 #endif // NET_WEBSOCKETS_WEBSOCKET_TEST_UTIL_H_ 145 #endif // NET_WEBSOCKETS_WEBSOCKET_TEST_UTIL_H_
OLDNEW
« no previous file with comments | « net/websockets/websocket_stream_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698