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_session_spdy3_unittest.cc

Issue 10836084: SPDY - Handle incomplete headers during server push. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: 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_session_spdy2_unittest.cc ('k') | net/spdy/spdy_stream.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 "net/spdy/spdy_session.h" 5 #include "net/spdy/spdy_session.h"
6 6
7 #include "net/base/host_cache.h" 7 #include "net/base/host_cache.h"
8 #include "net/base/ip_endpoint.h" 8 #include "net/base/ip_endpoint.h"
9 #include "net/base/net_log_unittest.h" 9 #include "net/base/net_log_unittest.h"
10 #include "net/spdy/spdy_io_buffer.h" 10 #include "net/spdy/spdy_io_buffer.h"
(...skipping 25 matching lines...) Expand all
36 return OK; 36 return OK;
37 } 37 }
38 virtual int OnSendBodyComplete(int status, bool* eof) OVERRIDE { 38 virtual int OnSendBodyComplete(int status, bool* eof) OVERRIDE {
39 return OK; 39 return OK;
40 } 40 }
41 virtual int OnResponseReceived(const SpdyHeaderBlock& response, 41 virtual int OnResponseReceived(const SpdyHeaderBlock& response,
42 base::Time response_time, 42 base::Time response_time,
43 int status) OVERRIDE { 43 int status) OVERRIDE {
44 return OK; 44 return OK;
45 } 45 }
46 virtual void OnDataReceived(const char* data, int length) OVERRIDE {} 46 virtual int OnDataReceived(const char* data, int length) OVERRIDE {
47 return OK;
48 }
47 virtual void OnDataSent(int length) OVERRIDE {} 49 virtual void OnDataSent(int length) OVERRIDE {}
48 virtual void OnClose(int status) OVERRIDE { 50 virtual void OnClose(int status) OVERRIDE {
49 stream_->Close(); 51 stream_->Close();
50 } 52 }
51 private: 53 private:
52 SpdyStream* stream_; 54 SpdyStream* stream_;
53 }; 55 };
54 56
55 57
56 class TestSpdyStreamDelegate : public net::SpdyStream::Delegate { 58 class TestSpdyStreamDelegate : public net::SpdyStream::Delegate {
(...skipping 11 matching lines...) Expand all
68 virtual int OnSendBodyComplete(int /*status*/, bool* /*eof*/) { 70 virtual int OnSendBodyComplete(int /*status*/, bool* /*eof*/) {
69 return ERR_UNEXPECTED; 71 return ERR_UNEXPECTED;
70 } 72 }
71 73
72 virtual int OnResponseReceived(const SpdyHeaderBlock& response, 74 virtual int OnResponseReceived(const SpdyHeaderBlock& response,
73 base::Time response_time, 75 base::Time response_time,
74 int status) { 76 int status) {
75 return status; 77 return status;
76 } 78 }
77 79
78 virtual void OnDataReceived(const char* buffer, int bytes) { 80 virtual int OnDataReceived(const char* buffer, int bytes) {
81 return OK;
79 } 82 }
80 83
81 virtual void OnDataSent(int length) { 84 virtual void OnDataSent(int length) {
82 } 85 }
83 86
84 virtual void OnClose(int status) { 87 virtual void OnClose(int status) {
85 CompletionCallback callback = callback_; 88 CompletionCallback callback = callback_;
86 callback_.Reset(); 89 callback_.Reset();
87 callback.Run(OK); 90 callback.Run(OK);
88 } 91 }
(...skipping 1592 matching lines...) Expand 10 before | Expand all | Expand 10 after
1681 session->CloseSessionOnError(ERR_ABORTED, true, ""); 1684 session->CloseSessionOnError(ERR_ABORTED, true, "");
1682 1685
1683 EXPECT_TRUE(spdy_stream1->closed()); 1686 EXPECT_TRUE(spdy_stream1->closed());
1684 EXPECT_TRUE(spdy_stream2->closed()); 1687 EXPECT_TRUE(spdy_stream2->closed());
1685 1688
1686 spdy_stream1 = NULL; 1689 spdy_stream1 = NULL;
1687 spdy_stream2 = NULL; 1690 spdy_stream2 = NULL;
1688 } 1691 }
1689 1692
1690 } // namespace net 1693 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_session_spdy2_unittest.cc ('k') | net/spdy/spdy_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698