Skip to content

Commit

Permalink
Fix the browser test HelpAppV2DiscoverTabNotification.
Browse files Browse the repository at this point in the history
The browser test HelpAppV2DiscoverTabNotification is broken when the
flag kAppServiceLaunchWithoutMojom is enabled:
https://ci.chromium.org/p/chromium/builders/try/linux-chromeos-rel/1262612?

Because the non mojom launch interface runs synchronously. Replace the
asynchronously WaitForAppToOpen, with the synchronously checking after
running SimulateClick to launch the help app.

The checking ENABLE_CROS_HELP_APP can be removed, because the help app
is always launched.

BUG=1253250

Change-Id: I52f751ac52ca8bbdc1a4578ed6ca64d8c0bb1d95
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3790425
Commit-Queue: Nancy Wang <nancylingwang@chromium.org>
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1030082}
  • Loading branch information
Nancy Wang authored and Chromium LUCI CQ committed Jul 31, 2022
1 parent 86bb36c commit ae41787
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#include "chromeos/constants/chromeos_features.h"
#include "components/language/core/browser/pref_names.h"
#include "components/services/app_service/public/cpp/app_launch_util.h"
#include "components/services/app_service/public/cpp/features.h"
#include "components/user_manager/user_names.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
Expand Down Expand Up @@ -407,12 +408,14 @@ IN_PROC_BROWSER_TEST_P(HelpAppIntegrationTest,
kShowHelpAppDiscoverTabNotificationId,
absl::nullopt, absl::nullopt);

#if BUILDFLAG(ENABLE_CROS_HELP_APP)
EXPECT_NO_FATAL_FAILURE(WaitForAppToOpen(GURL("chrome://help-app/discover")));
#else
// We just have the original browser. No new app opens.
EXPECT_EQ(1u, chrome::GetTotalBrowserCount());
#endif
if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) {
EXPECT_EQ(2u, chrome::GetTotalBrowserCount());
EXPECT_EQ(GURL("chrome://help-app/discover"),
GetActiveWebContents()->GetVisibleURL());
} else {
EXPECT_NO_FATAL_FAILURE(
WaitForAppToOpen(GURL("chrome://help-app/discover")));
}
}

// Test that the background page can trigger the release notes notification.
Expand Down

0 comments on commit ae41787

Please sign in to comment.