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_downloader_impl.h" | 5 #include "sync/internal_api/public/attachments/attachment_downloader_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 ResultsMap; | 147 ResultsMap; |
148 | 148 |
149 enum HashHeaderType { | 149 enum HashHeaderType { |
150 HASH_HEADER_NONE, | 150 HASH_HEADER_NONE, |
151 HASH_HEADER_VALID, | 151 HASH_HEADER_VALID, |
152 HASH_HEADER_INVALID | 152 HASH_HEADER_INVALID |
153 }; | 153 }; |
154 | 154 |
155 AttachmentDownloaderImplTest() : num_completed_downloads_(0) {} | 155 AttachmentDownloaderImplTest() : num_completed_downloads_(0) {} |
156 | 156 |
157 virtual void SetUp() override; | 157 void SetUp() override; |
158 virtual void TearDown() override; | 158 void TearDown() override; |
159 | 159 |
160 AttachmentDownloader* downloader() { return attachment_downloader_.get(); } | 160 AttachmentDownloader* downloader() { return attachment_downloader_.get(); } |
161 | 161 |
162 MockOAuth2TokenService* token_service() { return token_service_.get(); } | 162 MockOAuth2TokenService* token_service() { return token_service_.get(); } |
163 | 163 |
164 int num_completed_downloads() { return num_completed_downloads_; } | 164 int num_completed_downloads() { return num_completed_downloads_; } |
165 | 165 |
166 AttachmentDownloader::DownloadCallback download_callback( | 166 AttachmentDownloader::DownloadCallback download_callback( |
167 const AttachmentId& id) { | 167 const AttachmentId& id) { |
168 return base::Bind(&AttachmentDownloaderImplTest::DownloadDone, | 168 return base::Bind(&AttachmentDownloaderImplTest::DownloadDone, |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 raw += "\n"; | 505 raw += "\n"; |
506 std::replace(raw.begin(), raw.end(), '\n', '\0'); | 506 std::replace(raw.begin(), raw.end(), '\n', '\0'); |
507 scoped_refptr<net::HttpResponseHeaders> headers( | 507 scoped_refptr<net::HttpResponseHeaders> headers( |
508 new net::HttpResponseHeaders(raw)); | 508 new net::HttpResponseHeaders(raw)); |
509 uint32_t extracted; | 509 uint32_t extracted; |
510 ASSERT_FALSE( | 510 ASSERT_FALSE( |
511 AttachmentDownloaderImpl::ExtractCrc32c(headers.get(), &extracted)); | 511 AttachmentDownloaderImpl::ExtractCrc32c(headers.get(), &extracted)); |
512 } | 512 } |
513 | 513 |
514 } // namespace syncer | 514 } // namespace syncer |
OLD | NEW |