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