Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: components/sync/core_impl/attachments/attachment_uploader_impl_unittest.cc

Issue 2388673002: Revert of [Sync] Move //components/sync to the syncer namespace. (patchset #5 id:40001 of https://co (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "components/sync/core/attachments/attachment_uploader_impl.h" 5 #include "components/sync/core/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
(...skipping 20 matching lines...) Expand all
31 #include "google_apis/gaia/gaia_constants.h" 31 #include "google_apis/gaia/gaia_constants.h"
32 #include "google_apis/gaia/oauth2_token_service_request.h" 32 #include "google_apis/gaia/oauth2_token_service_request.h"
33 #include "net/http/http_status_code.h" 33 #include "net/http/http_status_code.h"
34 #include "net/test/embedded_test_server/embedded_test_server.h" 34 #include "net/test/embedded_test_server/embedded_test_server.h"
35 #include "net/test/embedded_test_server/http_request.h" 35 #include "net/test/embedded_test_server/http_request.h"
36 #include "net/test/embedded_test_server/http_response.h" 36 #include "net/test/embedded_test_server/http_response.h"
37 #include "net/url_request/url_request_test_util.h" 37 #include "net/url_request/url_request_test_util.h"
38 #include "testing/gmock/include/gmock/gmock-matchers.h" 38 #include "testing/gmock/include/gmock/gmock-matchers.h"
39 #include "testing/gtest/include/gtest/gtest.h" 39 #include "testing/gtest/include/gtest/gtest.h"
40 40
41 namespace syncer {
42
43 namespace { 41 namespace {
44 42
45 const char kAttachmentData[] = "some data"; 43 const char kAttachmentData[] = "some data";
46 const char kAccountId[] = "some-account-id"; 44 const char kAccountId[] = "some-account-id";
47 const char kAccessToken[] = "some-access-token"; 45 const char kAccessToken[] = "some-access-token";
48 const char kContentTypeValue[] = "application/octet-stream"; 46 const char kContentTypeValue[] = "application/octet-stream";
49 const char kXGoogHash[] = "X-Goog-Hash"; 47 const char kXGoogHash[] = "X-Goog-Hash";
50 const char kAttachments[] = "/attachments/"; 48 const char kAttachments[] = "/attachments/";
51 const char kStoreBirthday[] = 49 const char kStoreBirthday[] =
52 "\x46\xFF\xDD\xE0\x74\x3A\x48\xFD\x9D\x06\x93\x3C\x61\x8E\xA5\x70\x09\x59" 50 "\x46\xFF\xDD\xE0\x74\x3A\x48\xFD\x9D\x06\x93\x3C\x61\x8E\xA5\x70\x09\x59"
53 "\x99\x05\x61\x46\x21\x61\x1B\x03\xD3\x02\x60\xCD\x41\x55\xFE\x26\x15\xD7" 51 "\x99\x05\x61\x46\x21\x61\x1B\x03\xD3\x02\x60\xCD\x41\x55\xFE\x26\x15\xD7"
54 "\x0C"; 52 "\x0C";
55 const char kBase64URLSafeStoreBirthday[] = 53 const char kBase64URLSafeStoreBirthday[] =
56 "Rv_d4HQ6SP2dBpM8YY6lcAlZmQVhRiFhGwPTAmDNQVX-JhXXDA"; 54 "Rv_d4HQ6SP2dBpM8YY6lcAlZmQVhRiFhGwPTAmDNQVX-JhXXDA";
57 const char kSyncStoreBirthdayHeader[] = "X-Sync-Store-Birthday"; 55 const char kSyncStoreBirthdayHeader[] = "X-Sync-Store-Birthday";
58 const char kSyncDataTypeIdHeader[] = "X-Sync-Data-Type-Id"; 56 const char kSyncDataTypeIdHeader[] = "X-Sync-Data-Type-Id";
59 const ModelType kModelType = ModelType::ARTICLES; 57 const syncer::ModelType kModelType = syncer::ModelType::ARTICLES;
60 58
61 } // namespace 59 } // namespace
62 60
61 namespace syncer {
62
63 using net::test_server::BasicHttpResponse; 63 using net::test_server::BasicHttpResponse;
64 using net::test_server::HttpRequest; 64 using net::test_server::HttpRequest;
65 using net::test_server::HttpResponse; 65 using net::test_server::HttpResponse;
66 66
67 class RequestHandler; 67 class RequestHandler;
68 68
69 // A mock implementation of an OAuth2TokenService. 69 // A mock implementation of an OAuth2TokenService.
70 // 70 //
71 // Use |SetResponse| to vary the response to token requests. 71 // Use |SetResponse| to vary the response to token requests.
72 // 72 //
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 scoped_refptr<base::RefCountedString> hello_world(new base::RefCountedString); 667 scoped_refptr<base::RefCountedString> hello_world(new base::RefCountedString);
668 hello_world->data() = "hello world"; 668 hello_world->data() = "hello world";
669 EXPECT_EQ("yZRlqg==", AttachmentUploaderImpl::FormatCrc32cHash( 669 EXPECT_EQ("yZRlqg==", AttachmentUploaderImpl::FormatCrc32cHash(
670 ComputeCrc32c(hello_world))); 670 ComputeCrc32c(hello_world)));
671 } 671 }
672 672
673 // TODO(maniscalco): Add test case for when we are uploading an attachment that 673 // TODO(maniscalco): Add test case for when we are uploading an attachment that
674 // already exists. 409 Conflict? (bug 379825) 674 // already exists. 409 Conflict? (bug 379825)
675 675
676 } // namespace syncer 676 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698