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_FALSE(req->status().is_success()); | 519 EXPECT_EQ(ERR_CONTENT_DECODING_FAILED, d.request_status()); |
520 EXPECT_THAT(req->status().error(), IsError(ERR_CONTENT_DECODING_FAILED)); | |
521 EXPECT_TRUE(d.data_received().empty()); | 520 EXPECT_TRUE(d.data_received().empty()); |
522 EXPECT_FALSE(network_layer.done_reading_called()); | 521 EXPECT_FALSE(network_layer.done_reading_called()); |
523 | 522 |
524 RemoveMockTransaction(&kInvalidContentGZip_Transaction); | 523 RemoveMockTransaction(&kInvalidContentGZip_Transaction); |
525 } | 524 } |
526 | 525 |
527 // Regression test for crbug.com/553300. | 526 // Regression test for crbug.com/553300. |
528 TEST(URLRequestJob, SlowFilterRead) { | 527 TEST(URLRequestJob, SlowFilterRead) { |
529 MockNetworkLayer network_layer; | 528 MockNetworkLayer network_layer; |
530 TestURLRequestContext context; | 529 TestURLRequestContext context; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 | 564 |
566 EXPECT_FALSE(d.request_failed()); | 565 EXPECT_FALSE(d.request_failed()); |
567 EXPECT_EQ(200, req->GetResponseCode()); | 566 EXPECT_EQ(200, req->GetResponseCode()); |
568 EXPECT_EQ(kBrotliDecodedHelloData, d.data_received()); | 567 EXPECT_EQ(kBrotliDecodedHelloData, d.data_received()); |
569 EXPECT_TRUE(network_layer.done_reading_called()); | 568 EXPECT_TRUE(network_layer.done_reading_called()); |
570 | 569 |
571 RemoveMockTransaction(&kBrotli_Slow_Transaction); | 570 RemoveMockTransaction(&kBrotli_Slow_Transaction); |
572 } | 571 } |
573 | 572 |
574 } // namespace net | 573 } // namespace net |
OLD | NEW |