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

Unified Diff: components/offline_pages/core/downloads/download_ui_adapter_unittest.cc

Issue 2631933002: Adding status info to DownloadUIItem and piping it through. (Closed)
Patch Set: feedback, test compile 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 side-by-side diff with in-line comments
Download patch
Index: components/offline_pages/core/downloads/download_ui_adapter_unittest.cc
diff --git a/components/offline_pages/core/downloads/download_ui_adapter_unittest.cc b/components/offline_pages/core/downloads/download_ui_adapter_unittest.cc
index c65dc37d075320fa2d36345da55abcef813f3af7..5c2edeaa6146fb91ca60ecc65157b8d58cecbec3 100644
--- a/components/offline_pages/core/downloads/download_ui_adapter_unittest.cc
+++ b/components/offline_pages/core/downloads/download_ui_adapter_unittest.cc
@@ -47,6 +47,20 @@ static const base::Time kTestCreationTime = base::Time::Now();
static const base::string16 kTestTitle = base::ASCIIToUTF16("test title");
} // namespace
+// Mock DownloadUIAdapter::Delegate
+class DownloadUIAdapterDelegate : public DownloadUIAdapter::Delegate {
+ public:
+ DownloadUIAdapterDelegate() {
+ }
+ ~DownloadUIAdapterDelegate() override {}
+
+ // DownloadUIAdapter::Delegate
+ bool IsVisibleInUI(const ClientId& client_id) override { return true; }
+ bool IsTemporaryHiddenInUI(const ClientId& client_id) override {
+ return false;
+ }
+};
+
// Mock OfflinePageModel for testing the SavePage calls.
class MockOfflinePageModel : public StubOfflinePageModel {
public:
@@ -54,7 +68,8 @@ class MockOfflinePageModel : public StubOfflinePageModel {
: observer_(nullptr),
task_runner_(task_runner),
policy_controller_(new ClientPolicyController()) {
- adapter.reset(new DownloadUIAdapter(this));
+ DownloadUIAdapterDelegate* delegate = new DownloadUIAdapterDelegate(this, )
+ adapter.reset(new DownloadUIAdapter(this, ));
// Add one page.
OfflinePageItem page(GURL(kTestUrl), kTestOfflineId1, kTestClientId1,
kTestFilePath, kFileSize, kTestCreationTime);

Powered by Google App Engine
This is Rietveld 408576698