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

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

Issue 2263753002: Add 'title' field to DownloadUIItem and thread through bridges to OfflinePageDownloadItem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR feedback Created 4 years, 4 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/downloads/download_ui_adapter_unittest.cc
diff --git a/components/offline_pages/downloads/download_ui_adapter_unittest.cc b/components/offline_pages/downloads/download_ui_adapter_unittest.cc
index f3935a7fa5c0a68d62e4568bcfa982982b282296..a8a6152232ec40dce2b43e776e521198685cc1fd 100644
--- a/components/offline_pages/downloads/download_ui_adapter_unittest.cc
+++ b/components/offline_pages/downloads/download_ui_adapter_unittest.cc
@@ -16,6 +16,7 @@
#include "base/files/file_path.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
+#include "base/strings/utf_string_conversions.h"
#include "base/test/test_mock_time_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h"
@@ -42,6 +43,7 @@ static const base::FilePath kTestFilePath =
base::FilePath(FILE_PATH_LITERAL("foo/bar.mhtml"));
static const int kFileSize = 1000;
static const base::Time kTestCreationTime = base::Time::Now();
+static const base::string16 kTestTitle = base::ASCIIToUTF16("test title");
} // namespace
// Mock OfflinePageModel for testing the SavePage calls.
@@ -58,6 +60,7 @@ class MockOfflinePageModel : public StubOfflinePageModel {
kTestFilePath,
kFileSize,
kTestCreationTime);
+ page.title = kTestTitle;
pages[kTestOfflineId1] = page;
}
@@ -198,6 +201,7 @@ TEST_F(DownloadUIAdapterTest, InitialItemConversion) {
EXPECT_EQ(kTestFilePath, item->target_path);
EXPECT_EQ(kTestCreationTime, item->start_time);
EXPECT_EQ(kFileSize, item->total_bytes);
+ EXPECT_EQ(kTestTitle, item->title);
}
TEST_F(DownloadUIAdapterTest, ItemDeletedAdded) {

Powered by Google App Engine
This is Rietveld 408576698