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/http/http_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); | 976 scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); |
977 scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); | 977 scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); |
978 scoped_ptr<SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); | 978 scoped_ptr<SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); |
979 | 979 |
980 scoped_ptr<SpdyFrame> req3(ConstructSpdyGet(NULL, 0, false, 5, LOWEST)); | 980 scoped_ptr<SpdyFrame> req3(ConstructSpdyGet(NULL, 0, false, 5, LOWEST)); |
981 scoped_ptr<SpdyFrame> resp3(ConstructSpdyGetSynReply(NULL, 0, 5)); | 981 scoped_ptr<SpdyFrame> resp3(ConstructSpdyGetSynReply(NULL, 0, 5)); |
982 scoped_ptr<SpdyFrame> body3(ConstructSpdyBodyFrame(5, false)); | 982 scoped_ptr<SpdyFrame> body3(ConstructSpdyBodyFrame(5, false)); |
983 scoped_ptr<SpdyFrame> fbody3(ConstructSpdyBodyFrame(5, true)); | 983 scoped_ptr<SpdyFrame> fbody3(ConstructSpdyBodyFrame(5, true)); |
984 | 984 |
985 SettingsMap settings; | 985 SettingsMap settings; |
986 const size_t max_concurrent_streams = 1; | 986 const uint32 max_concurrent_streams = 1; |
987 settings[SETTINGS_MAX_CONCURRENT_STREAMS] = | 987 settings[SETTINGS_MAX_CONCURRENT_STREAMS] = |
988 SettingsFlagsAndValue(SETTINGS_FLAG_NONE, max_concurrent_streams); | 988 SettingsFlagsAndValue(SETTINGS_FLAG_NONE, max_concurrent_streams); |
989 scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); | 989 scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); |
990 | 990 |
991 MockWrite writes[] = { | 991 MockWrite writes[] = { |
992 CreateMockWrite(*req), | 992 CreateMockWrite(*req), |
993 CreateMockWrite(*req2), | 993 CreateMockWrite(*req2), |
994 CreateMockWrite(*req3), | 994 CreateMockWrite(*req3), |
995 }; | 995 }; |
996 | 996 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1110 ConstructSpdyGet(NULL, 0, false, 5, HIGHEST)); | 1110 ConstructSpdyGet(NULL, 0, false, 5, HIGHEST)); |
1111 scoped_ptr<SpdyFrame> resp4(ConstructSpdyGetSynReply(NULL, 0, 5)); | 1111 scoped_ptr<SpdyFrame> resp4(ConstructSpdyGetSynReply(NULL, 0, 5)); |
1112 scoped_ptr<SpdyFrame> fbody4(ConstructSpdyBodyFrame(5, true)); | 1112 scoped_ptr<SpdyFrame> fbody4(ConstructSpdyBodyFrame(5, true)); |
1113 | 1113 |
1114 scoped_ptr<SpdyFrame> req3(ConstructSpdyGet(NULL, 0, false, 7, LOWEST)); | 1114 scoped_ptr<SpdyFrame> req3(ConstructSpdyGet(NULL, 0, false, 7, LOWEST)); |
1115 scoped_ptr<SpdyFrame> resp3(ConstructSpdyGetSynReply(NULL, 0, 7)); | 1115 scoped_ptr<SpdyFrame> resp3(ConstructSpdyGetSynReply(NULL, 0, 7)); |
1116 scoped_ptr<SpdyFrame> body3(ConstructSpdyBodyFrame(7, false)); | 1116 scoped_ptr<SpdyFrame> body3(ConstructSpdyBodyFrame(7, false)); |
1117 scoped_ptr<SpdyFrame> fbody3(ConstructSpdyBodyFrame(7, true)); | 1117 scoped_ptr<SpdyFrame> fbody3(ConstructSpdyBodyFrame(7, true)); |
1118 | 1118 |
1119 SettingsMap settings; | 1119 SettingsMap settings; |
1120 const size_t max_concurrent_streams = 1; | 1120 const uint32 max_concurrent_streams = 1; |
1121 settings[SETTINGS_MAX_CONCURRENT_STREAMS] = | 1121 settings[SETTINGS_MAX_CONCURRENT_STREAMS] = |
1122 SettingsFlagsAndValue(SETTINGS_FLAG_NONE, max_concurrent_streams); | 1122 SettingsFlagsAndValue(SETTINGS_FLAG_NONE, max_concurrent_streams); |
1123 scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); | 1123 scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); |
1124 | 1124 |
1125 MockWrite writes[] = { CreateMockWrite(*req), | 1125 MockWrite writes[] = { CreateMockWrite(*req), |
1126 CreateMockWrite(*req2), | 1126 CreateMockWrite(*req2), |
1127 CreateMockWrite(*req4), | 1127 CreateMockWrite(*req4), |
1128 CreateMockWrite(*req3), | 1128 CreateMockWrite(*req3), |
1129 }; | 1129 }; |
1130 MockRead reads[] = { | 1130 MockRead reads[] = { |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1250 scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); | 1250 scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); |
1251 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); | 1251 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); |
1252 scoped_ptr<SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); | 1252 scoped_ptr<SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); |
1253 | 1253 |
1254 scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); | 1254 scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); |
1255 scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); | 1255 scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); |
1256 scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); | 1256 scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); |
1257 scoped_ptr<SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); | 1257 scoped_ptr<SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); |
1258 | 1258 |
1259 SettingsMap settings; | 1259 SettingsMap settings; |
1260 const size_t max_concurrent_streams = 1; | 1260 const uint32 max_concurrent_streams = 1; |
1261 settings[SETTINGS_MAX_CONCURRENT_STREAMS] = | 1261 settings[SETTINGS_MAX_CONCURRENT_STREAMS] = |
1262 SettingsFlagsAndValue(SETTINGS_FLAG_NONE, max_concurrent_streams); | 1262 SettingsFlagsAndValue(SETTINGS_FLAG_NONE, max_concurrent_streams); |
1263 scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); | 1263 scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); |
1264 | 1264 |
1265 MockWrite writes[] = { CreateMockWrite(*req), | 1265 MockWrite writes[] = { CreateMockWrite(*req), |
1266 CreateMockWrite(*req2), | 1266 CreateMockWrite(*req2), |
1267 }; | 1267 }; |
1268 MockRead reads[] = { | 1268 MockRead reads[] = { |
1269 CreateMockRead(*settings_frame, 1), | 1269 CreateMockRead(*settings_frame, 1), |
1270 CreateMockRead(*resp), | 1270 CreateMockRead(*resp), |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1381 // Construct the request. | 1381 // Construct the request. |
1382 scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); | 1382 scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); |
1383 scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); | 1383 scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); |
1384 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); | 1384 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); |
1385 scoped_ptr<SpdyFrame> fin_body(ConstructSpdyBodyFrame(1, true)); | 1385 scoped_ptr<SpdyFrame> fin_body(ConstructSpdyBodyFrame(1, true)); |
1386 | 1386 |
1387 scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); | 1387 scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); |
1388 scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); | 1388 scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); |
1389 | 1389 |
1390 SettingsMap settings; | 1390 SettingsMap settings; |
1391 const size_t max_concurrent_streams = 1; | 1391 const uint32 max_concurrent_streams = 1; |
1392 settings[SETTINGS_MAX_CONCURRENT_STREAMS] = | 1392 settings[SETTINGS_MAX_CONCURRENT_STREAMS] = |
1393 SettingsFlagsAndValue(SETTINGS_FLAG_NONE, max_concurrent_streams); | 1393 SettingsFlagsAndValue(SETTINGS_FLAG_NONE, max_concurrent_streams); |
1394 scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); | 1394 scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); |
1395 | 1395 |
1396 MockWrite writes[] = { CreateMockWrite(*req), | 1396 MockWrite writes[] = { CreateMockWrite(*req), |
1397 CreateMockWrite(*req2), | 1397 CreateMockWrite(*req2), |
1398 }; | 1398 }; |
1399 MockRead reads[] = { | 1399 MockRead reads[] = { |
1400 CreateMockRead(*settings_frame, 1), | 1400 CreateMockRead(*settings_frame, 1), |
1401 CreateMockRead(*resp), | 1401 CreateMockRead(*resp), |
(...skipping 4369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5771 // And now we can allow everything else to run to completion. | 5771 // And now we can allow everything else to run to completion. |
5772 data.SetStop(10); | 5772 data.SetStop(10); |
5773 data.Run(); | 5773 data.Run(); |
5774 EXPECT_EQ(OK, callback2.WaitForResult()); | 5774 EXPECT_EQ(OK, callback2.WaitForResult()); |
5775 EXPECT_EQ(OK, callback3.WaitForResult()); | 5775 EXPECT_EQ(OK, callback3.WaitForResult()); |
5776 | 5776 |
5777 helper.VerifyDataConsumed(); | 5777 helper.VerifyDataConsumed(); |
5778 } | 5778 } |
5779 | 5779 |
5780 } // namespace net | 5780 } // namespace net |
OLD | NEW |