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/url_request/url_request_job.h" | 5 #include "net/url_request/url_request_job.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "net/base/request_priority.h" | 10 #include "net/base/request_priority.h" |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 | 509 |
510 req->set_method("GET"); | 510 req->set_method("GET"); |
511 req->Start(); | 511 req->Start(); |
512 | 512 |
513 base::RunLoop().Run(); | 513 base::RunLoop().Run(); |
514 | 514 |
515 // Request failed indicates the request failed before headers were received, | 515 // Request failed indicates the request failed before headers were received, |
516 // so should be false. | 516 // so should be false. |
517 EXPECT_FALSE(d.request_failed()); | 517 EXPECT_FALSE(d.request_failed()); |
518 EXPECT_EQ(200, req->GetResponseCode()); | 518 EXPECT_EQ(200, req->GetResponseCode()); |
519 EXPECT_EQ(ERR_CONTENT_DECODING_FAILED, d.request_status()); | 519 EXPECT_FALSE(req->status().is_success()); |
| 520 EXPECT_THAT(req->status().error(), IsError(ERR_CONTENT_DECODING_FAILED)); |
520 EXPECT_TRUE(d.data_received().empty()); | 521 EXPECT_TRUE(d.data_received().empty()); |
521 EXPECT_FALSE(network_layer.done_reading_called()); | 522 EXPECT_FALSE(network_layer.done_reading_called()); |
522 | 523 |
523 RemoveMockTransaction(&kInvalidContentGZip_Transaction); | 524 RemoveMockTransaction(&kInvalidContentGZip_Transaction); |
524 } | 525 } |
525 | 526 |
526 // Regression test for crbug.com/553300. | 527 // Regression test for crbug.com/553300. |
527 TEST(URLRequestJob, SlowFilterRead) { | 528 TEST(URLRequestJob, SlowFilterRead) { |
528 MockNetworkLayer network_layer; | 529 MockNetworkLayer network_layer; |
529 TestURLRequestContext context; | 530 TestURLRequestContext context; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 | 565 |
565 EXPECT_FALSE(d.request_failed()); | 566 EXPECT_FALSE(d.request_failed()); |
566 EXPECT_EQ(200, req->GetResponseCode()); | 567 EXPECT_EQ(200, req->GetResponseCode()); |
567 EXPECT_EQ(kBrotliDecodedHelloData, d.data_received()); | 568 EXPECT_EQ(kBrotliDecodedHelloData, d.data_received()); |
568 EXPECT_TRUE(network_layer.done_reading_called()); | 569 EXPECT_TRUE(network_layer.done_reading_called()); |
569 | 570 |
570 RemoveMockTransaction(&kBrotli_Slow_Transaction); | 571 RemoveMockTransaction(&kBrotli_Slow_Transaction); |
571 } | 572 } |
572 | 573 |
573 } // namespace net | 574 } // namespace net |
OLD | NEW |