Commit b869a445 authored by Maksim Ivanov's avatar Maksim Ivanov Committed by Commit Bot

Fix VpnProviderApiTest.DestroyConnectedConfig

Fix the flakiness in the VpnProviderApiTest.DestroyConnectedConfig test
caused by the C++ side missing the JS test success notification.

In a detail, the test was first deleting the VPN config - which triggers
the "disconnected" vpnProvider.onPlatformMessage event and the test's
test.succeed() call - and then creating a ResultCatcher afterwards. With
unlucky timing, all of the steps, including the test.succeed() event
arrival to the browser process, were happening before the ResultCatcher
was constructed.
The fix is therefore to move the construction of the ResultCatcher to
happen earlier, before deleting the VPN config.

Bug: 1108527
Test: run "browser_process --gtest_filter=VpnProviderApiTest.DestroyConnectedConfig" under stress a thousand times
Change-Id: Ib26da605dc379240b8925f275bd22d96aadd99e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2315337
Auto-Submit: Maksim Ivanov <emaxx@chromium.org>
Commit-Queue: Andreea-Elena Costinas <acostinas@google.com>
Reviewed-by: default avatarAndreea-Elena Costinas <acostinas@google.com>
Cr-Commit-Position: refs/heads/master@{#791177}
parent 61cb4606
......@@ -257,12 +257,13 @@ IN_PROC_BROWSER_TEST_F(VpnProviderApiTest, DestroyConnectedConfig) {
EXPECT_TRUE(RunExtensionTest("destroyConnectedConfigSetup"));
extensions::ResultCatcher catcher;
EXPECT_TRUE(DestroyConfigForTest(kTestConfig));
EXPECT_FALSE(DoesConfigExist(kTestConfig));
EXPECT_FALSE(ShillProfileClient::Get()->GetTestInterface()->GetService(
service_path, &profile_path, &properties));
extensions::ResultCatcher catcher;
ASSERT_TRUE(catcher.GetNextResult());
}
......
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