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 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 NormalSpdyTransactionHelper helper(CreateGetRequest(), | 562 NormalSpdyTransactionHelper helper(CreateGetRequest(), |
563 BoundNetLog(), GetParam()); | 563 BoundNetLog(), GetParam()); |
564 helper.RunToCompletion(data.get()); | 564 helper.RunToCompletion(data.get()); |
565 TransactionHelperResult out = helper.output(); | 565 TransactionHelperResult out = helper.output(); |
566 EXPECT_EQ(OK, out.rv); | 566 EXPECT_EQ(OK, out.rv); |
567 EXPECT_EQ("HTTP/1.1 200 OK", out.status_line); | 567 EXPECT_EQ("HTTP/1.1 200 OK", out.status_line); |
568 EXPECT_EQ("hello!", out.response_data); | 568 EXPECT_EQ("hello!", out.response_data); |
569 } | 569 } |
570 | 570 |
571 TEST_P(SpdyNetworkTransactionSpdy3Test, GetAtEachPriority) { | 571 TEST_P(SpdyNetworkTransactionSpdy3Test, GetAtEachPriority) { |
572 for (RequestPriority p = HIGHEST; p < NUM_PRIORITIES; | 572 for (RequestPriority p = MINIMUM_PRIORITY; p < NUM_PRIORITIES; |
573 p = RequestPriority(p+1)) { | 573 p = RequestPriority(p + 1)) { |
574 // Construct the request. | 574 // Construct the request. |
575 scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, p)); | 575 scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, p)); |
576 MockWrite writes[] = { CreateMockWrite(*req) }; | 576 MockWrite writes[] = { CreateMockWrite(*req) }; |
577 | 577 |
578 const int spdy_prio = reinterpret_cast<SpdySynStreamControlFrame*>( | 578 const int spdy_prio = reinterpret_cast<SpdySynStreamControlFrame*>( |
579 req.get())->priority(); | 579 req.get())->priority(); |
580 // this repeats the RequestPriority-->SpdyPriority mapping from | 580 // this repeats the RequestPriority-->SpdyPriority mapping from |
581 // SpdyFramer::ConvertRequestPriorityToSpdyPriority to make | 581 // SpdyFramer::ConvertRequestPriorityToSpdyPriority to make |
582 // sure it's being done right. | 582 // sure it's being done right. |
583 switch(p) { | 583 switch(p) { |
(...skipping 5548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6132 << " Write index: " | 6132 << " Write index: " |
6133 << data->write_index(); | 6133 << data->write_index(); |
6134 | 6134 |
6135 // Verify the SYN_REPLY. | 6135 // Verify the SYN_REPLY. |
6136 HttpResponseInfo response = *trans->GetResponseInfo(); | 6136 HttpResponseInfo response = *trans->GetResponseInfo(); |
6137 EXPECT_TRUE(response.headers != NULL); | 6137 EXPECT_TRUE(response.headers != NULL); |
6138 EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); | 6138 EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); |
6139 } | 6139 } |
6140 | 6140 |
6141 } // namespace net | 6141 } // namespace net |
OLD | NEW |