Commit 640e9012 authored by wnwen's avatar wnwen Committed by Commit bot

Fix ContextUtils test flakiness.

There was a race condition between Android tests calling
Application#onCreate and TestRunner#runTests which caused flakiness
in some of the UrlManagerTest* and other instrumentation tests.

Initialize the application object earlier so that it is always ready
when tests are run.

BUG=649224,637448

Review-Url: https://codereview.chromium.org/2363323003
Cr-Commit-Position: refs/heads/master@{#421256}
parent 71aed696
...@@ -92,6 +92,11 @@ public class ChromeApplication extends ContentApplication { ...@@ -92,6 +92,11 @@ public class ChromeApplication extends ContentApplication {
private PrintingController mPrintingController; private PrintingController mPrintingController;
public ChromeApplication() {
super();
ContextUtils.initApplicationContext(this);
}
/** /**
* This is called during early initialization in order to set up ChildProcessLauncher * This is called during early initialization in order to set up ChildProcessLauncher
* for certain Chrome packaging configurations * for certain Chrome packaging configurations
...@@ -113,7 +118,6 @@ public class ChromeApplication extends ContentApplication { ...@@ -113,7 +118,6 @@ public class ChromeApplication extends ContentApplication {
TraceEvent.begin("ChromeApplication.onCreate"); TraceEvent.begin("ChromeApplication.onCreate");
super.onCreate(); super.onCreate();
ContextUtils.initApplicationContext(this);
TraceEvent.end("ChromeApplication.onCreate"); TraceEvent.end("ChromeApplication.onCreate");
} }
......
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