Commit b771e97f authored by Owen Min's avatar Owen Min Committed by Chromium LUCI CQ

Try to fix flaky ExtensionRequestNotificationTest.NoExtension

Round II

EXPECT_DEATH tests are executed in a sub-process. However, this doesn't
work with the BrowserWithTestWindowTest which requires access to the
global |g_browser_process| instance. Running in a sub-process causes
crash during SetUp(). The test was passed as EXPECT_DEATH can catch the
crash inside SetUp() but it didn't check the crash error message.

There is no good way to solve this issue, hence only run the NoExtension
test while DCHECK is off and no longer verify any DCHECK failure.


Bug: 1137094
Change-Id: I59a9eb4ab0c6283194dbd80f8f1afec15410def0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2643629
Commit-Queue: Owen Min <zmin@chromium.org>
Reviewed-by: default avatarJulian Pastarmov <pastarmovj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#846263}
parent faf23f0f
......@@ -71,18 +71,16 @@ INSTANTIATE_TEST_SUITE_P(
ExtensionRequestNotification::kRejected,
ExtensionRequestNotification::kForceInstalled));
#if !DCHECK_IS_ON()
// EXPECT_DEATH doesn't work well with BrowserWithTestWindowTest. Hence only run
// the test when DCHECK is off.
TEST_P(ExtensionRequestNotificationTest, NoExtension) {
ExtensionRequestNotification request_notification(
profile(), GetNotifyType(), ExtensionRequestNotification::ExtensionIds());
#if DCHECK_IS_ON()
EXPECT_DEATH_IF_SUPPORTED(
request_notification.Show(base::BindOnce(&OnNotificationClosed, false)),
"");
#else
request_notification.Show(base::BindOnce(&OnNotificationClosed, false));
#endif
EXPECT_FALSE(GetNotification().has_value());
}
#endif //! DCHECK_IS_ON()
TEST_P(ExtensionRequestNotificationTest, HasExtensionAndClickedByUser) {
ExtensionRequestNotification request_notification(
......
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