Commit ccb37db5 authored by Joe Mason's avatar Joe Mason Committed by Commit Bot

Accept false positives in OnInfectedBrowserNotAvailable browsertest, as long...

Accept false positives in OnInfectedBrowserNotAvailable browsertest, as long as there are no false negatives

R=proberge

Bug: 753632
Change-Id: I40320606991cd416c30001ac7c5fb48701a023d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1906811
Commit-Queue: Joe Mason <joenotcharles@chromium.org>
Reviewed-by: default avatarproberge <proberge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#714218}
parent bda8c8d2
...@@ -100,17 +100,24 @@ IN_PROC_BROWSER_TEST_P(ChromeCleanerPromptUserTest, ...@@ -100,17 +100,24 @@ IN_PROC_BROWSER_TEST_P(ChromeCleanerPromptUserTest,
} }
IN_PROC_BROWSER_TEST_P(ChromeCleanerPromptUserTest, IN_PROC_BROWSER_TEST_P(ChromeCleanerPromptUserTest,
DISABLED_OnInfectedBrowserNotAvailable) { OnInfectedBrowserNotAvailable) {
browser()->window()->Minimize(); browser()->window()->Minimize();
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
dialog_controller_->OnInfected(false, ChromeCleanerScannerResults());
// We try to not show the prompt while minimized, but there will always be
// race conditions because the window manager can restore a window outside
// the test's control. So a prompt might show up even while minimized. That's
// not critical. The really important test is that a prompt always shows up
// after restoring.
//
// Install the expectation here so that we'll detect when the prompt shows
// up, even if it's too early.
base::RunLoop run_loop; base::RunLoop run_loop;
// We only set the expectation here because we want to make sure that the
// prompt is shown only when the window is restored.
EXPECT_CALL(mock_delegate_, ShowChromeCleanerPrompt(_, _, _)) EXPECT_CALL(mock_delegate_, ShowChromeCleanerPrompt(_, _, _))
.WillOnce(InvokeWithoutArgs([&run_loop]() { run_loop.Quit(); })); .WillOnce(InvokeWithoutArgs([&run_loop]() { run_loop.Quit(); }));
dialog_controller_->OnInfected(false, ChromeCleanerScannerResults());
browser()->window()->Restore(); browser()->window()->Restore();
run_loop.Run(); run_loop.Run();
} }
......
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