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

Side by Side Diff: net/spdy/spdy_http_stream_unittest.cc

Issue 2805039: SPDY: Make sure we don't try to send https/wss over an unauthenticated, but encrypted SSL socket. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Propagate error codes. Created 10 years, 5 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/http/http_network_transaction.cc ('k') | net/spdy/spdy_network_transaction.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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/spdy/spdy_http_stream.h" 5 #include "net/spdy/spdy_http_stream.h"
6 #include "base/ref_counted.h" 6 #include "base/ref_counted.h"
7 #include "base/time.h" 7 #include "base/time.h"
8 #include "net/base/mock_host_resolver.h" 8 #include "net/base/mock_host_resolver.h"
9 #include "net/base/net_errors.h" 9 #include "net/base/net_errors.h"
10 #include "net/base/net_log.h" 10 #include "net/base/net_log.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 109
110 // Needs fixing, see http://crbug.com/28622 110 // Needs fixing, see http://crbug.com/28622
111 TEST_F(SpdyHttpStreamTest, SendRequest) { 111 TEST_F(SpdyHttpStreamTest, SendRequest) {
112 scoped_refptr<SpdySession> session(CreateSpdySession()); 112 scoped_refptr<SpdySession> session(CreateSpdySession());
113 HttpRequestInfo request; 113 HttpRequestInfo request;
114 request.method = "GET"; 114 request.method = "GET";
115 request.url = GURL("http://www.google.com/"); 115 request.url = GURL("http://www.google.com/");
116 TestCompletionCallback callback; 116 TestCompletionCallback callback;
117 HttpResponseInfo response; 117 HttpResponseInfo response;
118 118
119 scoped_refptr<SpdyStream> stream( 119 scoped_refptr<SpdyStream> stream;
120 session->CreateStream(request.url, HIGHEST, BoundNetLog())); 120 ASSERT_EQ(
121 OK,
122 session->CreateStream(request.url, HIGHEST, &stream, BoundNetLog()));
121 123
122 scoped_ptr<SpdyHttpStream> http_stream(new SpdyHttpStream(stream.get())); 124 scoped_ptr<SpdyHttpStream> http_stream(new SpdyHttpStream(stream.get()));
123 http_stream->InitializeRequest(request, base::Time::Now(), NULL); 125 http_stream->InitializeRequest(request, base::Time::Now(), NULL);
124 EXPECT_EQ(ERR_IO_PENDING, 126 EXPECT_EQ(ERR_IO_PENDING,
125 http_stream->SendRequest(&response, &callback)); 127 http_stream->SendRequest(&response, &callback));
126 128
127 // Need to manually remove the spdy session since normally it gets removed on 129 // Need to manually remove the spdy session since normally it gets removed on
128 // socket close/error, but we aren't communicating over a socket here. 130 // socket close/error, but we aren't communicating over a socket here.
129 pool_peer_.RemoveSpdySession(session); 131 pool_peer_.RemoveSpdySession(session);
130 } 132 }
131 133
132 // TODO(willchan): Write a longer test for SpdyStream that exercises all 134 // TODO(willchan): Write a longer test for SpdyStream that exercises all
133 // methods. 135 // methods.
134 136
135 } // namespace 137 } // namespace
136 138
137 } // namespace net 139 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_network_transaction.cc ('k') | net/spdy/spdy_network_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698