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

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

Issue 1272283003: Add a new SpdyStream::Delegate method to handle trailers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed tests Created 5 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
« no previous file with comments | « no previous file | net/spdy/spdy_stream.h » ('j') | net/spdy/spdy_stream.h » ('J')
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 <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 5449 matching lines...) Expand 10 before | Expand all | Expand 10 after
5460 }; 5460 };
5461 5461
5462 SequencedSocketData data(reads, arraysize(reads), writes, arraysize(writes)); 5462 SequencedSocketData data(reads, arraysize(reads), writes, arraysize(writes));
5463 NormalSpdyTransactionHelper helper(CreateGetRequest(), DEFAULT_PRIORITY, 5463 NormalSpdyTransactionHelper helper(CreateGetRequest(), DEFAULT_PRIORITY,
5464 BoundNetLog(), GetParam(), NULL); 5464 BoundNetLog(), GetParam(), NULL);
5465 helper.RunToCompletion(&data); 5465 helper.RunToCompletion(&data);
5466 TransactionHelperResult out = helper.output(); 5466 TransactionHelperResult out = helper.output();
5467 EXPECT_EQ(ERR_SPDY_PROTOCOL_ERROR, out.rv); 5467 EXPECT_EQ(ERR_SPDY_PROTOCOL_ERROR, out.rv);
5468 } 5468 }
5469 5469
5470 TEST_P(SpdyNetworkTransactionTest, SynReplyWithLateHeaders) { 5470 TEST_P(SpdyNetworkTransactionTest, SynReplyWithLateHeaders) {
Ryan Hamilton 2015/08/10 17:23:25 Can you add a comment which explains what this tes
xunjieli 2015/08/10 20:31:06 Done. This test sends data again after sending lat
Ryan Hamilton 2015/08/10 22:37:38 Ah, I missed that. Cool, thanks! Perhaps that na
xunjieli 2015/08/11 15:07:14 Done. Good idea. Thanks!
5471 scoped_ptr<SpdyFrame> req( 5471 scoped_ptr<SpdyFrame> req(
5472 spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true)); 5472 spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true));
5473 scoped_ptr<SpdyFrame> rst( 5473 scoped_ptr<SpdyFrame> rst(
5474 spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_PROTOCOL_ERROR)); 5474 spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_PROTOCOL_ERROR));
5475 MockWrite writes[] = { 5475 MockWrite writes[] = {
5476 CreateMockWrite(*req, 0), CreateMockWrite(*rst, 4), 5476 CreateMockWrite(*req, 0), CreateMockWrite(*rst, 5),
5477 }; 5477 };
5478 5478
5479 scoped_ptr<SpdyFrame> stream1_reply( 5479 scoped_ptr<SpdyFrame> stream1_reply(
5480 spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1)); 5480 spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
5481 5481
5482 scoped_ptr<SpdyHeaderBlock> late_headers(new SpdyHeaderBlock()); 5482 scoped_ptr<SpdyHeaderBlock> late_headers(new SpdyHeaderBlock());
5483 (*late_headers)["hello"] = "bye"; 5483 (*late_headers)["hello"] = "bye";
5484 scoped_ptr<SpdyFrame> stream1_headers( 5484 scoped_ptr<SpdyFrame> stream1_headers(
5485 spdy_util_.ConstructSpdyControlFrame(late_headers.Pass(), 5485 spdy_util_.ConstructSpdyControlFrame(late_headers.Pass(),
5486 false, 5486 false,
5487 1, 5487 1,
5488 LOWEST, 5488 LOWEST,
5489 HEADERS, 5489 HEADERS,
5490 CONTROL_FLAG_NONE, 5490 CONTROL_FLAG_NONE,
5491 0)); 5491 0));
5492 scoped_ptr<SpdyFrame> stream1_body( 5492 scoped_ptr<SpdyFrame> stream1_body(
5493 spdy_util_.ConstructSpdyBodyFrame(1, false)); 5493 spdy_util_.ConstructSpdyBodyFrame(1, false));
5494 scoped_ptr<SpdyFrame> stream1_body2( 5494 scoped_ptr<SpdyFrame> stream1_body2(
5495 spdy_util_.ConstructSpdyBodyFrame(1, true)); 5495 spdy_util_.ConstructSpdyBodyFrame(1, true));
5496 MockRead reads[] = { 5496 MockRead reads[] = {
5497 CreateMockRead(*stream1_reply, 1), 5497 CreateMockRead(*stream1_reply, 1), CreateMockRead(*stream1_body, 2),
5498 CreateMockRead(*stream1_body, 2), 5498 CreateMockRead(*stream1_headers, 3), CreateMockRead(*stream1_body2, 4),
5499 CreateMockRead(*stream1_headers, 3),
5500 CreateMockRead(*stream1_body2, 5),
5501 MockRead(ASYNC, 0, 6) // EOF 5499 MockRead(ASYNC, 0, 6) // EOF
5502 }; 5500 };
5503 5501
5504 SequencedSocketData data(reads, arraysize(reads), writes, arraysize(writes)); 5502 SequencedSocketData data(reads, arraysize(reads), writes, arraysize(writes));
5505 NormalSpdyTransactionHelper helper(CreateGetRequest(), DEFAULT_PRIORITY, 5503 NormalSpdyTransactionHelper helper(CreateGetRequest(), DEFAULT_PRIORITY,
5506 BoundNetLog(), GetParam(), NULL); 5504 BoundNetLog(), GetParam(), NULL);
5507 helper.RunToCompletion(&data); 5505 helper.RunToCompletion(&data);
5508 TransactionHelperResult out = helper.output(); 5506 TransactionHelperResult out = helper.output();
5509 EXPECT_EQ(ERR_SPDY_PROTOCOL_ERROR, out.rv); 5507 EXPECT_EQ(ERR_SPDY_PROTOCOL_ERROR, out.rv);
5510 } 5508 }
(...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after
6629 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { 6627 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) {
6630 scoped_ptr<SSLSocketDataProvider> ssl_provider( 6628 scoped_ptr<SSLSocketDataProvider> ssl_provider(
6631 new SSLSocketDataProvider(ASYNC, OK)); 6629 new SSLSocketDataProvider(ASYNC, OK));
6632 // Set to TLS_RSA_WITH_NULL_MD5 6630 // Set to TLS_RSA_WITH_NULL_MD5
6633 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); 6631 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status);
6634 6632
6635 RunTLSUsageCheckTest(ssl_provider.Pass()); 6633 RunTLSUsageCheckTest(ssl_provider.Pass());
6636 } 6634 }
6637 6635
6638 } // namespace net 6636 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/spdy/spdy_stream.h » ('j') | net/spdy/spdy_stream.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698