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

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

Issue 2697963002: [Offline Pages] Make prerenderer notify us of network progress. (Closed)
Patch Set: add some tests. 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
« no previous file with comments | « components/offline_pages/core/downloads/download_ui_adapter.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f69153205aa23b2196065b70158756624ca5edd2..cb7eac27728f4eb35cdea4dc1a54b43a39420b74 100644
--- a/components/offline_pages/core/downloads/download_ui_adapter_unittest.cc
+++ b/components/offline_pages/core/downloads/download_ui_adapter_unittest.cc
@@ -439,4 +439,21 @@ TEST_F(DownloadUIAdapterTest, RequestBecomesPage) {
EXPECT_EQ(DownloadUIItem::DownloadState::COMPLETE, item->download_state);
}
+TEST_F(DownloadUIAdapterTest, UpdateProgress) {
+ offliner_stub->enable_callback(true);
+ AddRequest(GURL(kTestUrl), kTestClientId1);
+ PumpLoop();
+
+ int64_t offline_id = adapter->GetOfflineIdByGuid(kTestGuid1);
+ const DownloadUIItem* item = adapter->GetItem(kTestGuid1);
+
+ ASSERT_NE(nullptr, item);
+ EXPECT_EQ(item->download_progress_bytes, 0);
+ updated_guids.clear();
+
+ adapter->UpdateProgress(offline_id, 15);
+ EXPECT_EQ(kTestGuid1, updated_guids[0]);
+ EXPECT_EQ(item->download_progress_bytes, 15);
+}
+
} // namespace offline_pages
« no previous file with comments | « components/offline_pages/core/downloads/download_ui_adapter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698