| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "google_apis/drive/request_sender.h" | 5 #include "google_apis/drive/request_sender.h" |
| 6 | 6 |
| 7 #include "base/sequenced_task_runner.h" | 7 #include "base/sequenced_task_runner.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "google_apis/drive/base_requests.h" | 9 #include "google_apis/drive/base_requests.h" |
| 10 #include "google_apis/drive/dummy_auth_service.h" | 10 #include "google_apis/drive/dummy_auth_service.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // This request class itself does not return any response at this point. | 104 // This request class itself does not return any response at this point. |
| 105 // Each test case should respond properly by using the above methods. | 105 // Each test case should respond properly by using the above methods. |
| 106 } | 106 } |
| 107 | 107 |
| 108 void Cancel() override { | 108 void Cancel() override { |
| 109 EXPECT_TRUE(*start_called_); | 109 EXPECT_TRUE(*start_called_); |
| 110 *finish_reason_ = CANCEL; | 110 *finish_reason_ = CANCEL; |
| 111 sender_->RequestFinished(this); | 111 sender_->RequestFinished(this); |
| 112 } | 112 } |
| 113 | 113 |
| 114 void OnAuthFailed(GDataErrorCode code) override { | 114 void OnAuthFailed(DriveApiErrorCode code) override { |
| 115 *finish_reason_ = AUTH_FAILURE; | 115 *finish_reason_ = AUTH_FAILURE; |
| 116 sender_->RequestFinished(this); | 116 sender_->RequestFinished(this); |
| 117 } | 117 } |
| 118 | 118 |
| 119 base::WeakPtr<AuthenticatedRequestInterface> GetWeakPtr() override { | 119 base::WeakPtr<AuthenticatedRequestInterface> GetWeakPtr() override { |
| 120 return weak_ptr_factory_.GetWeakPtr(); | 120 return weak_ptr_factory_.GetWeakPtr(); |
| 121 } | 121 } |
| 122 | 122 |
| 123 private: | 123 private: |
| 124 RequestSender* sender_; | 124 RequestSender* sender_; |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 // by the RequestSender. So with this TestRequest, RequestSender retries | 241 // by the RequestSender. So with this TestRequest, RequestSender retries |
| 242 // infinitely. Let it succeed/ | 242 // infinitely. Let it succeed/ |
| 243 EXPECT_EQ(kTestAccessToken + std::string("3"), | 243 EXPECT_EQ(kTestAccessToken + std::string("3"), |
| 244 request->passed_access_token()); | 244 request->passed_access_token()); |
| 245 request->FinishRequestWithSuccess(); | 245 request->FinishRequestWithSuccess(); |
| 246 EXPECT_EQ(SUCCESS, finish_reason); | 246 EXPECT_EQ(SUCCESS, finish_reason); |
| 247 EXPECT_FALSE(weak_ptr); | 247 EXPECT_FALSE(weak_ptr); |
| 248 } | 248 } |
| 249 | 249 |
| 250 } // namespace google_apis | 250 } // namespace google_apis |
| OLD | NEW |