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

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 7 years 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 virtual void GetSSLCertRequestInfo( 109 virtual void GetSSLCertRequestInfo(
110 SSLCertRequestInfo* cert_request_info) OVERRIDE {} 110 SSLCertRequestInfo* cert_request_info) OVERRIDE {}
111 virtual bool IsSpdyHttpStream() const OVERRIDE { return false; } 111 virtual bool IsSpdyHttpStream() const OVERRIDE { return false; }
112 virtual void Drain(HttpNetworkSession* session) OVERRIDE {} 112 virtual void Drain(HttpNetworkSession* session) OVERRIDE {}
113 virtual void SetPriority(RequestPriority priority) OVERRIDE {} 113 virtual void SetPriority(RequestPriority priority) OVERRIDE {}
114 114
115 virtual scoped_ptr<WebSocketStream> Upgrade() OVERRIDE { 115 virtual scoped_ptr<WebSocketStream> Upgrade() OVERRIDE {
116 return scoped_ptr<WebSocketStream>(); 116 return scoped_ptr<WebSocketStream>();
117 } 117 }
118 118
119 virtual std::string FailureMessage() const OVERRIDE {
120 return std::string();
121 }
122
119 private: 123 private:
120 const StreamType type_; 124 const StreamType type_;
121 }; 125 };
122 126
123 // HttpStreamFactoryImpl subclass that can wait until a preconnect is complete. 127 // HttpStreamFactoryImpl subclass that can wait until a preconnect is complete.
124 class MockHttpStreamFactoryImplForPreconnect : public HttpStreamFactoryImpl { 128 class MockHttpStreamFactoryImplForPreconnect : public HttpStreamFactoryImpl {
125 public: 129 public:
126 MockHttpStreamFactoryImplForPreconnect(HttpNetworkSession* session, 130 MockHttpStreamFactoryImplForPreconnect(HttpNetworkSession* session,
127 bool for_websockets) 131 bool for_websockets)
128 : HttpStreamFactoryImpl(session, for_websockets), 132 : HttpStreamFactoryImpl(session, for_websockets),
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after
1272 EXPECT_TRUE(waiter.used_proxy_info().is_direct()); 1276 EXPECT_TRUE(waiter.used_proxy_info().is_direct());
1273 1277
1274 // Make sure there is no orphaned job. it is already canceled. 1278 // Make sure there is no orphaned job. it is already canceled.
1275 ASSERT_EQ(0u, static_cast<HttpStreamFactoryImpl*>( 1279 ASSERT_EQ(0u, static_cast<HttpStreamFactoryImpl*>(
1276 session->http_stream_factory_for_websocket())->num_orphaned_jobs()); 1280 session->http_stream_factory_for_websocket())->num_orphaned_jobs());
1277 } 1281 }
1278 1282
1279 } // namespace 1283 } // namespace
1280 1284
1281 } // namespace net 1285 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698