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

Unified Diff: ios/chrome/browser/reading_list/url_downloader_unittest.mm

Issue 2707043002: [Reading List iOS] Store distillation date and size. (Closed)
Patch Set: done Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/reading_list/url_downloader_unittest.mm
diff --git a/ios/chrome/browser/reading_list/url_downloader_unittest.mm b/ios/chrome/browser/reading_list/url_downloader_unittest.mm
index 8946833563e7ce42afb6edc36df725b28ea8c46f..665b8b266fae8d0d4724e9c88ae8d133a824dd66 100644
--- a/ios/chrome/browser/reading_list/url_downloader_unittest.mm
+++ b/ios/chrome/browser/reading_list/url_downloader_unittest.mm
@@ -31,6 +31,11 @@ class DistillerViewerTest : public dom_distiller::DistillerViewerInterface {
const std::string& mime_type)
: dom_distiller::DistillerViewerInterface(nil) {
std::vector<ImageInfo> images;
+ ImageInfo image;
+ image.url = GURL("http://image");
+ image.data = "image";
+ images.push_back(image);
+
if (redirect_url.is_valid()) {
delegate->DistilledPageRedirectedToURL(url, redirect_url);
}
@@ -101,6 +106,7 @@ class MockURLDownloader : public URLDownloader {
return;
}
original_url_ = url;
+ saved_size_ = 0;
distiller_.reset(new DistillerViewerTest(
url,
base::Bind(&URLDownloader::DistillerCallback, base::Unretained(this)),
@@ -113,9 +119,12 @@ class MockURLDownloader : public URLDownloader {
const GURL& distilled_url,
SuccessState success,
const base::FilePath& distilled_path,
+ int64_t size,
const std::string& title) {
downloaded_files_.push_back(url);
- DCHECK_EQ(distilled_url, redirect_url_);
+ // Saved data is the string "html" and an image with data "image".
+ EXPECT_EQ(size, 9);
+ EXPECT_EQ(distilled_url, redirect_url_);
}
void OnEndRemove(const GURL& url, bool success) {

Powered by Google App Engine
This is Rietveld 408576698