| OLD | NEW | 
|    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  Loading... | 
|  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  Loading... | 
|  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 | 
| OLD | NEW |