OLD | NEW |
---|---|
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/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 5320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5331 EXPECT_EQ("HTTP/1.1 200 OK", response2.headers->GetStatusLine()); | 5331 EXPECT_EQ("HTTP/1.1 200 OK", response2.headers->GetStatusLine()); |
5332 | 5332 |
5333 // Read the final EOF (which will close the session) | 5333 // Read the final EOF (which will close the session) |
5334 data.RunFor(1); | 5334 data.RunFor(1); |
5335 | 5335 |
5336 // Verify that we consumed all test data. | 5336 // Verify that we consumed all test data. |
5337 EXPECT_TRUE(data.at_read_eof()); | 5337 EXPECT_TRUE(data.at_read_eof()); |
5338 EXPECT_TRUE(data.at_write_eof()); | 5338 EXPECT_TRUE(data.at_write_eof()); |
5339 } | 5339 } |
5340 | 5340 |
5341 | |
5342 // TODO(baranovich): HTTP 2 does not allow multiple HEADERS frames | |
Johnny
2014/06/05 02:56:04
This isn't quite right. There's no restriction on
baranovich
2014/06/05 19:16:57
http://tools.ietf.org/html/draft-ietf-httpbis-http
| |
5341 TEST_P(SpdyNetworkTransactionTest, ServerPushWithTwoHeaderFrames) { | 5343 TEST_P(SpdyNetworkTransactionTest, ServerPushWithTwoHeaderFrames) { |
5342 // We push a stream and attempt to claim it before the headers come down. | 5344 // We push a stream and attempt to claim it before the headers come down. |
5343 scoped_ptr<SpdyFrame> stream1_syn( | 5345 scoped_ptr<SpdyFrame> stream1_syn( |
5344 spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true)); | 5346 spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true)); |
5345 scoped_ptr<SpdyFrame> stream1_body( | 5347 scoped_ptr<SpdyFrame> stream1_body( |
5346 spdy_util_.ConstructSpdyBodyFrame(1, true)); | 5348 spdy_util_.ConstructSpdyBodyFrame(1, true)); |
5347 MockWrite writes[] = { | 5349 MockWrite writes[] = { |
5348 CreateMockWrite(*stream1_syn, 0, SYNCHRONOUS), | 5350 CreateMockWrite(*stream1_syn, 0, SYNCHRONOUS), |
5349 }; | 5351 }; |
5350 | 5352 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5458 VerifyStreamsClosed(helper); | 5460 VerifyStreamsClosed(helper); |
5459 | 5461 |
5460 // Verify the SYN_REPLY. | 5462 // Verify the SYN_REPLY. |
5461 EXPECT_TRUE(response.headers.get() != NULL); | 5463 EXPECT_TRUE(response.headers.get() != NULL); |
5462 EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); | 5464 EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); |
5463 | 5465 |
5464 // Verify the pushed stream. | 5466 // Verify the pushed stream. |
5465 EXPECT_TRUE(response2.headers.get() != NULL); | 5467 EXPECT_TRUE(response2.headers.get() != NULL); |
5466 EXPECT_EQ("HTTP/1.1 200 OK", response2.headers->GetStatusLine()); | 5468 EXPECT_EQ("HTTP/1.1 200 OK", response2.headers->GetStatusLine()); |
5467 | 5469 |
5468 // Verify we got all the headers | 5470 // Verify we got all the headers from both header blocks. |
Johnny
2014/06/05 02:56:04
Expose and verify request headers on the transacti
baranovich
2014/06/05 19:16:57
I'm not quite sure what and how should be checked
| |
5469 if (spdy_util_.spdy_version() < SPDY3) { | |
5470 EXPECT_TRUE(response2.headers->HasHeaderValue( | |
5471 "url", | |
5472 "http://www.google.com/foo.dat")); | |
5473 } else { | |
5474 EXPECT_TRUE(response2.headers->HasHeaderValue( | |
5475 "scheme", "http")); | |
5476 EXPECT_TRUE(response2.headers->HasHeaderValue( | |
5477 "path", "/foo.dat")); | |
5478 if (spdy_util_.spdy_version() < SPDY4) { | |
5479 EXPECT_TRUE(response2.headers->HasHeaderValue( | |
5480 "host", "www.google.com")); | |
5481 } else { | |
5482 EXPECT_TRUE(response2.headers->HasHeaderValue( | |
5483 "authority", "www.google.com")); | |
5484 } | |
5485 } | |
5486 EXPECT_TRUE(response2.headers->HasHeaderValue("hello", "bye")); | 5471 EXPECT_TRUE(response2.headers->HasHeaderValue("hello", "bye")); |
5487 EXPECT_TRUE(response2.headers->HasHeaderValue("status", "200")); | 5472 EXPECT_TRUE(response2.headers->HasHeaderValue("status", "200")); |
5488 | 5473 |
5489 // Read the final EOF (which will close the session) | 5474 // Read the final EOF (which will close the session) |
5490 data.RunFor(1); | 5475 data.RunFor(1); |
5491 | 5476 |
5492 // Verify that we consumed all test data. | 5477 // Verify that we consumed all test data. |
5493 EXPECT_TRUE(data.at_read_eof()); | 5478 EXPECT_TRUE(data.at_read_eof()); |
5494 EXPECT_TRUE(data.at_write_eof()); | 5479 EXPECT_TRUE(data.at_write_eof()); |
5495 } | 5480 } |
(...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6709 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { | 6694 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { |
6710 scoped_ptr<SSLSocketDataProvider> ssl_provider( | 6695 scoped_ptr<SSLSocketDataProvider> ssl_provider( |
6711 new SSLSocketDataProvider(ASYNC, OK)); | 6696 new SSLSocketDataProvider(ASYNC, OK)); |
6712 // Set to TLS_RSA_WITH_NULL_MD5 | 6697 // Set to TLS_RSA_WITH_NULL_MD5 |
6713 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); | 6698 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); |
6714 | 6699 |
6715 RunTLSUsageCheckTest(ssl_provider.Pass()); | 6700 RunTLSUsageCheckTest(ssl_provider.Pass()); |
6716 } | 6701 } |
6717 | 6702 |
6718 } // namespace net | 6703 } // namespace net |
OLD | NEW |