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