Commit 05e3fd25 authored by Rachel Carpenter's avatar Rachel Carpenter Committed by Commit Bot

Turn off Release notes suggestion chips.

These don't currently work the way we expect them to, so turn off for
now.

Bug: b/169711884
Change-Id: I4f248220623f6ad74fafd7ef9948cdefba56dc30
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2449614Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Rachel Carpenter <carpenterr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#814448}
parent 63f8eee6
......@@ -91,14 +91,8 @@ void ReleaseNotesStorage::MarkNotificationShown() {
}
bool ReleaseNotesStorage::ShouldShowSuggestionChip() {
if (!base::FeatureList::IsEnabled(
chromeos::features::kReleaseNotesNotification)) {
return false;
}
const int times_left_to_show = profile_->GetPrefs()->GetInteger(
prefs::kReleaseNotesSuggestionChipTimesLeftToShow);
return times_left_to_show > 0;
// TODO(b/169711884): Re-enable this when we have a working version.
return false;
}
void ReleaseNotesStorage::DecreaseTimesLeftToShowSuggestionChip() {
......
......@@ -134,10 +134,24 @@ TEST_F(ReleaseNotesStorageTest, ShouldNotShowReleaseNotesIfFeatureDisabled) {
EXPECT_EQ(false, release_notes_storage->ShouldNotify());
}
// Tests that when kReleaseNotesSuggestionChipTimesLeftToShow is 0,
// ReleaseNotesStorage::ShouldShowSuggestionChip returns false.
TEST_F(ReleaseNotesStorageTest, DoesNotShowReleaseNotesSuggestionChip) {
std::unique_ptr<Profile> profile =
SetupStandardEnvironmentAndProfile("test@gmail.com", false);
std::unique_ptr<ReleaseNotesStorage> release_notes_storage =
std::make_unique<ReleaseNotesStorage>(profile.get());
profile.get()->GetPrefs()->SetInteger(
prefs::kReleaseNotesSuggestionChipTimesLeftToShow, 0);
EXPECT_EQ(false, release_notes_storage->ShouldShowSuggestionChip());
}
// Tests that when kReleaseNotesSuggestionChipTimesLeftToShow is greater than 0,
// ReleaseNotesStorage::ShouldShowSuggestionChip returns true, and when the
// value is 0 the method returns false.
TEST_F(ReleaseNotesStorageTest, ShowReleaseNotesSuggestionChip) {
// ReleaseNotesStorage::ShouldShowSuggestionChip returns true, and when
// decreased the method returns false again.
// TODO(b/169711884): Re-enable when suggestion chips are re-enabled.
TEST_F(ReleaseNotesStorageTest, DISABLED_ShowReleaseNotesSuggestionChip) {
std::unique_ptr<Profile> profile =
SetupStandardEnvironmentAndProfile("test@gmail.com", false);
std::unique_ptr<ReleaseNotesStorage> release_notes_storage =
......@@ -155,7 +169,9 @@ TEST_F(ReleaseNotesStorageTest, ShowReleaseNotesSuggestionChip) {
// Tests that when we mark a notification as shown, we also show the suggestion
// chip.
TEST_F(ReleaseNotesStorageTest, ShowSuggestionChipWhenNotificationShown) {
// TODO(b/169711884): Re-enable when suggestion chips are re-enabled.
TEST_F(ReleaseNotesStorageTest,
DISABLED_ShowSuggestionChipWhenNotificationShown) {
std::unique_ptr<Profile> profile =
SetupStandardEnvironmentAndProfile("test@gmail.com", false);
std::unique_ptr<ReleaseNotesStorage> release_notes_storage =
......
......@@ -149,8 +149,9 @@ IN_PROC_BROWSER_TEST_F(AppListSearchBrowserTest, SearchDoesntCrash) {
// Test that Help App shows up as Release notes if pref shows we have some times
// left to show it.
// TODO(b/169711884): Re-enable when suggestion chips are re-enabled.
IN_PROC_BROWSER_TEST_F(ReleaseNotesSearchBrowserTest,
AppListSearchHasSuggestionChip) {
DISABLED_AppListSearchHasSuggestionChip) {
web_app::WebAppProvider::Get(GetProfile())
->system_web_app_manager()
.InstallSystemAppsForTesting();
......
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