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

Unified Diff: chrome/browser/banners/app_banner_manager_browsertest.cc

Issue 2944283002: Replace --add-to-shelf flag with kAppBanners feature. (Closed)
Patch Set: Rebase Created 3 years, 6 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/about_flags.cc ('k') | chrome/browser/banners/app_banner_manager_desktop.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/banners/app_banner_manager_browsertest.cc
diff --git a/chrome/browser/banners/app_banner_manager_browsertest.cc b/chrome/browser/banners/app_banner_manager_browsertest.cc
index 34f60969fe37ae814c9c19d685e70497d8e718c8..60ac59b23c938e4f7870c36b3f29d9f6000c234f 100644
--- a/chrome/browser/banners/app_banner_manager_browsertest.cc
+++ b/chrome/browser/banners/app_banner_manager_browsertest.cc
@@ -115,12 +115,11 @@ class AppBannerManagerBrowserTest : public InProcessBrowserTest {
AppBannerSettingsHelper::SetTotalEngagementToTrigger(10);
SiteEngagementScore::SetParamValuesForTesting();
ASSERT_TRUE(embedded_test_server()->Start());
- }
- void SetUpCommandLine(base::CommandLine* command_line) override {
// Make sure app banners are disabled in the browser, otherwise they will
// interfere with the test.
- command_line->AppendSwitch(switches::kDisableAddToShelf);
+ feature_list_.InitAndDisableFeature(features::kAppBanners);
+ InProcessBrowserTest::SetUpOnMainThread();
}
protected:
@@ -225,6 +224,8 @@ class AppBannerManagerBrowserTest : public InProcessBrowserTest {
EXPECT_FALSE(manager->need_to_log_status());
}
}
+
+ base::test::ScopedFeatureList feature_list_;
};
IN_PROC_BROWSER_TEST_F(AppBannerManagerBrowserTest, WebAppBannerCreated) {
@@ -398,8 +399,8 @@ IN_PROC_BROWSER_TEST_F(AppBannerManagerBrowserTest, DoesNotShowInIncognito) {
IN_PROC_BROWSER_TEST_F(AppBannerManagerBrowserTest,
CheckOnLoadWithSufficientEngagement) {
base::test::ScopedFeatureList feature_list;
- feature_list.InitAndEnableFeature(
- features::kCheckInstallabilityForBannerOnLoad);
+ feature_list.InitWithFeatures({features::kCheckInstallabilityForBannerOnLoad},
+ {features::kAppBanners});
std::unique_ptr<AppBannerManagerTest> manager(
CreateAppBannerManager(browser()));
std::vector<double> engagement_scores{10};
@@ -410,8 +411,8 @@ IN_PROC_BROWSER_TEST_F(AppBannerManagerBrowserTest,
IN_PROC_BROWSER_TEST_F(AppBannerManagerBrowserTest,
CheckOnLoadWithSufficientEngagementCancelDirect) {
base::test::ScopedFeatureList feature_list;
- feature_list.InitAndEnableFeature(
- features::kCheckInstallabilityForBannerOnLoad);
+ feature_list.InitWithFeatures({features::kCheckInstallabilityForBannerOnLoad},
+ {features::kAppBanners});
std::unique_ptr<AppBannerManagerTest> manager(
CreateAppBannerManager(browser()));
std::vector<double> engagement_scores{10};
@@ -423,8 +424,8 @@ IN_PROC_BROWSER_TEST_F(
AppBannerManagerBrowserTest,
CheckOnLoadWithSufficientEngagementCancelBannerAfterPromptInHandler) {
base::test::ScopedFeatureList feature_list;
- feature_list.InitAndEnableFeature(
- features::kCheckInstallabilityForBannerOnLoad);
+ feature_list.InitWithFeatures({features::kCheckInstallabilityForBannerOnLoad},
+ {features::kAppBanners});
std::unique_ptr<AppBannerManagerTest> manager(
CreateAppBannerManager(browser()));
std::vector<double> engagement_scores{10};
@@ -444,8 +445,8 @@ IN_PROC_BROWSER_TEST_F(AppBannerManagerBrowserTest,
SiteEngagementService* service =
SiteEngagementService::Get(browser()->profile());
base::test::ScopedFeatureList feature_list;
- feature_list.InitAndEnableFeature(
- features::kCheckInstallabilityForBannerOnLoad);
+ feature_list.InitWithFeatures({features::kCheckInstallabilityForBannerOnLoad},
+ {features::kAppBanners});
std::unique_ptr<AppBannerManagerTest> manager(
CreateAppBannerManager(browser()));
@@ -492,8 +493,8 @@ IN_PROC_BROWSER_TEST_F(AppBannerManagerBrowserTest,
IN_PROC_BROWSER_TEST_F(AppBannerManagerBrowserTest, CheckOnLoadThenNavigate) {
base::test::ScopedFeatureList feature_list;
- feature_list.InitAndEnableFeature(
- features::kCheckInstallabilityForBannerOnLoad);
+ feature_list.InitWithFeatures({features::kCheckInstallabilityForBannerOnLoad},
+ {features::kAppBanners});
std::unique_ptr<AppBannerManagerTest> manager(
CreateAppBannerManager(browser()));
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/banners/app_banner_manager_desktop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698