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 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
979 scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); | 979 scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); |
980 scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); | 980 scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); |
981 scoped_ptr<SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); | 981 scoped_ptr<SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); |
982 | 982 |
983 scoped_ptr<SpdyFrame> req3(ConstructSpdyGet(NULL, 0, false, 5, LOWEST)); | 983 scoped_ptr<SpdyFrame> req3(ConstructSpdyGet(NULL, 0, false, 5, LOWEST)); |
984 scoped_ptr<SpdyFrame> resp3(ConstructSpdyGetSynReply(NULL, 0, 5)); | 984 scoped_ptr<SpdyFrame> resp3(ConstructSpdyGetSynReply(NULL, 0, 5)); |
985 scoped_ptr<SpdyFrame> body3(ConstructSpdyBodyFrame(5, false)); | 985 scoped_ptr<SpdyFrame> body3(ConstructSpdyBodyFrame(5, false)); |
986 scoped_ptr<SpdyFrame> fbody3(ConstructSpdyBodyFrame(5, true)); | 986 scoped_ptr<SpdyFrame> fbody3(ConstructSpdyBodyFrame(5, true)); |
987 | 987 |
988 SettingsMap settings; | 988 SettingsMap settings; |
989 const size_t max_concurrent_streams = 1; | 989 const uint32 max_concurrent_streams = 1; |
990 settings[SETTINGS_MAX_CONCURRENT_STREAMS] = | 990 settings[SETTINGS_MAX_CONCURRENT_STREAMS] = |
991 SettingsFlagsAndValue(SETTINGS_FLAG_NONE, max_concurrent_streams); | 991 SettingsFlagsAndValue(SETTINGS_FLAG_NONE, max_concurrent_streams); |
992 scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); | 992 scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); |
993 | 993 |
994 MockWrite writes[] = { | 994 MockWrite writes[] = { |
995 CreateMockWrite(*req), | 995 CreateMockWrite(*req), |
996 CreateMockWrite(*req2), | 996 CreateMockWrite(*req2), |
997 CreateMockWrite(*req3), | 997 CreateMockWrite(*req3), |
998 }; | 998 }; |
999 | 999 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1113 ConstructSpdyGet(NULL, 0, false, 5, HIGHEST)); | 1113 ConstructSpdyGet(NULL, 0, false, 5, HIGHEST)); |
1114 scoped_ptr<SpdyFrame> resp4(ConstructSpdyGetSynReply(NULL, 0, 5)); | 1114 scoped_ptr<SpdyFrame> resp4(ConstructSpdyGetSynReply(NULL, 0, 5)); |
1115 scoped_ptr<SpdyFrame> fbody4(ConstructSpdyBodyFrame(5, true)); | 1115 scoped_ptr<SpdyFrame> fbody4(ConstructSpdyBodyFrame(5, true)); |
1116 | 1116 |
1117 scoped_ptr<SpdyFrame> req3(ConstructSpdyGet(NULL, 0, false, 7, LOWEST)); | 1117 scoped_ptr<SpdyFrame> req3(ConstructSpdyGet(NULL, 0, false, 7, LOWEST)); |
1118 scoped_ptr<SpdyFrame> resp3(ConstructSpdyGetSynReply(NULL, 0, 7)); | 1118 scoped_ptr<SpdyFrame> resp3(ConstructSpdyGetSynReply(NULL, 0, 7)); |
1119 scoped_ptr<SpdyFrame> body3(ConstructSpdyBodyFrame(7, false)); | 1119 scoped_ptr<SpdyFrame> body3(ConstructSpdyBodyFrame(7, false)); |
1120 scoped_ptr<SpdyFrame> fbody3(ConstructSpdyBodyFrame(7, true)); | 1120 scoped_ptr<SpdyFrame> fbody3(ConstructSpdyBodyFrame(7, true)); |
1121 | 1121 |
1122 SettingsMap settings; | 1122 SettingsMap settings; |
1123 const size_t max_concurrent_streams = 1; | 1123 const uint32 max_concurrent_streams = 1; |
1124 settings[SETTINGS_MAX_CONCURRENT_STREAMS] = | 1124 settings[SETTINGS_MAX_CONCURRENT_STREAMS] = |
1125 SettingsFlagsAndValue(SETTINGS_FLAG_NONE, max_concurrent_streams); | 1125 SettingsFlagsAndValue(SETTINGS_FLAG_NONE, max_concurrent_streams); |
1126 scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); | 1126 scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); |
1127 | 1127 |
1128 MockWrite writes[] = { CreateMockWrite(*req), | 1128 MockWrite writes[] = { CreateMockWrite(*req), |
1129 CreateMockWrite(*req2), | 1129 CreateMockWrite(*req2), |
1130 CreateMockWrite(*req4), | 1130 CreateMockWrite(*req4), |
1131 CreateMockWrite(*req3), | 1131 CreateMockWrite(*req3), |
1132 }; | 1132 }; |
1133 MockRead reads[] = { | 1133 MockRead reads[] = { |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1253 scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); | 1253 scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); |
1254 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); | 1254 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); |
1255 scoped_ptr<SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); | 1255 scoped_ptr<SpdyFrame> fbody(ConstructSpdyBodyFrame(1, true)); |
1256 | 1256 |
1257 scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); | 1257 scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); |
1258 scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); | 1258 scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); |
1259 scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); | 1259 scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(3, false)); |
1260 scoped_ptr<SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); | 1260 scoped_ptr<SpdyFrame> fbody2(ConstructSpdyBodyFrame(3, true)); |
1261 | 1261 |
1262 SettingsMap settings; | 1262 SettingsMap settings; |
1263 const size_t max_concurrent_streams = 1; | 1263 const uint32 max_concurrent_streams = 1; |
1264 settings[SETTINGS_MAX_CONCURRENT_STREAMS] = | 1264 settings[SETTINGS_MAX_CONCURRENT_STREAMS] = |
1265 SettingsFlagsAndValue(SETTINGS_FLAG_NONE, max_concurrent_streams); | 1265 SettingsFlagsAndValue(SETTINGS_FLAG_NONE, max_concurrent_streams); |
1266 scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); | 1266 scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); |
1267 | 1267 |
1268 MockWrite writes[] = { CreateMockWrite(*req), | 1268 MockWrite writes[] = { CreateMockWrite(*req), |
1269 CreateMockWrite(*req2), | 1269 CreateMockWrite(*req2), |
1270 }; | 1270 }; |
1271 MockRead reads[] = { | 1271 MockRead reads[] = { |
1272 CreateMockRead(*settings_frame, 1), | 1272 CreateMockRead(*settings_frame, 1), |
1273 CreateMockRead(*resp), | 1273 CreateMockRead(*resp), |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1384 // Construct the request. | 1384 // Construct the request. |
1385 scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); | 1385 scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); |
1386 scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); | 1386 scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); |
1387 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); | 1387 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, false)); |
1388 scoped_ptr<SpdyFrame> fin_body(ConstructSpdyBodyFrame(1, true)); | 1388 scoped_ptr<SpdyFrame> fin_body(ConstructSpdyBodyFrame(1, true)); |
1389 | 1389 |
1390 scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); | 1390 scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, LOWEST)); |
1391 scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); | 1391 scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 3)); |
1392 | 1392 |
1393 SettingsMap settings; | 1393 SettingsMap settings; |
1394 const size_t max_concurrent_streams = 1; | 1394 const uint32 max_concurrent_streams = 1; |
1395 settings[SETTINGS_MAX_CONCURRENT_STREAMS] = | 1395 settings[SETTINGS_MAX_CONCURRENT_STREAMS] = |
1396 SettingsFlagsAndValue(SETTINGS_FLAG_NONE, max_concurrent_streams); | 1396 SettingsFlagsAndValue(SETTINGS_FLAG_NONE, max_concurrent_streams); |
1397 scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); | 1397 scoped_ptr<SpdyFrame> settings_frame(ConstructSpdySettings(settings)); |
1398 | 1398 |
1399 MockWrite writes[] = { CreateMockWrite(*req), | 1399 MockWrite writes[] = { CreateMockWrite(*req), |
1400 CreateMockWrite(*req2), | 1400 CreateMockWrite(*req2), |
1401 }; | 1401 }; |
1402 MockRead reads[] = { | 1402 MockRead reads[] = { |
1403 CreateMockRead(*settings_frame, 1), | 1403 CreateMockRead(*settings_frame, 1), |
1404 CreateMockRead(*resp), | 1404 CreateMockRead(*resp), |
(...skipping 4950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6355 // And now we can allow everything else to run to completion. | 6355 // And now we can allow everything else to run to completion. |
6356 data.SetStop(10); | 6356 data.SetStop(10); |
6357 data.Run(); | 6357 data.Run(); |
6358 EXPECT_EQ(OK, callback2.WaitForResult()); | 6358 EXPECT_EQ(OK, callback2.WaitForResult()); |
6359 EXPECT_EQ(OK, callback3.WaitForResult()); | 6359 EXPECT_EQ(OK, callback3.WaitForResult()); |
6360 | 6360 |
6361 helper.VerifyDataConsumed(); | 6361 helper.VerifyDataConsumed(); |
6362 } | 6362 } |
6363 | 6363 |
6364 } // namespace net | 6364 } // namespace net |
OLD | NEW |