Commit 88dd4409 authored by Nicholas Verne's avatar Nicholas Verne Committed by Commit Bot

CrostiniInstallerViewBrowserTest.InstallFlow flake fix.

The old version of this test could cause a browser crash by shutting down
too early. Now we wait until the flow has finished and the installer view
is closed before shutting down.

Bug: 851253
Change-Id: I9f00f23587d2e3b52c8b1355f682e5397a460de1
Reviewed-on: https://chromium-review.googlesource.com/1101599Reviewed-by: default avatarTimothy Loh <timloh@chromium.org>
Commit-Queue: Nicholas Verne <nverne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567539}
parent b73dff47
......@@ -103,6 +103,8 @@ IN_PROC_BROWSER_TEST_F(CrostiniInstallerViewBrowserTest, InvokeUi_default) {
}
IN_PROC_BROWSER_TEST_F(CrostiniInstallerViewBrowserTest, InstallFlow) {
base::HistogramTester histogram_tester;
ShowUi("default");
EXPECT_NE(nullptr, ActiveView());
EXPECT_EQ(ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL,
......@@ -115,6 +117,19 @@ IN_PROC_BROWSER_TEST_F(CrostiniInstallerViewBrowserTest, InstallFlow) {
EXPECT_FALSE(ActiveView()->GetWidget()->IsClosed());
EXPECT_FALSE(HasAcceptButton());
EXPECT_TRUE(HasCancelButton());
waiting_fake_concierge_client_->WaitForStartTerminaVmCalled();
// RunUntilIdle in this case will run the rest of the install steps including
// launching the terminal, on the UI thread.
base::RunLoop().RunUntilIdle();
EXPECT_EQ(nullptr, ActiveView());
histogram_tester.ExpectBucketCount(
"Crostini.SetupResult",
static_cast<base::HistogramBase::Sample>(
CrostiniInstallerView::SetupResult::kSuccess),
1);
}
IN_PROC_BROWSER_TEST_F(CrostiniInstallerViewBrowserTest, Cancel) {
......
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