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 "net/base/host_cache.h" | 7 #include "net/base/host_cache.h" |
8 #include "net/base/ip_endpoint.h" | 8 #include "net/base/ip_endpoint.h" |
9 #include "net/base/net_log_unittest.h" | 9 #include "net/base/net_log_unittest.h" |
10 #include "net/spdy/spdy_io_buffer.h" | 10 #include "net/spdy/spdy_io_buffer.h" |
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 // settings frame setting max concurrent streams to 2. Have the callback | 653 // settings frame setting max concurrent streams to 2. Have the callback |
654 // release the stream, which releases its reference (the last) to the session. | 654 // release the stream, which releases its reference (the last) to the session. |
655 // Make sure nothing blows up. | 655 // Make sure nothing blows up. |
656 // http://crbug.com/57331 | 656 // http://crbug.com/57331 |
657 TEST_F(SpdySessionSpdy2Test, OnSettings) { | 657 TEST_F(SpdySessionSpdy2Test, OnSettings) { |
658 SpdySessionDependencies session_deps; | 658 SpdySessionDependencies session_deps; |
659 session_deps.host_resolver->set_synchronous_mode(true); | 659 session_deps.host_resolver->set_synchronous_mode(true); |
660 | 660 |
661 SettingsMap new_settings; | 661 SettingsMap new_settings; |
662 const SpdySettingsIds kSpdySettingsIds1 = SETTINGS_MAX_CONCURRENT_STREAMS; | 662 const SpdySettingsIds kSpdySettingsIds1 = SETTINGS_MAX_CONCURRENT_STREAMS; |
663 const size_t max_concurrent_streams = 2; | 663 const uint32 max_concurrent_streams = 2; |
664 new_settings[kSpdySettingsIds1] = | 664 new_settings[kSpdySettingsIds1] = |
665 SettingsFlagsAndValue(SETTINGS_FLAG_NONE, max_concurrent_streams); | 665 SettingsFlagsAndValue(SETTINGS_FLAG_NONE, max_concurrent_streams); |
666 | 666 |
667 // Set up the socket so we read a SETTINGS frame that raises max concurrent | 667 // Set up the socket so we read a SETTINGS frame that raises max concurrent |
668 // streams to 2. | 668 // streams to 2. |
669 MockConnect connect_data(SYNCHRONOUS, OK); | 669 MockConnect connect_data(SYNCHRONOUS, OK); |
670 scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(new_settings)); | 670 scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(new_settings)); |
671 MockRead reads[] = { | 671 MockRead reads[] = { |
672 CreateMockRead(*settings_frame), | 672 CreateMockRead(*settings_frame), |
673 MockRead(SYNCHRONOUS, 0, 0) // EOF | 673 MockRead(SYNCHRONOUS, 0, 0) // EOF |
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1580 session->CloseSessionOnError(ERR_ABORTED, true, ""); | 1580 session->CloseSessionOnError(ERR_ABORTED, true, ""); |
1581 | 1581 |
1582 EXPECT_TRUE(spdy_stream1->closed()); | 1582 EXPECT_TRUE(spdy_stream1->closed()); |
1583 EXPECT_TRUE(spdy_stream2->closed()); | 1583 EXPECT_TRUE(spdy_stream2->closed()); |
1584 | 1584 |
1585 spdy_stream1 = NULL; | 1585 spdy_stream1 = NULL; |
1586 spdy_stream2 = NULL; | 1586 spdy_stream2 = NULL; |
1587 } | 1587 } |
1588 | 1588 |
1589 } // namespace net | 1589 } // namespace net |
OLD | NEW |