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/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 base::Bind(&GDataWapiOperationsTest::HandleMetadataFeedRequest, | 181 base::Bind(&GDataWapiOperationsTest::HandleMetadataFeedRequest, |
182 base::Unretained(this))); | 182 base::Unretained(this))); |
183 test_server_.RegisterRequestHandler( | 183 test_server_.RegisterRequestHandler( |
184 base::Bind(&GDataWapiOperationsTest::HandleCreateSessionRequest, | 184 base::Bind(&GDataWapiOperationsTest::HandleCreateSessionRequest, |
185 base::Unretained(this))); | 185 base::Unretained(this))); |
186 test_server_.RegisterRequestHandler( | 186 test_server_.RegisterRequestHandler( |
187 base::Bind(&GDataWapiOperationsTest::HandleUploadRequest, | 187 base::Bind(&GDataWapiOperationsTest::HandleUploadRequest, |
188 base::Unretained(this))); | 188 base::Unretained(this))); |
189 | 189 |
190 url_generator_.reset(new GDataWapiUrlGenerator( | 190 url_generator_.reset(new GDataWapiUrlGenerator( |
191 GDataWapiUrlGenerator::GetBaseUrlForTesting(test_server_.port()))); | 191 test_util::GetBaseUrlForTesting(test_server_.port()))); |
192 } | 192 } |
193 | 193 |
194 virtual void TearDown() OVERRIDE { | 194 virtual void TearDown() OVERRIDE { |
195 test_server_.ShutdownAndWaitUntilComplete(); | 195 test_server_.ShutdownAndWaitUntilComplete(); |
196 request_context_getter_ = NULL; | 196 request_context_getter_ = NULL; |
197 } | 197 } |
198 | 198 |
199 protected: | 199 protected: |
200 // Returns a temporary file path suitable for storing the cache file. | 200 // Returns a temporary file path suitable for storing the cache file. |
201 FilePath GetTestCachedFilePath(const FilePath& file_name) { | 201 FilePath GetTestCachedFilePath(const FilePath& file_name) { |
(...skipping 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1432 EXPECT_EQ(base::Int64ToString(kUploadContent.size()), | 1432 EXPECT_EQ(base::Int64ToString(kUploadContent.size()), |
1433 http_request_.headers["X-Upload-Content-Length"]); | 1433 http_request_.headers["X-Upload-Content-Length"]); |
1434 // For updating an existing file, an empty body should be attached (PUT | 1434 // For updating an existing file, an empty body should be attached (PUT |
1435 // requires a body) | 1435 // requires a body) |
1436 EXPECT_TRUE(http_request_.has_content); | 1436 EXPECT_TRUE(http_request_.has_content); |
1437 EXPECT_EQ("", http_request_.content); | 1437 EXPECT_EQ("", http_request_.content); |
1438 EXPECT_EQ(kWrongETag, http_request_.headers["If-Match"]); | 1438 EXPECT_EQ(kWrongETag, http_request_.headers["If-Match"]); |
1439 } | 1439 } |
1440 | 1440 |
1441 } // namespace google_apis | 1441 } // namespace google_apis |
OLD | NEW |