| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "content/browser/loader/throttling_resource_handler.h" | 5 #include "content/browser/loader/throttling_resource_handler.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 EXPECT_EQ(0, test_handler_->on_will_start_called()); | 194 EXPECT_EQ(0, test_handler_->on_will_start_called()); |
| 195 EXPECT_EQ(0, throttle1_->will_start_request_called()); | 195 EXPECT_EQ(0, throttle1_->will_start_request_called()); |
| 196 EXPECT_EQ(0, throttle2_->will_start_request_called()); | 196 EXPECT_EQ(0, throttle2_->will_start_request_called()); |
| 197 } | 197 } |
| 198 | 198 |
| 199 // Finish the request with a 0-byte read and success. Reads are not passed | 199 // Finish the request with a 0-byte read and success. Reads are not passed |
| 200 // to ResourceThrottles, so are uninteresting for the purposes of these tests. | 200 // to ResourceThrottles, so are uninteresting for the purposes of these tests. |
| 201 void FinishRequestSuccessfully() { | 201 void FinishRequestSuccessfully() { |
| 202 EXPECT_EQ(0, test_handler_->on_will_read_called()); | 202 EXPECT_EQ(0, test_handler_->on_will_read_called()); |
| 203 | 203 |
| 204 ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(1)); | 204 ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); |
| 205 EXPECT_EQ(1, test_handler_->on_will_read_called()); | 205 EXPECT_EQ(1, test_handler_->on_will_read_called()); |
| 206 EXPECT_EQ(0, test_handler_->on_read_completed_called()); | 206 EXPECT_EQ(0, test_handler_->on_read_completed_called()); |
| 207 | 207 |
| 208 ASSERT_EQ(MockResourceLoader::Status::IDLE, | 208 ASSERT_EQ(MockResourceLoader::Status::IDLE, |
| 209 mock_loader_->OnReadCompleted(0)); | 209 mock_loader_->OnReadCompleted(0)); |
| 210 EXPECT_EQ(1, test_handler_->on_read_completed_called()); | 210 EXPECT_EQ(1, test_handler_->on_read_completed_called()); |
| 211 EXPECT_EQ(0, test_handler_->on_response_completed_called()); | 211 EXPECT_EQ(0, test_handler_->on_response_completed_called()); |
| 212 | 212 |
| 213 ASSERT_EQ(MockResourceLoader::Status::IDLE, | 213 ASSERT_EQ(MockResourceLoader::Status::IDLE, |
| 214 mock_loader_->OnResponseCompleted( | 214 mock_loader_->OnResponseCompleted( |
| (...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 890 EXPECT_EQ(0, throttle2_->will_process_response_called()); | 890 EXPECT_EQ(0, throttle2_->will_process_response_called()); |
| 891 | 891 |
| 892 EXPECT_EQ(0, test_handler_->on_will_start_called()); | 892 EXPECT_EQ(0, test_handler_->on_will_start_called()); |
| 893 EXPECT_EQ(0, test_handler_->on_request_redirected_called()); | 893 EXPECT_EQ(0, test_handler_->on_request_redirected_called()); |
| 894 EXPECT_EQ(0, test_handler_->on_response_started_called()); | 894 EXPECT_EQ(0, test_handler_->on_response_started_called()); |
| 895 EXPECT_EQ(1, test_handler_->on_response_completed_called()); | 895 EXPECT_EQ(1, test_handler_->on_response_completed_called()); |
| 896 } | 896 } |
| 897 | 897 |
| 898 } // namespace | 898 } // namespace |
| 899 } // namespace content | 899 } // namespace content |
| OLD | NEW |