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

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

Issue 2496953002: Revert of Unify enum NextProto and enum AlternateProtocol. (Closed)
Patch Set: Created 4 years, 1 month 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 | « net/spdy/spdy_session.cc ('k') | no next file » | no next file with comments »
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 "net/spdy/spdy_session.h" 5 #include "net/spdy/spdy_session.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 5371 matching lines...) Expand 10 before | Expand all | Expand 10 after
5382 test_url_.EffectiveIntPort()); 5382 test_url_.EffectiveIntPort());
5383 AlternativeServiceVector altsvc_vector = 5383 AlternativeServiceVector altsvc_vector =
5384 spdy_session_pool_->http_server_properties()->GetAlternativeServices( 5384 spdy_session_pool_->http_server_properties()->GetAlternativeServices(
5385 session_origin); 5385 session_origin);
5386 ASSERT_TRUE(altsvc_vector.empty()); 5386 ASSERT_TRUE(altsvc_vector.empty());
5387 5387
5388 altsvc_vector = 5388 altsvc_vector =
5389 spdy_session_pool_->http_server_properties()->GetAlternativeServices( 5389 spdy_session_pool_->http_server_properties()->GetAlternativeServices(
5390 url::SchemeHostPort(GURL(origin))); 5390 url::SchemeHostPort(GURL(origin)));
5391 ASSERT_EQ(1u, altsvc_vector.size()); 5391 ASSERT_EQ(1u, altsvc_vector.size());
5392 EXPECT_EQ(kProtoQUIC, altsvc_vector[0].protocol); 5392 EXPECT_EQ(QUIC, altsvc_vector[0].protocol);
5393 EXPECT_EQ("alternative.example.org", altsvc_vector[0].host); 5393 EXPECT_EQ("alternative.example.org", altsvc_vector[0].host);
5394 EXPECT_EQ(443u, altsvc_vector[0].port); 5394 EXPECT_EQ(443u, altsvc_vector[0].port);
5395 } 5395 }
5396 5396
5397 TEST_F(AltSvcFrameTest, DoNotProcessAltSvcFrameOnInsecureSession) { 5397 TEST_F(AltSvcFrameTest, DoNotProcessAltSvcFrameOnInsecureSession) {
5398 const char origin[] = "https://mail.example.org"; 5398 const char origin[] = "https://mail.example.org";
5399 SpdyAltSvcIR altsvc_ir(0); 5399 SpdyAltSvcIR altsvc_ir(0);
5400 altsvc_ir.add_altsvc(alternative_service_); 5400 altsvc_ir.add_altsvc(alternative_service_);
5401 altsvc_ir.set_origin(origin); 5401 altsvc_ir.set_origin(origin);
5402 AddSocketData(altsvc_ir); 5402 AddSocketData(altsvc_ir);
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
5507 test_url_.EffectiveIntPort()); 5507 test_url_.EffectiveIntPort());
5508 AlternativeServiceVector altsvc_vector = 5508 AlternativeServiceVector altsvc_vector =
5509 spdy_session_pool_->http_server_properties()->GetAlternativeServices( 5509 spdy_session_pool_->http_server_properties()->GetAlternativeServices(
5510 session_origin); 5510 session_origin);
5511 ASSERT_TRUE(altsvc_vector.empty()); 5511 ASSERT_TRUE(altsvc_vector.empty());
5512 5512
5513 altsvc_vector = 5513 altsvc_vector =
5514 spdy_session_pool_->http_server_properties()->GetAlternativeServices( 5514 spdy_session_pool_->http_server_properties()->GetAlternativeServices(
5515 url::SchemeHostPort(GURL(request_origin))); 5515 url::SchemeHostPort(GURL(request_origin)));
5516 ASSERT_EQ(1u, altsvc_vector.size()); 5516 ASSERT_EQ(1u, altsvc_vector.size());
5517 EXPECT_EQ(kProtoQUIC, altsvc_vector[0].protocol); 5517 EXPECT_EQ(QUIC, altsvc_vector[0].protocol);
5518 EXPECT_EQ("alternative.example.org", altsvc_vector[0].host); 5518 EXPECT_EQ("alternative.example.org", altsvc_vector[0].host);
5519 EXPECT_EQ(443u, altsvc_vector[0].port); 5519 EXPECT_EQ(443u, altsvc_vector[0].port);
5520 } 5520 }
5521 5521
5522 TEST_F(AltSvcFrameTest, DoNotProcessAltSvcFrameOnStreamWithInsecureOrigin) { 5522 TEST_F(AltSvcFrameTest, DoNotProcessAltSvcFrameOnStreamWithInsecureOrigin) {
5523 SpdyAltSvcIR altsvc_ir(1); 5523 SpdyAltSvcIR altsvc_ir(1);
5524 altsvc_ir.add_altsvc(alternative_service_); 5524 altsvc_ir.add_altsvc(alternative_service_);
5525 5525
5526 SpdySerializedFrame altsvc_frame(spdy_util_.SerializeFrame(altsvc_ir)); 5526 SpdySerializedFrame altsvc_frame(spdy_util_.SerializeFrame(altsvc_ir));
5527 SpdySerializedFrame rst( 5527 SpdySerializedFrame rst(
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
5818 ssl_info.cert = ImportCertFromFile(GetTestCertsDirectory(), 5818 ssl_info.cert = ImportCertFromFile(GetTestCertsDirectory(),
5819 "spdy_pooling.pem"); 5819 "spdy_pooling.pem");
5820 ssl_info.is_issued_by_known_root = true; 5820 ssl_info.is_issued_by_known_root = true;
5821 ssl_info.public_key_hashes.push_back(test::GetTestHashValue(primary_pin)); 5821 ssl_info.public_key_hashes.push_back(test::GetTestHashValue(primary_pin));
5822 5822
5823 EXPECT_TRUE(SpdySession::CanPool( 5823 EXPECT_TRUE(SpdySession::CanPool(
5824 &tss, ssl_info, "www.example.org", "mail.example.org")); 5824 &tss, ssl_info, "www.example.org", "mail.example.org"));
5825 } 5825 }
5826 5826
5827 } // namespace net 5827 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_session.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698