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/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 3650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3661 MockWrite writes[] = { CreateMockWrite(*req) }; | 3661 MockWrite writes[] = { CreateMockWrite(*req) }; |
3662 | 3662 |
3663 scoped_ptr<SpdyFrame> resp(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1)); | 3663 scoped_ptr<SpdyFrame> resp(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1)); |
3664 scoped_ptr<SpdyFrame> body(spdy_util_.ConstructSpdyBodyFrame(1, true)); | 3664 scoped_ptr<SpdyFrame> body(spdy_util_.ConstructSpdyBodyFrame(1, true)); |
3665 MockRead reads[] = { | 3665 MockRead reads[] = { |
3666 CreateMockRead(*resp), | 3666 CreateMockRead(*resp), |
3667 CreateMockRead(*body), | 3667 CreateMockRead(*body), |
3668 MockRead(ASYNC, 0, 0) // EOF | 3668 MockRead(ASYNC, 0, 0) // EOF |
3669 }; | 3669 }; |
3670 | 3670 |
3671 CapturingBoundNetLog log; | 3671 BoundTestNetLog log; |
3672 | 3672 |
3673 DelayedSocketData data(1, reads, arraysize(reads), | 3673 DelayedSocketData data(1, reads, arraysize(reads), |
3674 writes, arraysize(writes)); | 3674 writes, arraysize(writes)); |
3675 NormalSpdyTransactionHelper helper(CreateGetRequestWithUserAgent(), | 3675 NormalSpdyTransactionHelper helper(CreateGetRequestWithUserAgent(), |
3676 DEFAULT_PRIORITY, | 3676 DEFAULT_PRIORITY, |
3677 log.bound(), GetParam(), NULL); | 3677 log.bound(), GetParam(), NULL); |
3678 helper.RunToCompletion(&data); | 3678 helper.RunToCompletion(&data); |
3679 TransactionHelperResult out = helper.output(); | 3679 TransactionHelperResult out = helper.output(); |
3680 EXPECT_EQ(OK, out.rv); | 3680 EXPECT_EQ(OK, out.rv); |
3681 EXPECT_EQ("HTTP/1.1 200 OK", out.status_line); | 3681 EXPECT_EQ("HTTP/1.1 200 OK", out.status_line); |
3682 EXPECT_EQ("hello!", out.response_data); | 3682 EXPECT_EQ("hello!", out.response_data); |
3683 | 3683 |
3684 // Check that the NetLog was filled reasonably. | 3684 // Check that the NetLog was filled reasonably. |
3685 // This test is intentionally non-specific about the exact ordering of the | 3685 // This test is intentionally non-specific about the exact ordering of the |
3686 // log; instead we just check to make sure that certain events exist, and that | 3686 // log; instead we just check to make sure that certain events exist, and that |
3687 // they are in the right order. | 3687 // they are in the right order. |
3688 CapturingNetLog::CapturedEntryList entries; | 3688 TestNetLog::CapturedEntryList entries; |
3689 log.GetEntries(&entries); | 3689 log.GetEntries(&entries); |
3690 | 3690 |
3691 EXPECT_LT(0u, entries.size()); | 3691 EXPECT_LT(0u, entries.size()); |
3692 int pos = 0; | 3692 int pos = 0; |
3693 pos = ExpectLogContainsSomewhere(entries, 0, | 3693 pos = ExpectLogContainsSomewhere(entries, 0, |
3694 NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST, | 3694 NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST, |
3695 NetLog::PHASE_BEGIN); | 3695 NetLog::PHASE_BEGIN); |
3696 pos = ExpectLogContainsSomewhere(entries, pos + 1, | 3696 pos = ExpectLogContainsSomewhere(entries, pos + 1, |
3697 NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST, | 3697 NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST, |
3698 NetLog::PHASE_END); | 3698 NetLog::PHASE_END); |
(...skipping 3008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6707 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { | 6707 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { |
6708 scoped_ptr<SSLSocketDataProvider> ssl_provider( | 6708 scoped_ptr<SSLSocketDataProvider> ssl_provider( |
6709 new SSLSocketDataProvider(ASYNC, OK)); | 6709 new SSLSocketDataProvider(ASYNC, OK)); |
6710 // Set to TLS_RSA_WITH_NULL_MD5 | 6710 // Set to TLS_RSA_WITH_NULL_MD5 |
6711 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); | 6711 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); |
6712 | 6712 |
6713 RunTLSUsageCheckTest(ssl_provider.Pass()); | 6713 RunTLSUsageCheckTest(ssl_provider.Pass()); |
6714 } | 6714 } |
6715 | 6715 |
6716 } // namespace net | 6716 } // namespace net |
OLD | NEW |