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_session.h" | 5 #include "net/spdy/spdy_session.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 5001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5012 MapFramerErrorToNetError(SpdyFramer::SPDY_CONTROL_PAYLOAD_TOO_LARGE)); | 5012 MapFramerErrorToNetError(SpdyFramer::SPDY_CONTROL_PAYLOAD_TOO_LARGE)); |
5013 } | 5013 } |
5014 | 5014 |
5015 TEST(MapRstStreamStatusToProtocolError, MapsValues) { | 5015 TEST(MapRstStreamStatusToProtocolError, MapsValues) { |
5016 CHECK_EQ(STATUS_CODE_PROTOCOL_ERROR, | 5016 CHECK_EQ(STATUS_CODE_PROTOCOL_ERROR, |
5017 MapRstStreamStatusToProtocolError(RST_STREAM_PROTOCOL_ERROR)); | 5017 MapRstStreamStatusToProtocolError(RST_STREAM_PROTOCOL_ERROR)); |
5018 CHECK_EQ(STATUS_CODE_FRAME_SIZE_ERROR, | 5018 CHECK_EQ(STATUS_CODE_FRAME_SIZE_ERROR, |
5019 MapRstStreamStatusToProtocolError(RST_STREAM_FRAME_SIZE_ERROR)); | 5019 MapRstStreamStatusToProtocolError(RST_STREAM_FRAME_SIZE_ERROR)); |
5020 CHECK_EQ(STATUS_CODE_ENHANCE_YOUR_CALM, | 5020 CHECK_EQ(STATUS_CODE_ENHANCE_YOUR_CALM, |
5021 MapRstStreamStatusToProtocolError(RST_STREAM_ENHANCE_YOUR_CALM)); | 5021 MapRstStreamStatusToProtocolError(RST_STREAM_ENHANCE_YOUR_CALM)); |
| 5022 CHECK_EQ(STATUS_CODE_INADEQUATE_SECURITY, |
| 5023 MapRstStreamStatusToProtocolError(RST_STREAM_INADEQUATE_SECURITY)); |
| 5024 CHECK_EQ(STATUS_CODE_HTTP_1_1_REQUIRED, |
| 5025 MapRstStreamStatusToProtocolError(RST_STREAM_HTTP_1_1_REQUIRED)); |
5022 } | 5026 } |
5023 | 5027 |
5024 TEST(MapNetErrorToGoAwayStatus, MapsValue) { | 5028 TEST(MapNetErrorToGoAwayStatus, MapsValue) { |
5025 CHECK_EQ(GOAWAY_INADEQUATE_SECURITY, | 5029 CHECK_EQ(GOAWAY_INADEQUATE_SECURITY, |
5026 MapNetErrorToGoAwayStatus(ERR_SPDY_INADEQUATE_TRANSPORT_SECURITY)); | 5030 MapNetErrorToGoAwayStatus(ERR_SPDY_INADEQUATE_TRANSPORT_SECURITY)); |
5027 CHECK_EQ(GOAWAY_FLOW_CONTROL_ERROR, | 5031 CHECK_EQ(GOAWAY_FLOW_CONTROL_ERROR, |
5028 MapNetErrorToGoAwayStatus(ERR_SPDY_FLOW_CONTROL_ERROR)); | 5032 MapNetErrorToGoAwayStatus(ERR_SPDY_FLOW_CONTROL_ERROR)); |
5029 CHECK_EQ(GOAWAY_PROTOCOL_ERROR, | 5033 CHECK_EQ(GOAWAY_PROTOCOL_ERROR, |
5030 MapNetErrorToGoAwayStatus(ERR_SPDY_PROTOCOL_ERROR)); | 5034 MapNetErrorToGoAwayStatus(ERR_SPDY_PROTOCOL_ERROR)); |
5031 CHECK_EQ(GOAWAY_COMPRESSION_ERROR, | 5035 CHECK_EQ(GOAWAY_COMPRESSION_ERROR, |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5133 ssl_info.cert = ImportCertFromFile(GetTestCertsDirectory(), | 5137 ssl_info.cert = ImportCertFromFile(GetTestCertsDirectory(), |
5134 "spdy_pooling.pem"); | 5138 "spdy_pooling.pem"); |
5135 ssl_info.is_issued_by_known_root = true; | 5139 ssl_info.is_issued_by_known_root = true; |
5136 ssl_info.public_key_hashes.push_back(test::GetTestHashValue(primary_pin)); | 5140 ssl_info.public_key_hashes.push_back(test::GetTestHashValue(primary_pin)); |
5137 | 5141 |
5138 EXPECT_TRUE(SpdySession::CanPool( | 5142 EXPECT_TRUE(SpdySession::CanPool( |
5139 &tss, ssl_info, "www.example.org", "mail.example.org")); | 5143 &tss, ssl_info, "www.example.org", "mail.example.org")); |
5140 } | 5144 } |
5141 | 5145 |
5142 } // namespace net | 5146 } // namespace net |
OLD | NEW |