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

Side by Side Diff: ios/chrome/browser/reading_list/url_downloader_unittest.mm

Issue 2604773002: Create distiller files for Reading List. (Closed)
Patch Set: feedback Created 3 years, 11 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ios/chrome/browser/reading_list/url_downloader.h" 5 #include "ios/chrome/browser/reading_list/url_downloader.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #import "base/mac/bind_objc_block.h" 10 #import "base/mac/bind_objc_block.h"
(...skipping 22 matching lines...) Expand all
33 const dom_distiller::DistilledArticleProto* article_proto) override {} 33 const dom_distiller::DistilledArticleProto* article_proto) override {}
34 34
35 void SendJavaScript(const std::string& buffer) override {} 35 void SendJavaScript(const std::string& buffer) override {}
36 }; 36 };
37 37
38 } // namespace 38 } // namespace
39 39
40 class MockURLDownloader : public URLDownloader { 40 class MockURLDownloader : public URLDownloader {
41 public: 41 public:
42 MockURLDownloader(base::FilePath path) 42 MockURLDownloader(base::FilePath path)
43 : URLDownloader(nil, 43 : URLDownloader(nullptr,
44 nil, 44 nullptr,
45 nullptr,
45 path, 46 path,
46 base::Bind(&MockURLDownloader::OnEndDownload, 47 base::Bind(&MockURLDownloader::OnEndDownload,
47 base::Unretained(this)), 48 base::Unretained(this)),
48 base::Bind(&MockURLDownloader::OnEndRemove, 49 base::Bind(&MockURLDownloader::OnEndRemove,
49 base::Unretained(this))) {} 50 base::Unretained(this))) {}
50 51
51 void RemoveOfflineFilesDirectory() { 52 void RemoveOfflineFilesDirectory() {
52 base::DeleteFile(reading_list::OfflineRootDirectoryPath(base_directory_), 53 base::DeleteFile(reading_list::OfflineRootDirectoryPath(base_directory_),
53 true); 54 true);
54 } 55 }
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 ASSERT_TRUE(std::find(downloader_->downloaded_files_.begin(), 184 ASSERT_TRUE(std::find(downloader_->downloaded_files_.begin(),
184 downloader_->downloaded_files_.end(), 185 downloader_->downloaded_files_.end(),
185 url) != downloader_->downloaded_files_.end()); 186 url) != downloader_->downloaded_files_.end());
186 ASSERT_TRUE(std::find(downloader_->removed_files_.begin(), 187 ASSERT_TRUE(std::find(downloader_->removed_files_.begin(),
187 downloader_->removed_files_.end(), 188 downloader_->removed_files_.end(),
188 url) != downloader_->removed_files_.end()); 189 url) != downloader_->removed_files_.end());
189 ASSERT_TRUE(downloader_->CheckExistenceOfOfflineURLPagePath(url)); 190 ASSERT_TRUE(downloader_->CheckExistenceOfOfflineURLPagePath(url));
190 } 191 }
191 192
192 } // namespace 193 } // namespace
OLDNEW
« no previous file with comments | « ios/chrome/browser/reading_list/url_downloader.cc ('k') | ios/chrome/browser/ui/reader_mode/reader_mode_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698