| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // End-to-end tests for WebSocket. | 5 // End-to-end tests for WebSocket. |
| 6 // | 6 // |
| 7 // A python server is (re)started for each test, which is moderately | 7 // A python server is (re)started for each test, which is moderately |
| 8 // inefficient. However, it makes these tests a good fit for scenarios which | 8 // inefficient. However, it makes these tests a good fit for scenarios which |
| 9 // require special server configurations. | 9 // require special server configurations. |
| 10 | 10 |
| 11 #include <stdint.h> | 11 #include <stdint.h> |
| 12 |
| 12 #include <string> | 13 #include <string> |
| 13 | 14 |
| 14 #include "base/bind.h" | 15 #include "base/bind.h" |
| 15 #include "base/bind_helpers.h" | 16 #include "base/bind_helpers.h" |
| 16 #include "base/callback.h" | 17 #include "base/callback.h" |
| 17 #include "base/location.h" | 18 #include "base/location.h" |
| 18 #include "base/macros.h" | 19 #include "base/macros.h" |
| 19 #include "base/memory/scoped_ptr.h" | 20 #include "base/memory/scoped_ptr.h" |
| 20 #include "base/run_loop.h" | 21 #include "base/run_loop.h" |
| 21 #include "base/single_thread_task_runner.h" | 22 #include "base/single_thread_task_runner.h" |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 GURL url; | 204 GURL url; |
| 204 ProxyInfo proxy_info; | 205 ProxyInfo proxy_info; |
| 205 }; | 206 }; |
| 206 | 207 |
| 207 const ResolvedProxyInfo& resolved_proxy_info() const { | 208 const ResolvedProxyInfo& resolved_proxy_info() const { |
| 208 return resolved_proxy_info_; | 209 return resolved_proxy_info_; |
| 209 } | 210 } |
| 210 | 211 |
| 211 protected: | 212 protected: |
| 212 void OnResolveProxy(const GURL& url, | 213 void OnResolveProxy(const GURL& url, |
| 214 const std::string& method, |
| 213 int load_flags, | 215 int load_flags, |
| 214 const ProxyService& proxy_service, | 216 const ProxyService& proxy_service, |
| 215 ProxyInfo* result) override { | 217 ProxyInfo* result) override { |
| 216 resolved_proxy_info_.url = url; | 218 resolved_proxy_info_.url = url; |
| 217 resolved_proxy_info_.proxy_info = *result; | 219 resolved_proxy_info_.proxy_info = *result; |
| 218 } | 220 } |
| 219 | 221 |
| 220 void OnTunnelConnectCompleted(const HostPortPair& endpoint, | 222 void OnTunnelConnectCompleted(const HostPortPair& endpoint, |
| 221 const HostPortPair& proxy_server, | 223 const HostPortPair& proxy_server, |
| 222 int net_error) override {} | 224 int net_error) override {} |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 GURL ws_url = ws_server.GetURL("header-continuation"); | 512 GURL ws_url = ws_server.GetURL("header-continuation"); |
| 511 | 513 |
| 512 EXPECT_TRUE(ConnectAndWait(ws_url)); | 514 EXPECT_TRUE(ConnectAndWait(ws_url)); |
| 513 EXPECT_EQ("permessage-deflate; server_max_window_bits=10", | 515 EXPECT_EQ("permessage-deflate; server_max_window_bits=10", |
| 514 event_interface_->extensions()); | 516 event_interface_->extensions()); |
| 515 } | 517 } |
| 516 | 518 |
| 517 } // namespace | 519 } // namespace |
| 518 | 520 |
| 519 } // namespace net | 521 } // namespace net |
| OLD | NEW |