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

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

Issue 10828129: SPDY: WriteHeaders should not invoke OnDataSent callback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « net/spdy/spdy_stream_spdy2_unittest.cc ('k') | net/spdy/spdy_stream_test_util.h » ('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) 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 "base/memory/ref_counted.h" 5 #include "base/memory/ref_counted.h"
6 #include "net/base/completion_callback.h" 6 #include "net/base/completion_callback.h"
7 #include "net/base/net_log_unittest.h" 7 #include "net/base/net_log_unittest.h"
8 #include "net/spdy/buffered_spdy_framer.h" 8 #include "net/spdy/buffered_spdy_framer.h"
9 #include "net/spdy/spdy_stream.h" 9 #include "net/spdy/spdy_stream.h"
10 #include "net/spdy/spdy_http_utils.h" 10 #include "net/spdy/spdy_http_utils.h"
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 (*headers)[":origin"] = "http://example.com"; 260 (*headers)[":origin"] = "http://example.com";
261 stream->set_spdy_headers(headers.Pass()); 261 stream->set_spdy_headers(headers.Pass());
262 EXPECT_TRUE(stream->HasUrl()); 262 EXPECT_TRUE(stream->HasUrl());
263 263
264 EXPECT_EQ(ERR_IO_PENDING, stream->SendRequest(true)); 264 EXPECT_EQ(ERR_IO_PENDING, stream->SendRequest(true));
265 265
266 EXPECT_EQ(OK, callback.WaitForResult()); 266 EXPECT_EQ(OK, callback.WaitForResult());
267 267
268 EXPECT_TRUE(delegate->send_headers_completed()); 268 EXPECT_TRUE(delegate->send_headers_completed());
269 EXPECT_EQ("101", (*delegate->response())[":status"]); 269 EXPECT_EQ("101", (*delegate->response())[":status"]);
270 EXPECT_EQ(1, delegate->headers_sent());
270 EXPECT_EQ(std::string(), delegate->received_data()); 271 EXPECT_EQ(std::string(), delegate->received_data());
271 // TODO(toyoshim): OnDataSent should be invoked when each data frame is sent. 272 EXPECT_EQ(6, delegate->data_sent());
272 // But current implementation invokes also when each HEADERS frame is sent.
273 //EXPECT_EQ(6, delegate->data_sent());
274 } 273 }
275 274
276 TEST_F(SpdyStreamSpdy3Test, PushedStream) { 275 TEST_F(SpdyStreamSpdy3Test, PushedStream) {
277 const char kStreamUrl[] = "http://www.google.com/"; 276 const char kStreamUrl[] = "http://www.google.com/";
278 277
279 SpdySessionDependencies session_deps; 278 SpdySessionDependencies session_deps;
280 session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps); 279 session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps);
281 SpdySessionPoolPeer pool_peer_(session_->spdy_session_pool()); 280 SpdySessionPoolPeer pool_peer_(session_->spdy_session_pool());
282 scoped_refptr<SpdySession> spdy_session(CreateSpdySession()); 281 scoped_refptr<SpdySession> spdy_session(CreateSpdySession());
283 282
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 net::NetLog::PHASE_NONE); 464 net::NetLog::PHASE_NONE);
466 465
467 int stream_id2; 466 int stream_id2;
468 ASSERT_TRUE(entries[pos].GetIntegerValue("stream_id", &stream_id2)); 467 ASSERT_TRUE(entries[pos].GetIntegerValue("stream_id", &stream_id2));
469 EXPECT_EQ(static_cast<int>(stream_id), stream_id2); 468 EXPECT_EQ(static_cast<int>(stream_id), stream_id2);
470 } 469 }
471 470
472 } // namespace test 471 } // namespace test
473 472
474 } // namespace net 473 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_stream_spdy2_unittest.cc ('k') | net/spdy/spdy_stream_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698