| 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 "net/spdy/spdy_http_stream.h" | 5 #include "net/spdy/spdy_http_stream.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| 11 #include "base/message_loop/message_loop.h" | |
| 12 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
| 13 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
| 14 #include "crypto/ec_private_key.h" | 13 #include "crypto/ec_private_key.h" |
| 15 #include "crypto/ec_signature_creator.h" | 14 #include "crypto/ec_signature_creator.h" |
| 16 #include "crypto/signature_creator.h" | 15 #include "crypto/signature_creator.h" |
| 17 #include "net/base/chunked_upload_data_stream.h" | 16 #include "net/base/chunked_upload_data_stream.h" |
| 18 #include "net/base/load_timing_info.h" | 17 #include "net/base/load_timing_info.h" |
| 19 #include "net/base/load_timing_info_test_util.h" | 18 #include "net/base/load_timing_info_test_util.h" |
| 20 #include "net/base/test_completion_callback.h" | 19 #include "net/base/test_completion_callback.h" |
| 21 #include "net/cert/asn1_util.h" | 20 #include "net/cert/asn1_util.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 NextProto GetProtocol() const { | 92 NextProto GetProtocol() const { |
| 94 return GetParam() == kTestCaseSPDY31 ? kProtoSPDY31 : kProtoHTTP2; | 93 return GetParam() == kTestCaseSPDY31 ? kProtoSPDY31 : kProtoHTTP2; |
| 95 } | 94 } |
| 96 | 95 |
| 97 bool GetDependenciesFromPriority() const { | 96 bool GetDependenciesFromPriority() const { |
| 98 return GetParam() == kTestCaseHTTP2PriorityDependencies; | 97 return GetParam() == kTestCaseHTTP2PriorityDependencies; |
| 99 } | 98 } |
| 100 | 99 |
| 101 void TearDown() override { | 100 void TearDown() override { |
| 102 crypto::ECSignatureCreator::SetFactoryForTesting(NULL); | 101 crypto::ECSignatureCreator::SetFactoryForTesting(NULL); |
| 103 base::MessageLoop::current()->RunUntilIdle(); | 102 base::RunLoop().RunUntilIdle(); |
| 104 EXPECT_TRUE(sequenced_data_->AllReadDataConsumed()); | 103 EXPECT_TRUE(sequenced_data_->AllReadDataConsumed()); |
| 105 EXPECT_TRUE(sequenced_data_->AllWriteDataConsumed()); | 104 EXPECT_TRUE(sequenced_data_->AllWriteDataConsumed()); |
| 106 } | 105 } |
| 107 | 106 |
| 108 // Initializes the session using SequencedSocketData. | 107 // Initializes the session using SequencedSocketData. |
| 109 void InitSession(MockRead* reads, | 108 void InitSession(MockRead* reads, |
| 110 size_t reads_count, | 109 size_t reads_count, |
| 111 MockWrite* writes, | 110 MockWrite* writes, |
| 112 size_t writes_count, | 111 size_t writes_count, |
| 113 const SpdySessionKey& key) { | 112 const SpdySessionKey& key) { |
| (...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 885 EXPECT_EQ(kUploadData, std::string(buf1->data(), kUploadDataSize)); | 884 EXPECT_EQ(kUploadData, std::string(buf1->data(), kUploadDataSize)); |
| 886 | 885 |
| 887 ASSERT_TRUE(response.headers.get()); | 886 ASSERT_TRUE(response.headers.get()); |
| 888 ASSERT_EQ(200, response.headers->response_code()); | 887 ASSERT_EQ(200, response.headers->response_code()); |
| 889 } | 888 } |
| 890 | 889 |
| 891 // TODO(willchan): Write a longer test for SpdyStream that exercises all | 890 // TODO(willchan): Write a longer test for SpdyStream that exercises all |
| 892 // methods. | 891 // methods. |
| 893 | 892 |
| 894 } // namespace net | 893 } // namespace net |
| OLD | NEW |