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

Unified Diff: chrome/browser/ui/app_list/search/app_search_provider_unittest.cc

Issue 954363002: Fix sort order of unlaunched apps on app list start page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add_start_page_context_and_logs
Patch Set: address comment Created 5 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 | « chrome/browser/ui/app_list/search/app_search_provider.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/app_list/search/app_search_provider_unittest.cc
diff --git a/chrome/browser/ui/app_list/search/app_search_provider_unittest.cc b/chrome/browser/ui/app_list/search/app_search_provider_unittest.cc
index 8fb6188a5cf28e59b593f054f969e74c787714f0..01c506de02f516afbd4a5daa2a6e922447bc9611 100644
--- a/chrome/browser/ui/app_list/search/app_search_provider_unittest.cc
+++ b/chrome/browser/ui/app_list/search/app_search_provider_unittest.cc
@@ -21,6 +21,7 @@
#include "extensions/common/extension_set.h"
#include "sync/api/string_ordinal.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/app_list/app_list_folder_item.h"
#include "ui/app_list/app_list_item.h"
#include "ui/app_list/app_list_model.h"
#include "ui/app_list/search_result.h"
@@ -158,6 +159,7 @@ TEST_F(AppSearchProviderTest, FetchRecommendations) {
}
TEST_F(AppSearchProviderTest, FetchUnlaunchedRecommendations) {
+ const char kFolderId[] = "folder1";
extensions::ExtensionPrefs* prefs =
extensions::ExtensionPrefs::Get(profile_.get());
@@ -174,6 +176,18 @@ TEST_F(AppSearchProviderTest, FetchUnlaunchedRecommendations) {
model()->FindItem(kPackagedApp2Id),
model()->FindItem(kPackagedApp1Id)->position().CreateBefore());
EXPECT_EQ("Hosted App,Packaged App 2,Packaged App 1", RunQuery(""));
+
+ // Moving an app into a folder deprioritizes it.
+ model()->AddItem(scoped_ptr<AppListFolderItem>(
+ new AppListFolderItem(kFolderId, AppListFolderItem::FOLDER_TYPE_NORMAL)));
+ model()->MoveItemToFolder(model()->FindItem(kPackagedApp2Id), kFolderId);
+ EXPECT_EQ("Hosted App,Packaged App 1,Packaged App 2", RunQuery(""));
+
+ // The position of the folder shouldn't matter.
+ model()->SetItemPosition(
+ model()->FindItem(kFolderId),
+ model()->FindItem(kPackagedApp1Id)->position().CreateBefore());
+ EXPECT_EQ("Hosted App,Packaged App 1,Packaged App 2", RunQuery(""));
}
} // namespace test
« no previous file with comments | « chrome/browser/ui/app_list/search/app_search_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698