| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <map> | 6 #include <map> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 virtual void SetUp() OVERRIDE { | 51 virtual void SetUp() OVERRIDE { |
| 52 file_thread_.Start(); | 52 file_thread_.Start(); |
| 53 io_thread_.StartIOThread(); | 53 io_thread_.StartIOThread(); |
| 54 profile_.reset(new TestingProfile); | 54 profile_.reset(new TestingProfile); |
| 55 | 55 |
| 56 request_context_getter_ = new net::TestURLRequestContextGetter( | 56 request_context_getter_ = new net::TestURLRequestContextGetter( |
| 57 content::BrowserThread::GetMessageLoopProxyForThread( | 57 content::BrowserThread::GetMessageLoopProxyForThread( |
| 58 content::BrowserThread::IO)); | 58 content::BrowserThread::IO)); |
| 59 | 59 |
| 60 operation_runner_.reset(new OperationRunner(profile_.get(), | 60 operation_runner_.reset(new OperationRunner(profile_.get(), |
| 61 request_context_getter_, | 61 request_context_getter_.get(), |
| 62 std::vector<std::string>(), | 62 std::vector<std::string>(), |
| 63 kTestUserAgent)); | 63 kTestUserAgent)); |
| 64 operation_runner_->auth_service()->set_access_token_for_testing( | 64 operation_runner_->auth_service()->set_access_token_for_testing( |
| 65 kTestGDataAuthToken); | 65 kTestGDataAuthToken); |
| 66 | 66 |
| 67 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 67 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 68 | 68 |
| 69 ASSERT_TRUE(test_server_.InitializeAndWaitUntilReady()); | 69 ASSERT_TRUE(test_server_.InitializeAndWaitUntilReady()); |
| 70 test_server_.RegisterRequestHandler( | 70 test_server_.RegisterRequestHandler( |
| 71 base::Bind(&test_util::HandleDownloadRequest, | 71 base::Bind(&test_util::HandleDownloadRequest, |
| (...skipping 1436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1508 EXPECT_EQ(base::Int64ToString(kUploadContent.size()), | 1508 EXPECT_EQ(base::Int64ToString(kUploadContent.size()), |
| 1509 http_request_.headers["X-Upload-Content-Length"]); | 1509 http_request_.headers["X-Upload-Content-Length"]); |
| 1510 // For updating an existing file, an empty body should be attached (PUT | 1510 // For updating an existing file, an empty body should be attached (PUT |
| 1511 // requires a body) | 1511 // requires a body) |
| 1512 EXPECT_TRUE(http_request_.has_content); | 1512 EXPECT_TRUE(http_request_.has_content); |
| 1513 EXPECT_EQ("", http_request_.content); | 1513 EXPECT_EQ("", http_request_.content); |
| 1514 EXPECT_EQ(kWrongETag, http_request_.headers["If-Match"]); | 1514 EXPECT_EQ(kWrongETag, http_request_.headers["If-Match"]); |
| 1515 } | 1515 } |
| 1516 | 1516 |
| 1517 } // namespace google_apis | 1517 } // namespace google_apis |
| OLD | NEW |