| 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 3073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3084 EXPECT_TRUE(response.headers.get() != NULL); | 3084 EXPECT_TRUE(response.headers.get() != NULL); |
| 3085 EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); | 3085 EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); |
| 3086 | 3086 |
| 3087 // Verify the pushed stream. | 3087 // Verify the pushed stream. |
| 3088 EXPECT_TRUE(response2.headers.get() != NULL); | 3088 EXPECT_TRUE(response2.headers.get() != NULL); |
| 3089 EXPECT_EQ("HTTP/1.1 200 OK", response2.headers->GetStatusLine()); | 3089 EXPECT_EQ("HTTP/1.1 200 OK", response2.headers->GetStatusLine()); |
| 3090 } | 3090 } |
| 3091 | 3091 |
| 3092 TEST_P(SpdyNetworkTransactionTest, ServerPushInvalidAssociatedStreamID0) { | 3092 TEST_P(SpdyNetworkTransactionTest, ServerPushInvalidAssociatedStreamID0) { |
| 3093 if (spdy_util_.spdy_version() == SPDY4) { | 3093 if (spdy_util_.spdy_version() == SPDY4) { |
| 3094 // TODO(jgraettinger): We don't support associated stream | 3094 // PUSH_PROMISE with stream id 0 is connection-level error. |
| 3095 // checks in SPDY4 yet. | 3095 // TODO(baranovich): Test session going away. |
| 3096 return; | 3096 return; |
| 3097 } | 3097 } |
| 3098 |
| 3098 scoped_ptr<SpdyFrame> stream1_syn( | 3099 scoped_ptr<SpdyFrame> stream1_syn( |
| 3099 spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true)); | 3100 spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true)); |
| 3100 scoped_ptr<SpdyFrame> stream1_body( | 3101 scoped_ptr<SpdyFrame> stream1_body( |
| 3101 spdy_util_.ConstructSpdyBodyFrame(1, true)); | 3102 spdy_util_.ConstructSpdyBodyFrame(1, true)); |
| 3102 scoped_ptr<SpdyFrame> stream2_rst( | 3103 scoped_ptr<SpdyFrame> stream2_rst( |
| 3103 spdy_util_.ConstructSpdyRstStream(2, RST_STREAM_REFUSED_STREAM)); | 3104 spdy_util_.ConstructSpdyRstStream(2, RST_STREAM_REFUSED_STREAM)); |
| 3104 MockWrite writes[] = { | 3105 MockWrite writes[] = { |
| 3105 CreateMockWrite(*stream1_syn, 1), | 3106 CreateMockWrite(*stream1_syn, 1), |
| 3106 CreateMockWrite(*stream2_rst, 4), | 3107 CreateMockWrite(*stream2_rst, 4), |
| 3107 }; | 3108 }; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3149 << " Write index: " | 3150 << " Write index: " |
| 3150 << data.write_index(); | 3151 << data.write_index(); |
| 3151 | 3152 |
| 3152 // Verify the SYN_REPLY. | 3153 // Verify the SYN_REPLY. |
| 3153 HttpResponseInfo response = *trans->GetResponseInfo(); | 3154 HttpResponseInfo response = *trans->GetResponseInfo(); |
| 3154 EXPECT_TRUE(response.headers.get() != NULL); | 3155 EXPECT_TRUE(response.headers.get() != NULL); |
| 3155 EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); | 3156 EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); |
| 3156 } | 3157 } |
| 3157 | 3158 |
| 3158 TEST_P(SpdyNetworkTransactionTest, ServerPushInvalidAssociatedStreamID9) { | 3159 TEST_P(SpdyNetworkTransactionTest, ServerPushInvalidAssociatedStreamID9) { |
| 3159 if (spdy_util_.spdy_version() == SPDY4) { | |
| 3160 // TODO(jgraettinger): We don't support associated stream | |
| 3161 // checks in SPDY4 yet. | |
| 3162 return; | |
| 3163 } | |
| 3164 scoped_ptr<SpdyFrame> stream1_syn( | 3160 scoped_ptr<SpdyFrame> stream1_syn( |
| 3165 spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true)); | 3161 spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true)); |
| 3166 scoped_ptr<SpdyFrame> stream1_body( | 3162 scoped_ptr<SpdyFrame> stream1_body( |
| 3167 spdy_util_.ConstructSpdyBodyFrame(1, true)); | 3163 spdy_util_.ConstructSpdyBodyFrame(1, true)); |
| 3168 scoped_ptr<SpdyFrame> stream2_rst( | 3164 scoped_ptr<SpdyFrame> stream2_rst( |
| 3169 spdy_util_.ConstructSpdyRstStream(2, RST_STREAM_INVALID_STREAM)); | 3165 spdy_util_.ConstructSpdyRstStream(2, RST_STREAM_INVALID_STREAM)); |
| 3170 MockWrite writes[] = { | 3166 MockWrite writes[] = { |
| 3171 CreateMockWrite(*stream1_syn, 1), | 3167 CreateMockWrite(*stream1_syn, 1), |
| 3172 CreateMockWrite(*stream2_rst, 4), | 3168 CreateMockWrite(*stream2_rst, 4), |
| 3173 }; | 3169 }; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3232 CreateMockWrite(*stream1_syn, 1), | 3228 CreateMockWrite(*stream1_syn, 1), |
| 3233 CreateMockWrite(*stream2_rst, 4), | 3229 CreateMockWrite(*stream2_rst, 4), |
| 3234 }; | 3230 }; |
| 3235 | 3231 |
| 3236 scoped_ptr<SpdyFrame> | 3232 scoped_ptr<SpdyFrame> |
| 3237 stream1_reply(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1)); | 3233 stream1_reply(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1)); |
| 3238 scoped_ptr<SpdyHeaderBlock> incomplete_headers(new SpdyHeaderBlock()); | 3234 scoped_ptr<SpdyHeaderBlock> incomplete_headers(new SpdyHeaderBlock()); |
| 3239 (*incomplete_headers)["hello"] = "bye"; | 3235 (*incomplete_headers)["hello"] = "bye"; |
| 3240 (*incomplete_headers)[spdy_util_.GetStatusKey()] = "200 OK"; | 3236 (*incomplete_headers)[spdy_util_.GetStatusKey()] = "200 OK"; |
| 3241 (*incomplete_headers)[spdy_util_.GetVersionKey()] = "HTTP/1.1"; | 3237 (*incomplete_headers)[spdy_util_.GetVersionKey()] = "HTTP/1.1"; |
| 3242 scoped_ptr<SpdyFrame> stream2_syn( | 3238 scoped_ptr<SpdyFrame> stream2_syn(spdy_util_.ConstructInitialSpdyPushFrame( |
| 3243 spdy_util_.ConstructSpdyControlFrame(incomplete_headers.Pass(), | 3239 incomplete_headers.Pass(), 2, 1)); |
| 3244 false, | |
| 3245 2, // Stream ID | |
| 3246 LOWEST, | |
| 3247 SYN_STREAM, | |
| 3248 CONTROL_FLAG_NONE, | |
| 3249 // Associated stream ID | |
| 3250 1)); | |
| 3251 MockRead reads[] = { | 3240 MockRead reads[] = { |
| 3252 CreateMockRead(*stream1_reply, 2), | 3241 CreateMockRead(*stream1_reply, 2), |
| 3253 CreateMockRead(*stream2_syn, 3), | 3242 CreateMockRead(*stream2_syn, 3), |
| 3254 CreateMockRead(*stream1_body, 4), | 3243 CreateMockRead(*stream1_body, 4), |
| 3255 MockRead(ASYNC, ERR_IO_PENDING, 5) // Force a pause | 3244 MockRead(ASYNC, ERR_IO_PENDING, 5) // Force a pause |
| 3256 }; | 3245 }; |
| 3257 | 3246 |
| 3258 OrderedSocketData data(reads, arraysize(reads), | 3247 OrderedSocketData data(reads, arraysize(reads), |
| 3259 writes, arraysize(writes)); | 3248 writes, arraysize(writes)); |
| 3260 NormalSpdyTransactionHelper helper(CreateGetRequest(), DEFAULT_PRIORITY, | 3249 NormalSpdyTransactionHelper helper(CreateGetRequest(), DEFAULT_PRIORITY, |
| (...skipping 1937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5198 scoped_ptr<SpdyFrame> stream1_body( | 5187 scoped_ptr<SpdyFrame> stream1_body( |
| 5199 spdy_util_.ConstructSpdyBodyFrame(1, true)); | 5188 spdy_util_.ConstructSpdyBodyFrame(1, true)); |
| 5200 MockWrite writes[] = { | 5189 MockWrite writes[] = { |
| 5201 CreateMockWrite(*stream1_syn, 1), | 5190 CreateMockWrite(*stream1_syn, 1), |
| 5202 }; | 5191 }; |
| 5203 | 5192 |
| 5204 scoped_ptr<SpdyHeaderBlock> initial_headers(new SpdyHeaderBlock()); | 5193 scoped_ptr<SpdyHeaderBlock> initial_headers(new SpdyHeaderBlock()); |
| 5205 spdy_util_.AddUrlToHeaderBlock( | 5194 spdy_util_.AddUrlToHeaderBlock( |
| 5206 "http://www.google.com/foo.dat", initial_headers.get()); | 5195 "http://www.google.com/foo.dat", initial_headers.get()); |
| 5207 scoped_ptr<SpdyFrame> stream2_syn( | 5196 scoped_ptr<SpdyFrame> stream2_syn( |
| 5208 spdy_util_.ConstructSpdyControlFrame(initial_headers.Pass(), | 5197 spdy_util_.ConstructInitialSpdyPushFrame(initial_headers.Pass(), 2, 1)); |
| 5209 false, | |
| 5210 2, | |
| 5211 LOWEST, | |
| 5212 SYN_STREAM, | |
| 5213 CONTROL_FLAG_NONE, | |
| 5214 1)); | |
| 5215 | 5198 |
| 5216 scoped_ptr<SpdyHeaderBlock> late_headers(new SpdyHeaderBlock()); | 5199 scoped_ptr<SpdyHeaderBlock> late_headers(new SpdyHeaderBlock()); |
| 5217 (*late_headers)["hello"] = "bye"; | 5200 (*late_headers)["hello"] = "bye"; |
| 5218 (*late_headers)[spdy_util_.GetStatusKey()] = "200"; | 5201 (*late_headers)[spdy_util_.GetStatusKey()] = "200"; |
| 5219 (*late_headers)[spdy_util_.GetVersionKey()] = "HTTP/1.1"; | 5202 (*late_headers)[spdy_util_.GetVersionKey()] = "HTTP/1.1"; |
| 5220 scoped_ptr<SpdyFrame> stream2_headers( | 5203 scoped_ptr<SpdyFrame> stream2_headers( |
| 5221 spdy_util_.ConstructSpdyControlFrame(late_headers.Pass(), | 5204 spdy_util_.ConstructSpdyControlFrame(late_headers.Pass(), |
| 5222 false, | 5205 false, |
| 5223 2, | 5206 2, |
| 5224 LOWEST, | 5207 LOWEST, |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5267 scoped_ptr<SpdyFrame> stream1_body( | 5250 scoped_ptr<SpdyFrame> stream1_body( |
| 5268 spdy_util_.ConstructSpdyBodyFrame(1, true)); | 5251 spdy_util_.ConstructSpdyBodyFrame(1, true)); |
| 5269 MockWrite writes[] = { | 5252 MockWrite writes[] = { |
| 5270 CreateMockWrite(*stream1_syn, 0, SYNCHRONOUS), | 5253 CreateMockWrite(*stream1_syn, 0, SYNCHRONOUS), |
| 5271 }; | 5254 }; |
| 5272 | 5255 |
| 5273 scoped_ptr<SpdyHeaderBlock> initial_headers(new SpdyHeaderBlock()); | 5256 scoped_ptr<SpdyHeaderBlock> initial_headers(new SpdyHeaderBlock()); |
| 5274 spdy_util_.AddUrlToHeaderBlock( | 5257 spdy_util_.AddUrlToHeaderBlock( |
| 5275 "http://www.google.com/foo.dat", initial_headers.get()); | 5258 "http://www.google.com/foo.dat", initial_headers.get()); |
| 5276 scoped_ptr<SpdyFrame> stream2_syn( | 5259 scoped_ptr<SpdyFrame> stream2_syn( |
| 5277 spdy_util_.ConstructSpdyControlFrame(initial_headers.Pass(), | 5260 spdy_util_.ConstructInitialSpdyPushFrame(initial_headers.Pass(), 2, 1)); |
| 5278 false, | |
| 5279 2, | |
| 5280 LOWEST, | |
| 5281 SYN_STREAM, | |
| 5282 CONTROL_FLAG_NONE, | |
| 5283 1)); | |
| 5284 | 5261 |
| 5285 scoped_ptr<SpdyHeaderBlock> late_headers(new SpdyHeaderBlock()); | 5262 scoped_ptr<SpdyHeaderBlock> late_headers(new SpdyHeaderBlock()); |
| 5286 (*late_headers)["hello"] = "bye"; | 5263 (*late_headers)["hello"] = "bye"; |
| 5287 (*late_headers)[spdy_util_.GetStatusKey()] = "200"; | 5264 (*late_headers)[spdy_util_.GetStatusKey()] = "200"; |
| 5288 (*late_headers)[spdy_util_.GetVersionKey()] = "HTTP/1.1"; | 5265 (*late_headers)[spdy_util_.GetVersionKey()] = "HTTP/1.1"; |
| 5289 scoped_ptr<SpdyFrame> stream2_headers( | 5266 scoped_ptr<SpdyFrame> stream2_headers( |
| 5290 spdy_util_.ConstructSpdyControlFrame(late_headers.Pass(), | 5267 spdy_util_.ConstructSpdyControlFrame(late_headers.Pass(), |
| 5291 false, | 5268 false, |
| 5292 2, | 5269 2, |
| 5293 LOWEST, | 5270 LOWEST, |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5390 // We push a stream and attempt to claim it before the headers come down. | 5367 // We push a stream and attempt to claim it before the headers come down. |
| 5391 scoped_ptr<SpdyFrame> stream1_syn( | 5368 scoped_ptr<SpdyFrame> stream1_syn( |
| 5392 spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true)); | 5369 spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true)); |
| 5393 scoped_ptr<SpdyFrame> stream1_body( | 5370 scoped_ptr<SpdyFrame> stream1_body( |
| 5394 spdy_util_.ConstructSpdyBodyFrame(1, true)); | 5371 spdy_util_.ConstructSpdyBodyFrame(1, true)); |
| 5395 MockWrite writes[] = { | 5372 MockWrite writes[] = { |
| 5396 CreateMockWrite(*stream1_syn, 0, SYNCHRONOUS), | 5373 CreateMockWrite(*stream1_syn, 0, SYNCHRONOUS), |
| 5397 }; | 5374 }; |
| 5398 | 5375 |
| 5399 scoped_ptr<SpdyHeaderBlock> initial_headers(new SpdyHeaderBlock()); | 5376 scoped_ptr<SpdyHeaderBlock> initial_headers(new SpdyHeaderBlock()); |
| 5400 (*initial_headers)["alpha"] = "beta"; | 5377 if (spdy_util_.spdy_version() < SPDY4) { |
| 5378 // In SPDY4 PUSH_PROMISE headers won't show up in the response headers. |
| 5379 (*initial_headers)["alpha"] = "beta"; |
| 5380 } |
| 5401 spdy_util_.AddUrlToHeaderBlock( | 5381 spdy_util_.AddUrlToHeaderBlock( |
| 5402 "http://www.google.com/foo.dat", initial_headers.get()); | 5382 "http://www.google.com/foo.dat", initial_headers.get()); |
| 5403 scoped_ptr<SpdyFrame> stream2_syn( | 5383 scoped_ptr<SpdyFrame> stream2_syn( |
| 5404 spdy_util_.ConstructSpdyControlFrame(initial_headers.Pass(), | 5384 spdy_util_.ConstructInitialSpdyPushFrame(initial_headers.Pass(), 2, 1)); |
| 5405 false, | |
| 5406 2, | |
| 5407 LOWEST, | |
| 5408 SYN_STREAM, | |
| 5409 CONTROL_FLAG_NONE, | |
| 5410 1)); | |
| 5411 | 5385 |
| 5412 scoped_ptr<SpdyHeaderBlock> middle_headers(new SpdyHeaderBlock()); | 5386 scoped_ptr<SpdyHeaderBlock> middle_headers(new SpdyHeaderBlock()); |
| 5413 (*middle_headers)["hello"] = "bye"; | 5387 (*middle_headers)["hello"] = "bye"; |
| 5414 scoped_ptr<SpdyFrame> stream2_headers1( | 5388 scoped_ptr<SpdyFrame> stream2_headers1( |
| 5415 spdy_util_.ConstructSpdyControlFrame(middle_headers.Pass(), | 5389 spdy_util_.ConstructSpdyControlFrame(middle_headers.Pass(), |
| 5416 false, | 5390 false, |
| 5417 2, | 5391 2, |
| 5418 LOWEST, | 5392 LOWEST, |
| 5419 HEADERS, | 5393 HEADERS, |
| 5420 CONTROL_FLAG_NONE, | 5394 CONTROL_FLAG_NONE, |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5508 | 5482 |
| 5509 // Verify the SYN_REPLY. | 5483 // Verify the SYN_REPLY. |
| 5510 EXPECT_TRUE(response.headers.get() != NULL); | 5484 EXPECT_TRUE(response.headers.get() != NULL); |
| 5511 EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); | 5485 EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); |
| 5512 | 5486 |
| 5513 // Verify the pushed stream. | 5487 // Verify the pushed stream. |
| 5514 EXPECT_TRUE(response2.headers.get() != NULL); | 5488 EXPECT_TRUE(response2.headers.get() != NULL); |
| 5515 EXPECT_EQ("HTTP/1.1 200 OK", response2.headers->GetStatusLine()); | 5489 EXPECT_EQ("HTTP/1.1 200 OK", response2.headers->GetStatusLine()); |
| 5516 | 5490 |
| 5517 // Verify we got all the headers from all header blocks. | 5491 // Verify we got all the headers from all header blocks. |
| 5518 EXPECT_TRUE(response2.headers->HasHeaderValue("alpha", "beta")); | 5492 if (spdy_util_.spdy_version() < SPDY4) |
| 5493 EXPECT_TRUE(response2.headers->HasHeaderValue("alpha", "beta")); |
| 5519 EXPECT_TRUE(response2.headers->HasHeaderValue("hello", "bye")); | 5494 EXPECT_TRUE(response2.headers->HasHeaderValue("hello", "bye")); |
| 5520 EXPECT_TRUE(response2.headers->HasHeaderValue("status", "200")); | 5495 EXPECT_TRUE(response2.headers->HasHeaderValue("status", "200")); |
| 5521 | 5496 |
| 5522 // Read the final EOF (which will close the session) | 5497 // Read the final EOF (which will close the session) |
| 5523 data.RunFor(1); | 5498 data.RunFor(1); |
| 5524 | 5499 |
| 5525 // Verify that we consumed all test data. | 5500 // Verify that we consumed all test data. |
| 5526 EXPECT_TRUE(data.at_read_eof()); | 5501 EXPECT_TRUE(data.at_read_eof()); |
| 5527 EXPECT_TRUE(data.at_write_eof()); | 5502 EXPECT_TRUE(data.at_write_eof()); |
| 5528 } | 5503 } |
| 5529 | 5504 |
| 5530 TEST_P(SpdyNetworkTransactionTest, ServerPushWithNoStatusHeaderFrames) { | 5505 TEST_P(SpdyNetworkTransactionTest, ServerPushWithNoStatusHeaderFrames) { |
| 5531 // We push a stream and attempt to claim it before the headers come down. | 5506 // We push a stream and attempt to claim it before the headers come down. |
| 5532 scoped_ptr<SpdyFrame> stream1_syn( | 5507 scoped_ptr<SpdyFrame> stream1_syn( |
| 5533 spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true)); | 5508 spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true)); |
| 5534 scoped_ptr<SpdyFrame> stream1_body( | 5509 scoped_ptr<SpdyFrame> stream1_body( |
| 5535 spdy_util_.ConstructSpdyBodyFrame(1, true)); | 5510 spdy_util_.ConstructSpdyBodyFrame(1, true)); |
| 5536 MockWrite writes[] = { | 5511 MockWrite writes[] = { |
| 5537 CreateMockWrite(*stream1_syn, 0, SYNCHRONOUS), | 5512 CreateMockWrite(*stream1_syn, 0, SYNCHRONOUS), |
| 5538 }; | 5513 }; |
| 5539 | 5514 |
| 5540 scoped_ptr<SpdyHeaderBlock> initial_headers(new SpdyHeaderBlock()); | 5515 scoped_ptr<SpdyHeaderBlock> initial_headers(new SpdyHeaderBlock()); |
| 5541 spdy_util_.AddUrlToHeaderBlock( | 5516 spdy_util_.AddUrlToHeaderBlock( |
| 5542 "http://www.google.com/foo.dat", initial_headers.get()); | 5517 "http://www.google.com/foo.dat", initial_headers.get()); |
| 5543 scoped_ptr<SpdyFrame> stream2_syn( | 5518 scoped_ptr<SpdyFrame> stream2_syn( |
| 5544 spdy_util_.ConstructSpdyControlFrame(initial_headers.Pass(), | 5519 spdy_util_.ConstructInitialSpdyPushFrame(initial_headers.Pass(), 2, 1)); |
| 5545 false, | |
| 5546 2, | |
| 5547 LOWEST, | |
| 5548 SYN_STREAM, | |
| 5549 CONTROL_FLAG_NONE, | |
| 5550 1)); | |
| 5551 | 5520 |
| 5552 scoped_ptr<SpdyHeaderBlock> middle_headers(new SpdyHeaderBlock()); | 5521 scoped_ptr<SpdyHeaderBlock> middle_headers(new SpdyHeaderBlock()); |
| 5553 (*middle_headers)["hello"] = "bye"; | 5522 (*middle_headers)["hello"] = "bye"; |
| 5554 scoped_ptr<SpdyFrame> stream2_headers1( | 5523 scoped_ptr<SpdyFrame> stream2_headers1( |
| 5555 spdy_util_.ConstructSpdyControlFrame(middle_headers.Pass(), | 5524 spdy_util_.ConstructSpdyControlFrame(middle_headers.Pass(), |
| 5556 false, | 5525 false, |
| 5557 2, | 5526 2, |
| 5558 LOWEST, | 5527 LOWEST, |
| 5559 HEADERS, | 5528 HEADERS, |
| 5560 CONTROL_FLAG_NONE, | 5529 CONTROL_FLAG_NONE, |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5737 DelayedSocketData data(1, reads, arraysize(reads), | 5706 DelayedSocketData data(1, reads, arraysize(reads), |
| 5738 writes, arraysize(writes)); | 5707 writes, arraysize(writes)); |
| 5739 NormalSpdyTransactionHelper helper(CreateGetRequest(), DEFAULT_PRIORITY, | 5708 NormalSpdyTransactionHelper helper(CreateGetRequest(), DEFAULT_PRIORITY, |
| 5740 BoundNetLog(), GetParam(), NULL); | 5709 BoundNetLog(), GetParam(), NULL); |
| 5741 helper.RunToCompletion(&data); | 5710 helper.RunToCompletion(&data); |
| 5742 TransactionHelperResult out = helper.output(); | 5711 TransactionHelperResult out = helper.output(); |
| 5743 EXPECT_EQ(ERR_SPDY_PROTOCOL_ERROR, out.rv); | 5712 EXPECT_EQ(ERR_SPDY_PROTOCOL_ERROR, out.rv); |
| 5744 } | 5713 } |
| 5745 | 5714 |
| 5746 TEST_P(SpdyNetworkTransactionTest, ServerPushCrossOriginCorrectness) { | 5715 TEST_P(SpdyNetworkTransactionTest, ServerPushCrossOriginCorrectness) { |
| 5747 if (spdy_util_.spdy_version() == SPDY4) { | |
| 5748 // TODO(jgraettinger): We don't support associated stream | |
| 5749 // checks in SPDY4 yet. | |
| 5750 return; | |
| 5751 } | |
| 5752 // In this test we want to verify that we can't accidentally push content | 5716 // In this test we want to verify that we can't accidentally push content |
| 5753 // which can't be pushed by this content server. | 5717 // which can't be pushed by this content server. |
| 5754 // This test assumes that: | 5718 // This test assumes that: |
| 5755 // - if we're requesting http://www.foo.com/barbaz | 5719 // - if we're requesting http://www.foo.com/barbaz |
| 5756 // - the browser has made a connection to "www.foo.com". | 5720 // - the browser has made a connection to "www.foo.com". |
| 5757 | 5721 |
| 5758 // A list of the URL to fetch, followed by the URL being pushed. | 5722 // A list of the URL to fetch, followed by the URL being pushed. |
| 5759 static const char* const kTestCases[] = { | 5723 static const char* const kTestCases[] = { |
| 5760 "http://www.google.com/foo.html", | 5724 "http://www.google.com/foo.html", |
| 5761 "http://www.google.com:81/foo.js", // Bad port | 5725 "http://www.google.com:81/foo.js", // Bad port |
| (...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6739 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { | 6703 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { |
| 6740 scoped_ptr<SSLSocketDataProvider> ssl_provider( | 6704 scoped_ptr<SSLSocketDataProvider> ssl_provider( |
| 6741 new SSLSocketDataProvider(ASYNC, OK)); | 6705 new SSLSocketDataProvider(ASYNC, OK)); |
| 6742 // Set to TLS_RSA_WITH_NULL_MD5 | 6706 // Set to TLS_RSA_WITH_NULL_MD5 |
| 6743 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); | 6707 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); |
| 6744 | 6708 |
| 6745 RunTLSUsageCheckTest(ssl_provider.Pass()); | 6709 RunTLSUsageCheckTest(ssl_provider.Pass()); |
| 6746 } | 6710 } |
| 6747 | 6711 |
| 6748 } // namespace net | 6712 } // namespace net |
| OLD | NEW |