Commit 4c8564e5 authored by danakj's avatar danakj Committed by Commit Bot

Allow ChromeBrowserMainParts to run a |ui_task| on Android.

The |ui_task| is injected by BrowserTestBase to replace the main
message loop, and runs as part of BrowserMainRunner::Initialize().

Previously there were no Android browser tests so this path would
not have been hit and had a NOTREACHED() for Android. We remove the
OS_ANDROID defines and let Android run the |ui_task| the same way that
desktop chrome browser tests do.

R=jam@chromium.org

Bug: 961849
Change-Id: Ic2e1362ea3bc76c4c31fe0d92d9c93a9350256d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1628160
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#663995}
parent 5b68ac6a
......@@ -1813,15 +1813,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
PostBrowserStart();
#if defined(OS_ANDROID)
DCHECK(!parameters().ui_task);
#else
// The ui_task can be injected by tests to replace the main message loop.
// In that case we Run() it here, and set a flag to avoid running the main
// message loop later, as the test will do so as needed from the |ui_task|.
if (parameters().ui_task) {
parameters().ui_task->Run();
delete parameters().ui_task;
run_message_loop_ = false;
}
#endif
#if defined(OS_WIN)
// Clean up old user data directory and disk cache directory.
......
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