| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/memory/ptr_util.h" | 5 #include "base/memory/ptr_util.h" |
| 6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "base/test/test_simple_task_runner.h" | 7 #include "base/test/test_simple_task_runner.h" |
| 8 #include "components/drive/service/drive_api_service.h" | 8 #include "components/drive/service/drive_api_service.h" |
| 9 #include "google_apis/drive/dummy_auth_service.h" | 9 #include "google_apis/drive/dummy_auth_service.h" |
| 10 #include "google_apis/drive/request_sender.h" | 10 #include "google_apis/drive/request_sender.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 ASSERT_FALSE(callback_.is_null()); | 30 ASSERT_FALSE(callback_.is_null()); |
| 31 callback_.Run(google_apis::HTTP_UNAUTHORIZED, ""); | 31 callback_.Run(google_apis::HTTP_UNAUTHORIZED, ""); |
| 32 } | 32 } |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 google_apis::AuthStatusCallback callback_; | 35 google_apis::AuthStatusCallback callback_; |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 TEST(DriveAPIServiceTest, BatchRequestConfiguratorWithAuthFailure) { | 38 TEST(DriveAPIServiceTest, BatchRequestConfiguratorWithAuthFailure) { |
| 39 const GURL test_base_url("http://localhost/"); | 39 const GURL test_base_url("http://localhost/"); |
| 40 google_apis::DriveApiUrlGenerator url_generator(test_base_url, test_base_url); | 40 google_apis::DriveApiUrlGenerator url_generator(test_base_url, test_base_url, |
| 41 google_apis::TEAM_DRIVES_INTEGRATION_DISABLED); |
| 41 scoped_refptr<base::TestSimpleTaskRunner> task_runner = | 42 scoped_refptr<base::TestSimpleTaskRunner> task_runner = |
| 42 new base::TestSimpleTaskRunner(); | 43 new base::TestSimpleTaskRunner(); |
| 43 scoped_refptr<net::TestURLRequestContextGetter> request_context_getter = | 44 scoped_refptr<net::TestURLRequestContextGetter> request_context_getter = |
| 44 new net::TestURLRequestContextGetter(task_runner.get()); | 45 new net::TestURLRequestContextGetter(task_runner.get()); |
| 45 google_apis::RequestSender sender(new TestAuthService, | 46 google_apis::RequestSender sender(new TestAuthService, |
| 46 request_context_getter.get(), | 47 request_context_getter.get(), |
| 47 task_runner.get(), kTestUserAgent); | 48 task_runner.get(), kTestUserAgent); |
| 48 std::unique_ptr<google_apis::drive::BatchUploadRequest> request = | 49 std::unique_ptr<google_apis::drive::BatchUploadRequest> request = |
| 49 base::MakeUnique<google_apis::drive::BatchUploadRequest>(&sender, | 50 base::MakeUnique<google_apis::drive::BatchUploadRequest>(&sender, |
| 50 url_generator); | 51 url_generator); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 73 "text/plain", 10, "resource_id", | 74 "text/plain", 10, "resource_id", |
| 74 base::FilePath(FILE_PATH_LITERAL("/file")), UploadExistingFileOptions(), | 75 base::FilePath(FILE_PATH_LITERAL("/file")), UploadExistingFileOptions(), |
| 75 google_apis::test_util::CreateCopyResultCallback(&error, | 76 google_apis::test_util::CreateCopyResultCallback(&error, |
| 76 &file_resource), | 77 &file_resource), |
| 77 google_apis::ProgressCallback()); | 78 google_apis::ProgressCallback()); |
| 78 EXPECT_EQ(google_apis::DRIVE_OTHER_ERROR, error); | 79 EXPECT_EQ(google_apis::DRIVE_OTHER_ERROR, error); |
| 79 } | 80 } |
| 80 } | 81 } |
| 81 | 82 |
| 82 } // namespace drive | 83 } // namespace drive |
| OLD | NEW |