| 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 "components/sync/engine_impl/attachments/attachment_downloader_impl.h" | 5 #include "components/sync/engine_impl/attachments/attachment_downloader_impl.h" | 
| 6 | 6 | 
| 7 #include <map> | 7 #include <map> | 
| 8 #include <utility> | 8 #include <utility> | 
| 9 | 9 | 
| 10 #include "base/bind.h" | 10 #include "base/bind.h" | 
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 137 | 137 | 
| 138 OAuth2TokenService* TokenServiceProvider::GetTokenService() { | 138 OAuth2TokenService* TokenServiceProvider::GetTokenService() { | 
| 139   DCHECK(task_runner_->BelongsToCurrentThread()); | 139   DCHECK(task_runner_->BelongsToCurrentThread()); | 
| 140   return token_service_; | 140   return token_service_; | 
| 141 } | 141 } | 
| 142 | 142 | 
| 143 }  // namespace | 143 }  // namespace | 
| 144 | 144 | 
| 145 class AttachmentDownloaderImplTest : public testing::Test { | 145 class AttachmentDownloaderImplTest : public testing::Test { | 
| 146  protected: | 146  protected: | 
| 147   typedef std::map<AttachmentId, AttachmentDownloader::DownloadResult> | 147   using ResultsMap = | 
| 148       ResultsMap; | 148       std::map<AttachmentId, AttachmentDownloader::DownloadResult>; | 
| 149 | 149 | 
| 150   enum HashHeaderType { | 150   enum HashHeaderType { | 
| 151     HASH_HEADER_NONE, | 151     HASH_HEADER_NONE, | 
| 152     HASH_HEADER_VALID, | 152     HASH_HEADER_VALID, | 
| 153     HASH_HEADER_INVALID | 153     HASH_HEADER_INVALID | 
| 154   }; | 154   }; | 
| 155 | 155 | 
| 156   AttachmentDownloaderImplTest() | 156   AttachmentDownloaderImplTest() | 
| 157       : num_completed_downloads_(0), | 157       : num_completed_downloads_(0), | 
| 158         attachment_id_(Attachment::Create(new base::RefCountedStaticMemory( | 158         attachment_id_(Attachment::Create(new base::RefCountedStaticMemory( | 
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 527   raw += "\n"; | 527   raw += "\n"; | 
| 528   std::replace(raw.begin(), raw.end(), '\n', '\0'); | 528   std::replace(raw.begin(), raw.end(), '\n', '\0'); | 
| 529   scoped_refptr<net::HttpResponseHeaders> headers( | 529   scoped_refptr<net::HttpResponseHeaders> headers( | 
| 530       new net::HttpResponseHeaders(raw)); | 530       new net::HttpResponseHeaders(raw)); | 
| 531   uint32_t extracted; | 531   uint32_t extracted; | 
| 532   ASSERT_FALSE( | 532   ASSERT_FALSE( | 
| 533       AttachmentDownloaderImpl::ExtractCrc32c(headers.get(), &extracted)); | 533       AttachmentDownloaderImpl::ExtractCrc32c(headers.get(), &extracted)); | 
| 534 } | 534 } | 
| 535 | 535 | 
| 536 }  // namespace syncer | 536 }  // namespace syncer | 
| OLD | NEW | 
|---|