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

Unified Diff: ui/app_list/test/app_list_test_model.cc

Issue 217473005: Test cases for FolderHeaderView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | « ui/app_list/test/app_list_test_model.h ('k') | ui/app_list/views/folder_header_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/test/app_list_test_model.cc
diff --git a/ui/app_list/test/app_list_test_model.cc b/ui/app_list/test/app_list_test_model.cc
index 527383e199b4464ebda950dd1a6a6626c89d55c3..66d2a6924ea83f5d173d14645dbfa928425ff185 100644
--- a/ui/app_list/test/app_list_test_model.cc
+++ b/ui/app_list/test/app_list_test_model.cc
@@ -69,7 +69,7 @@ void AppListTestModel::PopulateApps(int n) {
CreateAndAddItem(GetItemName(start_index + i));
}
-void AppListTestModel::CreateAndPopulateFolderWithApps(int n) {
+AppListFolderItem* AppListTestModel::CreateAndPopulateFolderWithApps(int n) {
DCHECK_GT(n, 1);
int start_index = static_cast<int>(top_level_item_list()->item_count());
AppListTestItem* item = CreateAndAddItem(GetItemName(start_index));
@@ -78,6 +78,16 @@ void AppListTestModel::CreateAndPopulateFolderWithApps(int n) {
AppListTestItem* new_item = CreateAndAddItem(GetItemName(start_index + i));
merged_item_id = AppListModel::MergeItems(merged_item_id, new_item->id());
}
+ AppListItem* merged_item = FindItem(merged_item_id);
+ DCHECK(merged_item->GetItemType() == AppListFolderItem::kItemType);
+ return static_cast<AppListFolderItem*>(merged_item);
+}
+
+AppListFolderItem* AppListTestModel::CreateAndAddOemFolder(
+ const std::string& id) {
+ AppListFolderItem* folder =
+ new AppListFolderItem(id, AppListFolderItem::FOLDER_TYPE_OEM);
+ return static_cast<AppListFolderItem*>(AddItem(folder));
}
void AppListTestModel::PopulateAppWithId(int id) {
« no previous file with comments | « ui/app_list/test/app_list_test_model.h ('k') | ui/app_list/views/folder_header_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698