OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "sync/internal_api/public/attachments/attachment_uploader_impl.h" | 5 #include "sync/internal_api/public/attachments/attachment_uploader_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/ref_counted_memory.h" | 14 #include "base/memory/ref_counted_memory.h" |
15 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
16 #include "base/run_loop.h" | 16 #include "base/run_loop.h" |
17 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
18 #include "base/strings/stringprintf.h" | 18 #include "base/strings/stringprintf.h" |
19 #include "base/synchronization/lock.h" | 19 #include "base/synchronization/lock.h" |
20 #include "base/test/histogram_tester.h" | 20 #include "base/test/histogram_tester.h" |
21 #include "base/thread_task_runner_handle.h" | |
22 #include "base/threading/non_thread_safe.h" | 21 #include "base/threading/non_thread_safe.h" |
23 #include "base/threading/thread.h" | 22 #include "base/threading/thread.h" |
| 23 #include "base/threading/thread_task_runner_handle.h" |
24 #include "google_apis/gaia/fake_oauth2_token_service.h" | 24 #include "google_apis/gaia/fake_oauth2_token_service.h" |
25 #include "google_apis/gaia/gaia_constants.h" | 25 #include "google_apis/gaia/gaia_constants.h" |
26 #include "google_apis/gaia/oauth2_token_service_request.h" | 26 #include "google_apis/gaia/oauth2_token_service_request.h" |
27 #include "net/http/http_status_code.h" | 27 #include "net/http/http_status_code.h" |
28 #include "net/test/embedded_test_server/embedded_test_server.h" | 28 #include "net/test/embedded_test_server/embedded_test_server.h" |
29 #include "net/test/embedded_test_server/http_request.h" | 29 #include "net/test/embedded_test_server/http_request.h" |
30 #include "net/test/embedded_test_server/http_response.h" | 30 #include "net/test/embedded_test_server/http_response.h" |
31 #include "net/url_request/url_request_test_util.h" | 31 #include "net/url_request/url_request_test_util.h" |
32 #include "sync/api/attachments/attachment.h" | 32 #include "sync/api/attachments/attachment.h" |
33 #include "sync/internal_api/public/attachments/attachment_util.h" | 33 #include "sync/internal_api/public/attachments/attachment_util.h" |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 scoped_refptr<base::RefCountedString> hello_world(new base::RefCountedString); | 674 scoped_refptr<base::RefCountedString> hello_world(new base::RefCountedString); |
675 hello_world->data() = "hello world"; | 675 hello_world->data() = "hello world"; |
676 EXPECT_EQ("yZRlqg==", AttachmentUploaderImpl::FormatCrc32cHash( | 676 EXPECT_EQ("yZRlqg==", AttachmentUploaderImpl::FormatCrc32cHash( |
677 ComputeCrc32c(hello_world))); | 677 ComputeCrc32c(hello_world))); |
678 } | 678 } |
679 | 679 |
680 // TODO(maniscalco): Add test case for when we are uploading an attachment that | 680 // TODO(maniscalco): Add test case for when we are uploading an attachment that |
681 // already exists. 409 Conflict? (bug 379825) | 681 // already exists. 409 Conflict? (bug 379825) |
682 | 682 |
683 } // namespace syncer | 683 } // namespace syncer |
OLD | NEW |