| 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_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "base/json/json_reader.h" | 11 #include "base/json/json_reader.h" |
| 12 #include "base/json/json_writer.h" | 12 #include "base/json/json_writer.h" |
| 13 #include "base/message_loop_proxy.h" | 13 #include "base/message_loop_proxy.h" |
| 14 #include "base/stringprintf.h" | 14 #include "base/stringprintf.h" |
| 15 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
| 16 #include "base/values.h" | 16 #include "base/values.h" |
| 17 #include "chrome/browser/google_apis/gdata_wapi_operations.h" | 17 #include "chrome/browser/google_apis/gdata_wapi_operations.h" |
| 18 #include "chrome/browser/google_apis/gdata_wapi_parser.h" | 18 #include "chrome/browser/google_apis/gdata_wapi_parser.h" |
| 19 #include "chrome/browser/google_apis/gdata_wapi_url_generator.h" | 19 #include "chrome/browser/google_apis/gdata_wapi_url_generator.h" |
| 20 #include "chrome/browser/google_apis/operation_registry.h" | 20 #include "chrome/browser/google_apis/operation_registry.h" |
| 21 #include "chrome/browser/google_apis/task_util.h" | 21 #include "chrome/browser/google_apis/task_util.h" |
| 22 #include "chrome/browser/google_apis/test_server/http_request.h" | |
| 23 #include "chrome/browser/google_apis/test_server/http_response.h" | |
| 24 #include "chrome/browser/google_apis/test_server/http_server.h" | |
| 25 #include "chrome/browser/google_apis/test_util.h" | 22 #include "chrome/browser/google_apis/test_util.h" |
| 26 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
| 27 #include "chrome/test/base/testing_profile.h" | 24 #include "chrome/test/base/testing_profile.h" |
| 28 #include "content/public/test/test_browser_thread.h" | 25 #include "content/public/test/test_browser_thread.h" |
| 29 #include "net/base/escape.h" | 26 #include "net/base/escape.h" |
| 27 #include "net/test/embedded_test_server/http_request.h" |
| 28 #include "net/test/embedded_test_server/http_response.h" |
| 29 #include "net/test/embedded_test_server/http_server.h" |
| 30 #include "net/url_request/url_request_test_util.h" | 30 #include "net/url_request/url_request_test_util.h" |
| 31 #include "testing/gtest/include/gtest/gtest.h" | 31 #include "testing/gtest/include/gtest/gtest.h" |
| 32 | 32 |
| 33 namespace google_apis { | 33 namespace google_apis { |
| 34 | 34 |
| 35 namespace { | 35 namespace { |
| 36 | 36 |
| 37 const char kTestGDataAuthToken[] = "testtoken"; | 37 const char kTestGDataAuthToken[] = "testtoken"; |
| 38 const char kTestUserAgent[] = "test-user-agent"; | 38 const char kTestUserAgent[] = "test-user-agent"; |
| 39 const char kTestETag[] = "test_etag"; | 39 const char kTestETag[] = "test_etag"; |
| (...skipping 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1480 EXPECT_EQ(base::Int64ToString(kUploadContent.size()), | 1480 EXPECT_EQ(base::Int64ToString(kUploadContent.size()), |
| 1481 http_request_.headers["X-Upload-Content-Length"]); | 1481 http_request_.headers["X-Upload-Content-Length"]); |
| 1482 // For updating an existing file, an empty body should be attached (PUT | 1482 // For updating an existing file, an empty body should be attached (PUT |
| 1483 // requires a body) | 1483 // requires a body) |
| 1484 EXPECT_TRUE(http_request_.has_content); | 1484 EXPECT_TRUE(http_request_.has_content); |
| 1485 EXPECT_EQ("", http_request_.content); | 1485 EXPECT_EQ("", http_request_.content); |
| 1486 EXPECT_EQ(kWrongETag, http_request_.headers["If-Match"]); | 1486 EXPECT_EQ(kWrongETag, http_request_.headers["If-Match"]); |
| 1487 } | 1487 } |
| 1488 | 1488 |
| 1489 } // namespace google_apis | 1489 } // namespace google_apis |
| OLD | NEW |