Fix org.chromium.content.browser.BrowserStartupControllerTest failures on Android.

The crash is caused due to junit test BrowserStartupControllerTest doesn't
initialize the native but call serviceManagerStartupComplete. In that function,
we record startup metrics and failed due to native doesn't initialized. Therefore,
we add a protect function for the metrics record and override it in the
TestBrowserStartupController.

Bug: 912619
Change-Id: Ifa6ba36bc926f0f033f7df0f4e6a67fce0ca340f
Reviewed-on: https://chromium-review.googlesource.com/c/1366717
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Commit-Queue: Xi Han <hanxi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#614537}
2 files changed