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

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

Issue 2506993002: Create offline_url_utils (Closed)
Patch Set: use StringPrintf Created 4 years, 1 month 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.cc
diff --git a/ios/chrome/browser/reading_list/url_downloader_unittest.cc b/ios/chrome/browser/reading_list/url_downloader_unittest.cc
index e5df3edc50d6fce3d3b3a99204fb668ce027bb2e..3cf4c9940e9fe9e6b2df378e5380c44a47bff3ff 100644
--- a/ios/chrome/browser/reading_list/url_downloader_unittest.cc
+++ b/ios/chrome/browser/reading_list/url_downloader_unittest.cc
@@ -13,6 +13,7 @@
#import "base/test/ios/wait_util.h"
#include "ios/chrome/browser/chrome_paths.h"
#include "ios/chrome/browser/dom_distiller/distiller_viewer.h"
+#include "ios/chrome/browser/reading_list/offline_url_utils.h"
#include "ios/web/public/test/test_web_thread_bundle.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -44,10 +45,11 @@ class MockURLDownloader : public URLDownloader {
base::Bind(&MockURLDownloader::OnEndDownload,
base::Unretained(this)),
base::Bind(&MockURLDownloader::OnEndRemove,
- base::Unretained(this))) {}
+ base::Unretained(this))),
+ base_path_(path) {}
void RemoveOfflineFilesDirectory() {
- base::DeleteFile(OfflineRootDirectoryPath(), true);
+ base::DeleteFile(reading_list::OfflineRootDirectoryPath(base_path_), true);
}
void ClearCompletionTrackers() {
@@ -56,7 +58,8 @@ class MockURLDownloader : public URLDownloader {
}
bool CheckExistenceOfOfflineURLPagePath(const GURL& url) {
- return base::PathExists(OfflinePageAbsolutePath(url));
+ return base::PathExists(
+ reading_list::OfflinePageAbsolutePath(base_directory_, url));
gambard 2016/11/16 12:44:20 base_directory_ or base_path_?
Olivier 2016/11/16 13:36:27 Actually MockURLDownloader is friend of URLDownloa
}
void FakeWorking() { working_ = true; }
@@ -90,6 +93,8 @@ class MockURLDownloader : public URLDownloader {
void OnEndRemove(const GURL& url, bool success) {
removed_files_.push_back(url);
}
+
+ base::FilePath base_path_;
};
namespace {

Powered by Google App Engine
This is Rietveld 408576698