| Index: content/browser/loader/mock_resource_loader.cc
|
| diff --git a/content/browser/loader/mock_resource_loader.cc b/content/browser/loader/mock_resource_loader.cc
|
| index 8be87a46ad775887c3ec03b40809f182561ba49c..d211f38e4be646eaacd1c5ff04a382b24b50600c 100644
|
| --- a/content/browser/loader/mock_resource_loader.cc
|
| +++ b/content/browser/loader/mock_resource_loader.cc
|
| @@ -35,6 +35,9 @@ MockResourceLoader::Status MockResourceLoader::OnWillStart(const GURL& url) {
|
| EXPECT_TRUE(status_ == Status::CALLING_HANDLER ||
|
| (result == false && status_ == Status::CANCELED));
|
| if (!result) {
|
| + // In the case of double-cancels, keep the old error code.
|
| + if (status_ != Status::CANCELED)
|
| + error_code_ = net::ERR_ABORTED;
|
| status_ = Status::CANCELED;
|
| } else if (defer) {
|
| status_ = Status::CALLBACK_PENDING;
|
| @@ -58,6 +61,9 @@ MockResourceLoader::Status MockResourceLoader::OnRequestRedirected(
|
| EXPECT_TRUE(status_ == Status::CALLING_HANDLER ||
|
| (result == false && status_ == Status::CANCELED));
|
| if (!result) {
|
| + // In the case of double-cancels, keep the old error code.
|
| + if (status_ != Status::CANCELED)
|
| + error_code_ = net::ERR_ABORTED;
|
| status_ = Status::CANCELED;
|
| } else if (defer) {
|
| status_ = Status::CALLBACK_PENDING;
|
| @@ -79,6 +85,9 @@ MockResourceLoader::Status MockResourceLoader::OnResponseStarted(
|
| EXPECT_TRUE(status_ == Status::CALLING_HANDLER ||
|
| (result == false && status_ == Status::CANCELED));
|
| if (!result) {
|
| + // In the case of double-cancels, keep the old error code.
|
| + if (status_ != Status::CANCELED)
|
| + error_code_ = net::ERR_ABORTED;
|
| status_ = Status::CANCELED;
|
| } else if (defer) {
|
| status_ = Status::CALLBACK_PENDING;
|
| @@ -105,6 +114,7 @@ MockResourceLoader::Status MockResourceLoader::OnWillRead(int min_size) {
|
| EXPECT_EQ(0, io_buffer_size_);
|
| EXPECT_FALSE(io_buffer_);
|
| status_ = Status::CANCELED;
|
| + error_code_ = net::ERR_ABORTED;
|
| } else {
|
| EXPECT_LE(min_size, io_buffer_size_);
|
| EXPECT_LT(0, io_buffer_size_);
|
| @@ -132,6 +142,9 @@ MockResourceLoader::Status MockResourceLoader::OnReadCompleted(
|
| EXPECT_TRUE(status_ == Status::CALLING_HANDLER ||
|
| (result == false && status_ == Status::CANCELED));
|
| if (!result) {
|
| + // In the case of double-cancels, keep the old error code.
|
| + if (status_ != Status::CANCELED)
|
| + error_code_ = net::ERR_ABORTED;
|
| status_ = Status::CANCELED;
|
| } else if (defer) {
|
| status_ = Status::CALLBACK_PENDING;
|
|
|