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

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

Issue 152483003: [WebSocket] Add Cache-Control to the request header. (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
« 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 #include "net/websockets/websocket_test_util.h" 5 #include "net/websockets/websocket_test_util.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "net/socket/socket_test_util.h" 9 #include "net/socket/socket_test_util.h"
10 10
(...skipping 19 matching lines...) Expand all
30 std::string WebSocketStandardRequest(const std::string& path, 30 std::string WebSocketStandardRequest(const std::string& path,
31 const std::string& origin, 31 const std::string& origin,
32 const std::string& extra_headers) { 32 const std::string& extra_headers) {
33 // Unrelated changes in net/http may change the order and default-values of 33 // Unrelated changes in net/http may change the order and default-values of
34 // HTTP headers, causing WebSocket tests to fail. It is safe to update this 34 // HTTP headers, causing WebSocket tests to fail. It is safe to update this
35 // string in that case. 35 // string in that case.
36 return base::StringPrintf( 36 return base::StringPrintf(
37 "GET %s HTTP/1.1\r\n" 37 "GET %s HTTP/1.1\r\n"
38 "Host: localhost\r\n" 38 "Host: localhost\r\n"
39 "Connection: Upgrade\r\n" 39 "Connection: Upgrade\r\n"
40 "Pragma: no-cache\r\n"
41 "Cache-Control: no-cache\r\n"
40 "Upgrade: websocket\r\n" 42 "Upgrade: websocket\r\n"
41 "Origin: %s\r\n" 43 "Origin: %s\r\n"
42 "Sec-WebSocket-Version: 13\r\n" 44 "Sec-WebSocket-Version: 13\r\n"
43 "User-Agent:\r\n" 45 "User-Agent:\r\n"
44 "Accept-Encoding: gzip,deflate\r\n" 46 "Accept-Encoding: gzip,deflate\r\n"
45 "Accept-Language: en-us,fr\r\n" 47 "Accept-Language: en-us,fr\r\n"
46 "Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r\n" 48 "Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r\n"
47 "Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits\r\n" 49 "Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits\r\n"
48 "%s\r\n", 50 "%s\r\n",
49 path.c_str(), 51 path.c_str(),
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 125
124 TestURLRequestContext* 126 TestURLRequestContext*
125 WebSocketTestURLRequestContextHost::GetURLRequestContext() { 127 WebSocketTestURLRequestContextHost::GetURLRequestContext() {
126 url_request_context_.Init(); 128 url_request_context_.Init();
127 // A Network Delegate is required to make the URLRequest::Delegate work. 129 // A Network Delegate is required to make the URLRequest::Delegate work.
128 url_request_context_.set_network_delegate(&network_delegate_); 130 url_request_context_.set_network_delegate(&network_delegate_);
129 return &url_request_context_; 131 return &url_request_context_;
130 } 132 }
131 133
132 } // namespace net 134 } // namespace net
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