Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1051)

Side by Side Diff: google_apis/drive/request_sender_unittest.cc

Issue 881403003: Rename gdata_errorcode.h to drive_api_error_codes.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typos in BUILD.gn Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698