| 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/mojo_async_resource_handler.h" | 5 #include "content/browser/loader/mojo_async_resource_handler.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 TestResourceController() {} | 177 TestResourceController() {} |
| 178 ~TestResourceController() override {} | 178 ~TestResourceController() override {} |
| 179 | 179 |
| 180 void Cancel() override { ADD_FAILURE() << "Cancel should not be called."; } | 180 void Cancel() override { ADD_FAILURE() << "Cancel should not be called."; } |
| 181 | 181 |
| 182 void CancelAndIgnore() override { | 182 void CancelAndIgnore() override { |
| 183 ADD_FAILURE() << "CancelAndIgnore should not be called."; | 183 ADD_FAILURE() << "CancelAndIgnore should not be called."; |
| 184 } | 184 } |
| 185 | 185 |
| 186 void CancelWithError(int error_code) override { | 186 void CancelWithError(int error_code) override { |
| 187 // While cancelling more than once is legal, none of these tests should do |
| 188 // it. |
| 189 EXPECT_FALSE(is_cancel_with_error_called_); |
| 190 |
| 187 is_cancel_with_error_called_ = true; | 191 is_cancel_with_error_called_ = true; |
| 188 error_ = error_code; | 192 error_ = error_code; |
| 189 if (quit_closure_) | 193 if (quit_closure_) |
| 190 quit_closure_.Run(); | 194 quit_closure_.Run(); |
| 191 } | 195 } |
| 192 | 196 |
| 193 void Resume() override { ++num_resume_calls_; } | 197 void Resume() override { ++num_resume_calls_; } |
| 194 | 198 |
| 195 void RunUntilCancelWithErrorCalled() { | 199 void RunUntilCancelWithErrorCalled() { |
| 196 base::RunLoop run_loop; | 200 base::RunLoop run_loop; |
| (...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1132 } | 1136 } |
| 1133 } | 1137 } |
| 1134 EXPECT_EQ("B", body); | 1138 EXPECT_EQ("B", body); |
| 1135 } | 1139 } |
| 1136 | 1140 |
| 1137 INSTANTIATE_TEST_CASE_P(MojoAsyncResourceHandlerWithAllocationSizeTest, | 1141 INSTANTIATE_TEST_CASE_P(MojoAsyncResourceHandlerWithAllocationSizeTest, |
| 1138 MojoAsyncResourceHandlerWithAllocationSizeTest, | 1142 MojoAsyncResourceHandlerWithAllocationSizeTest, |
| 1139 ::testing::Values(8, 32 * 2014)); | 1143 ::testing::Values(8, 32 * 2014)); |
| 1140 } // namespace | 1144 } // namespace |
| 1141 } // namespace content | 1145 } // namespace content |
| OLD | NEW |