Commit 50211c3d authored by Eric Willigers's avatar Eric Willigers Committed by Commit Bot

Desktop PWAs: Launch fewer apps in ManyUserApps test

WebAppEngagementBrowserTest/ManyUserApps now launches only
2 apps instead of 4, to avoid test timeouts.


Bug: 1034028
Change-Id: I346605d69a8fbb7b043996b7af4e947799ca4610
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1975384
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Reviewed-by: default avatarAlan Cutter <alancutter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#726296}
parent a78e162a
......@@ -363,13 +363,15 @@ IN_PROC_BROWSER_TEST_P(WebAppEngagementBrowserTest, TwoApps) {
ExpectLaunchCounts(tester, /*windowLaunches=*/3, /*tabLaunches=*/0);
}
// Flaky. http://crbug.com/1034028
IN_PROC_BROWSER_TEST_P(WebAppEngagementBrowserTest, DISABLED_ManyUserApps) {
IN_PROC_BROWSER_TEST_P(WebAppEngagementBrowserTest, ManyUserApps) {
base::HistogramTester tester;
// More than 3 user-installed apps:
const int num_user_apps = 4;
// A small number of launches, to avoid timeouts.
const int num_launches = 2;
std::vector<AppId> app_ids;
// Install apps.
......@@ -384,8 +386,9 @@ IN_PROC_BROWSER_TEST_P(WebAppEngagementBrowserTest, DISABLED_ManyUserApps) {
app_ids.push_back(app_id);
}
// Launch apps in windows.
for (int i = 0; i < num_user_apps; ++i) {
// Launch an app in a window.
DCHECK_LE(num_launches, num_user_apps);
for (int i = 0; i < num_launches; ++i) {
Browser* browser = LaunchWebAppBrowser(app_ids[i]);
const GURL url = GetUrlForSuffix(base_url, i);
......@@ -400,9 +403,10 @@ IN_PROC_BROWSER_TEST_P(WebAppEngagementBrowserTest, DISABLED_ManyUserApps) {
ExpectUniqueSamples(tester, histograms,
SiteEngagementService::ENGAGEMENT_WEBAPP_SHORTCUT_LAUNCH,
4);
num_launches);
ExpectTotalCounts(tester, ~histograms, 0);
ExpectLaunchCounts(tester, /*windowLaunches=*/4, /*tabLaunches=*/0);
ExpectLaunchCounts(tester, /*windowLaunches=*/num_launches,
/*tabLaunches=*/0);
}
IN_PROC_BROWSER_TEST_P(HostedAppEngagementBrowserTest, DefaultApp) {
......
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