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

Side by Side Diff: net/http/http_stream_factory_impl_unittest.cc

Issue 105833003: Fail WebSocket channel when handshake fails. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/http/http_stream_factory_impl.h" 5 #include "net/http/http_stream_factory_impl.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 virtual void GetSSLCertRequestInfo( 110 virtual void GetSSLCertRequestInfo(
111 SSLCertRequestInfo* cert_request_info) OVERRIDE {} 111 SSLCertRequestInfo* cert_request_info) OVERRIDE {}
112 virtual bool IsSpdyHttpStream() const OVERRIDE { return false; } 112 virtual bool IsSpdyHttpStream() const OVERRIDE { return false; }
113 virtual void Drain(HttpNetworkSession* session) OVERRIDE {} 113 virtual void Drain(HttpNetworkSession* session) OVERRIDE {}
114 virtual void SetPriority(RequestPriority priority) OVERRIDE {} 114 virtual void SetPriority(RequestPriority priority) OVERRIDE {}
115 115
116 virtual scoped_ptr<WebSocketStream> Upgrade() OVERRIDE { 116 virtual scoped_ptr<WebSocketStream> Upgrade() OVERRIDE {
117 return scoped_ptr<WebSocketStream>(); 117 return scoped_ptr<WebSocketStream>();
118 } 118 }
119 119
120 virtual std::string GetFailureMessage() const OVERRIDE {
121 return std::string();
122 }
123
120 private: 124 private:
121 const StreamType type_; 125 const StreamType type_;
122 }; 126 };
123 127
124 // HttpStreamFactoryImpl subclass that can wait until a preconnect is complete. 128 // HttpStreamFactoryImpl subclass that can wait until a preconnect is complete.
125 class MockHttpStreamFactoryImplForPreconnect : public HttpStreamFactoryImpl { 129 class MockHttpStreamFactoryImplForPreconnect : public HttpStreamFactoryImpl {
126 public: 130 public:
127 MockHttpStreamFactoryImplForPreconnect(HttpNetworkSession* session, 131 MockHttpStreamFactoryImplForPreconnect(HttpNetworkSession* session,
128 bool for_websockets) 132 bool for_websockets)
129 : HttpStreamFactoryImpl(session, for_websockets), 133 : HttpStreamFactoryImpl(session, for_websockets),
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after
1273 EXPECT_TRUE(waiter.used_proxy_info().is_direct()); 1277 EXPECT_TRUE(waiter.used_proxy_info().is_direct());
1274 1278
1275 // Make sure there is no orphaned job. it is already canceled. 1279 // Make sure there is no orphaned job. it is already canceled.
1276 ASSERT_EQ(0u, static_cast<HttpStreamFactoryImpl*>( 1280 ASSERT_EQ(0u, static_cast<HttpStreamFactoryImpl*>(
1277 session->http_stream_factory_for_websocket())->num_orphaned_jobs()); 1281 session->http_stream_factory_for_websocket())->num_orphaned_jobs());
1278 } 1282 }
1279 1283
1280 } // namespace 1284 } // namespace
1281 1285
1282 } // namespace net 1286 } // namespace net
OLDNEW
« no previous file with comments | « content/browser/renderer_host/websocket_host.cc ('k') | net/url_request/url_request_http_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698