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

Side by Side Diff: net/websockets/websocket_handshake_stream_create_helper_test.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_basic_handshake_stream.cc ('k') | net/websockets/websocket_stream.cc » ('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 <vector> 8 #include <vector>
9 9
10 #include "net/base/completion_callback.h" 10 #include "net/base/completion_callback.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 request_info.url = GURL(socket_url); 100 request_info.url = GURL(socket_url);
101 request_info.method = "GET"; 101 request_info.method = "GET";
102 request_info.load_flags = LOAD_DISABLE_CACHE | LOAD_DO_NOT_PROMPT_FOR_LOGIN; 102 request_info.load_flags = LOAD_DISABLE_CACHE | LOAD_DO_NOT_PROMPT_FOR_LOGIN;
103 int rv = handshake->InitializeStream( 103 int rv = handshake->InitializeStream(
104 &request_info, DEFAULT_PRIORITY, BoundNetLog(), CompletionCallback()); 104 &request_info, DEFAULT_PRIORITY, BoundNetLog(), CompletionCallback());
105 EXPECT_EQ(OK, rv); 105 EXPECT_EQ(OK, rv);
106 106
107 HttpRequestHeaders headers; 107 HttpRequestHeaders headers;
108 headers.SetHeader("Host", "localhost"); 108 headers.SetHeader("Host", "localhost");
109 headers.SetHeader("Connection", "Upgrade"); 109 headers.SetHeader("Connection", "Upgrade");
110 headers.SetHeader("Pragma", "no-cache");
111 headers.SetHeader("Cache-Control", "no-cache");
110 headers.SetHeader("Upgrade", "websocket"); 112 headers.SetHeader("Upgrade", "websocket");
111 headers.SetHeader("Origin", origin); 113 headers.SetHeader("Origin", origin);
112 headers.SetHeader("Sec-WebSocket-Version", "13"); 114 headers.SetHeader("Sec-WebSocket-Version", "13");
113 headers.SetHeader("User-Agent", ""); 115 headers.SetHeader("User-Agent", "");
114 headers.SetHeader("Accept-Encoding", "gzip,deflate"); 116 headers.SetHeader("Accept-Encoding", "gzip,deflate");
115 headers.SetHeader("Accept-Language", "en-us,fr"); 117 headers.SetHeader("Accept-Language", "en-us,fr");
116 118
117 HttpResponseInfo response; 119 HttpResponseInfo response;
118 TestCompletionCallback dummy; 120 TestCompletionCallback dummy;
119 121
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 188
187 EXPECT_EQ( 189 EXPECT_EQ(
188 "permessage-deflate;" 190 "permessage-deflate;"
189 " client_max_window_bits=14; server_max_window_bits=14;" 191 " client_max_window_bits=14; server_max_window_bits=14;"
190 " server_no_context_takeover; client_no_context_takeover", 192 " server_no_context_takeover; client_no_context_takeover",
191 stream->GetExtensions()); 193 stream->GetExtensions());
192 } 194 }
193 195
194 } // namespace 196 } // namespace
195 } // namespace net 197 } // namespace net
OLDNEW
« no previous file with comments | « net/websockets/websocket_basic_handshake_stream.cc ('k') | net/websockets/websocket_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698