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

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

Issue 2724703002: Add AltSvcFrameTest for non-empty origin on non-zero frame. (Closed)
Patch Set: Created 3 years, 9 months 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 | « no previous file | 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 <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 5626 matching lines...) Expand 10 before | Expand all | Expand 10 after
5637 base::RunLoop().RunUntilIdle(); 5637 base::RunLoop().RunUntilIdle();
5638 5638
5639 const url::SchemeHostPort session_origin("https", test_url_.host(), 5639 const url::SchemeHostPort session_origin("https", test_url_.host(),
5640 test_url_.EffectiveIntPort()); 5640 test_url_.EffectiveIntPort());
5641 AlternativeServiceVector altsvc_vector = 5641 AlternativeServiceVector altsvc_vector =
5642 spdy_session_pool_->http_server_properties()->GetAlternativeServices( 5642 spdy_session_pool_->http_server_properties()->GetAlternativeServices(
5643 session_origin); 5643 session_origin);
5644 ASSERT_TRUE(altsvc_vector.empty()); 5644 ASSERT_TRUE(altsvc_vector.empty());
5645 } 5645 }
5646 5646
5647 TEST_F(AltSvcFrameTest,
5648 DoNotProcessAltSvcFrameWithNonEmptyOriginOnNonZeroStream) {
Ryan Hamilton 2017/03/01 03:38:47 What does "OnNonZeroStream" mean here?
Bence 2017/03/01 12:48:31 A stream that has a stream id different from zero.
Ryan Hamilton 2017/03/01 20:41:52 I suspect I'm missing something, but is there a st
5649 SpdyAltSvcIR altsvc_ir(1);
5650 altsvc_ir.add_altsvc(alternative_service_);
5651 altsvc_ir.set_origin("https://mail.example.org");
5652 AddSocketData(altsvc_ir);
5653 AddSSLSocketData();
5654
5655 CreateNetworkSession();
5656 CreateSecureSpdySession();
5657
5658 base::RunLoop().RunUntilIdle();
5659
5660 const url::SchemeHostPort session_origin("https", test_url_.host(),
5661 test_url_.EffectiveIntPort());
5662 AlternativeServiceVector altsvc_vector =
5663 spdy_session_pool_->http_server_properties()->GetAlternativeServices(
5664 session_origin);
5665 ASSERT_TRUE(altsvc_vector.empty());
5666 }
5667
5647 TEST_F(AltSvcFrameTest, ProcessAltSvcFrameOnActiveStream) { 5668 TEST_F(AltSvcFrameTest, ProcessAltSvcFrameOnActiveStream) {
5648 SpdyAltSvcIR altsvc_ir(1); 5669 SpdyAltSvcIR altsvc_ir(1);
5649 altsvc_ir.add_altsvc(alternative_service_); 5670 altsvc_ir.add_altsvc(alternative_service_);
5650 5671
5651 SpdySerializedFrame altsvc_frame(spdy_util_.SerializeFrame(altsvc_ir)); 5672 SpdySerializedFrame altsvc_frame(spdy_util_.SerializeFrame(altsvc_ir));
5652 SpdySerializedFrame rst( 5673 SpdySerializedFrame rst(
5653 spdy_util_.ConstructSpdyRstStream(1, ERROR_CODE_REFUSED_STREAM)); 5674 spdy_util_.ConstructSpdyRstStream(1, ERROR_CODE_REFUSED_STREAM));
5654 MockRead reads[] = { 5675 MockRead reads[] = {
5655 CreateMockRead(altsvc_frame, 1), CreateMockRead(rst, 2), 5676 CreateMockRead(altsvc_frame, 1), CreateMockRead(rst, 2),
5656 MockRead(ASYNC, 0, 3) // EOF 5677 MockRead(ASYNC, 0, 3) // EOF
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
6000 ssl_info.cert = ImportCertFromFile(GetTestCertsDirectory(), 6021 ssl_info.cert = ImportCertFromFile(GetTestCertsDirectory(),
6001 "spdy_pooling.pem"); 6022 "spdy_pooling.pem");
6002 ssl_info.is_issued_by_known_root = true; 6023 ssl_info.is_issued_by_known_root = true;
6003 ssl_info.public_key_hashes.push_back(test::GetTestHashValue(primary_pin)); 6024 ssl_info.public_key_hashes.push_back(test::GetTestHashValue(primary_pin));
6004 6025
6005 EXPECT_TRUE(SpdySession::CanPool( 6026 EXPECT_TRUE(SpdySession::CanPool(
6006 &tss, ssl_info, "www.example.org", "mail.example.org")); 6027 &tss, ssl_info, "www.example.org", "mail.example.org"));
6007 } 6028 }
6008 6029
6009 } // namespace net 6030 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698