Commit dc293ba0 authored by Wez's avatar Wez Committed by Commit Bot

[test] Minor cleanups InProcessBrowserTest.

- Fix RunUntilBrowserProcessQuits() to run-and-clear the |run_loop_|.
- Update comment in PostRunTestOnMainThread() to refer to the bug that
  now tracks the blocking cleanup work.

Bug: 922118
Change-Id: I4f1d30e0c2e19b810c09df5b102e4fea920e6767
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1585095
Auto-Submit: Wez <wez@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#654583}
parent 2cb2d6bf
......@@ -4,6 +4,8 @@
#include "chrome/test/base/in_process_browser_test.h"
#include <utility>
#include "base/auto_reset.h"
#include "base/bind.h"
#include "base/command_line.h"
......@@ -414,7 +416,7 @@ void InProcessBrowserTest::CloseAllBrowsers() {
}
void InProcessBrowserTest::RunUntilBrowserProcessQuits() {
std::move(run_loop_)->Run();
std::exchange(run_loop_, nullptr)->Run();
}
// TODO(alexmos): This function should expose success of the underlying
......@@ -623,8 +625,8 @@ void InProcessBrowserTest::PostRunTestOnMainThread() {
// Sometimes tests leave Quit tasks in the MessageLoop (for shame), so let's
// run all pending messages here to avoid preempting the QuitBrowsers tasks.
// TODO(jbates) Once crbug.com/134753 is fixed, this can be removed because it
// will not be possible to post Quit tasks.
// TODO(https://crbug.com/922118): Remove this once it is no longer possible
// to post QuitCurrent* tasks.
content::RunAllPendingInMessageLoop();
QuitBrowsers();
......
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