Commit be611a0e authored by Rachel Wong's avatar Rachel Wong Committed by Commit Bot

Enable Suggested Content by default.

The Suggested Content toggle has been approved in
https://bugs.chromium.org/p/chromium/issues/detail?id=990279#c148. This
CL enables the feature by default, and updates tests that need to take
this into account.

Bug: 990279
Change-Id: Icc2c8bdf72cff8734aa5941f3fbc2774b38e4c98
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2462752Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarJia Meng <jiameng@chromium.org>
Commit-Queue: Rachel Wong <wrong@chromium.org>
Cr-Commit-Position: refs/heads/master@{#818758}
parent 9d66b1db
......@@ -18,6 +18,7 @@
#include "ash/app_list/views/apps_container_view.h"
#include "ash/app_list/views/apps_grid_view.h"
#include "ash/app_list/views/contents_view.h"
#include "ash/app_list/views/privacy_container_view.h"
#include "ash/app_list/views/search_result_container_view.h"
#include "ash/app_list/views/search_result_page_view.h"
#include "ash/app_list/views/search_result_tile_item_view.h"
......@@ -137,15 +138,20 @@ class AppListAppLaunchedMetricTest : public AshTestBase {
}
GetAppListTestHelper()->WaitUntilIdle();
// Mark the privacy notices as dismissed so that the tile items will be the
// first search container.
ContentsView* contents_view = Shell::Get()
->app_list_controller()
->presenter()
->GetView()
->app_list_main_view()
->contents_view();
Shell::Get()->app_list_controller()->MarkAssistantPrivacyInfoDismissed();
Shell::Get()->app_list_controller()->MarkSuggestedContentInfoDismissed();
contents_view->privacy_container_view()->Update();
SearchResultContainerView* search_result_container_view =
Shell::Get()
->app_list_controller()
->presenter()
->GetView()
->app_list_main_view()
->contents_view()
->search_results_page_view()
->result_container_views()[0];
contents_view->search_results_page_view()->result_container_views()[0];
// Request focus on the first tile item view.
search_result_container_view->GetFirstResultView()->RequestFocus();
......
......@@ -21,6 +21,7 @@
#include "ash/app_list/views/apps_grid_view.h"
#include "ash/app_list/views/contents_view.h"
#include "ash/app_list/views/expand_arrow_view.h"
#include "ash/app_list/views/privacy_container_view.h"
#include "ash/app_list/views/search_box_view.h"
#include "ash/app_list/views/search_result_actions_view.h"
#include "ash/app_list/views/search_result_base_view.h"
......@@ -467,6 +468,16 @@ TEST_F(AppListPresenterDelegateTest, ClickSearchBoxInTabletMode) {
TEST_F(AppListPresenterDelegateTest, RemoveSuggestionShowsConfirmDialog) {
ShowZeroStateSearchInHalfState();
// Mark the privacy notices as dismissed so that they do not interfere with
// the layout.
Shell::Get()->app_list_controller()->MarkAssistantPrivacyInfoDismissed();
Shell::Get()->app_list_controller()->MarkSuggestedContentInfoDismissed();
GetAppListView()
->app_list_main_view()
->contents_view()
->privacy_container_view()
->Update();
// Add a zero state suggestion results - the result that will be tested is in
// the second place.
Shell::Get()->app_list_controller()->GetSearchModel()->results()->Add(
......
......@@ -38,6 +38,7 @@
#include "ash/wm/desks/desks_restore_util.h"
#include "ash/wm/gestures/wm_gesture_handler.h"
#include "chromeos/components/quick_answers/public/cpp/quick_answers_prefs.h"
#include "chromeos/constants/chromeos_pref_names.h"
#include "chromeos/services/assistant/public/cpp/assistant_prefs.h"
#include "components/pref_registry/pref_registry_syncable.h"
......@@ -82,6 +83,9 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry, bool for_test) {
registry->RegisterBooleanPref(
prefs::kMouseReverseScroll, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_OS_PRIORITY_PREF);
registry->RegisterBooleanPref(
chromeos::prefs::kSuggestedContentEnabled, true,
user_prefs::PrefRegistrySyncable::SYNCABLE_OS_PREF);
}
}
......
......@@ -35,6 +35,9 @@ suite('PrivacyPageTests', function() {
suggestedContentToggleEnabled: false,
});
privacyPage = document.createElement('os-settings-privacy-page');
document.body.appendChild(privacyPage);
Polymer.dom.flush();
assertEquals(null, privacyPage.$$('#suggested-content'));
......@@ -131,4 +134,4 @@ suite('PrivacePageTest_OfficialBuild', function() {
deepLinkElement, getDeepActiveElement(),
'Send usage stats toggle should be focused for settingId=1103.');
});
});
\ No newline at end of file
});
......@@ -592,7 +592,7 @@ const base::Feature kSplitSettingsSync{"SplitSettingsSync",
// Enables a settings UI toggle that controls Suggested Content status. Also
// enables a corresponding notice in the Launcher about Suggested Content.
const base::Feature kSuggestedContentToggle{"SuggestedContentToggle",
base::FEATURE_DISABLED_BY_DEFAULT};
base::FEATURE_ENABLED_BY_DEFAULT};
// Enables or disables using the system input engine for physical typing in
// languages based on latin script.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment