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/fake_attachment_downloader.h" | 5 #include "sync/internal_api/public/attachments/fake_attachment_downloader.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "sync/api/attachments/attachment.h" | 10 #include "sync/api/attachments/attachment.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 scoped_ptr<Attachment> attachment) { | 43 scoped_ptr<Attachment> attachment) { |
44 download_results_.push_back(result); | 44 download_results_.push_back(result); |
45 } | 45 } |
46 | 46 |
47 base::MessageLoop message_loop_; | 47 base::MessageLoop message_loop_; |
48 FakeAttachmentDownloader attachment_downloader_; | 48 FakeAttachmentDownloader attachment_downloader_; |
49 std::vector<AttachmentDownloader::DownloadResult> download_results_; | 49 std::vector<AttachmentDownloader::DownloadResult> download_results_; |
50 }; | 50 }; |
51 | 51 |
52 TEST_F(FakeAttachmentDownloaderTest, DownloadAttachment) { | 52 TEST_F(FakeAttachmentDownloaderTest, DownloadAttachment) { |
53 AttachmentId attachment_id = AttachmentId::Create(); | 53 AttachmentId attachment_id = AttachmentId::Create(0, 0); |
54 downloader()->DownloadAttachment(attachment_id, download_callback()); | 54 downloader()->DownloadAttachment(attachment_id, download_callback()); |
55 RunMessageLoop(); | 55 RunMessageLoop(); |
56 EXPECT_EQ(1U, download_results().size()); | 56 EXPECT_EQ(1U, download_results().size()); |
57 EXPECT_EQ(AttachmentDownloader::DOWNLOAD_SUCCESS, download_results()[0]); | 57 EXPECT_EQ(AttachmentDownloader::DOWNLOAD_SUCCESS, download_results()[0]); |
58 } | 58 } |
59 | 59 |
60 } // namespace syncer | 60 } // namespace syncer |
OLD | NEW |