Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(623)

Unified Diff: ios/chrome/test/ios_chrome_unit_test_suite.cc

Issue 1111193002: [Upstream] Force instantiation of BSKSF during unit tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/chrome/ios_chrome.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/test/ios_chrome_unit_test_suite.cc
diff --git a/ios/chrome/test/ios_chrome_unit_test_suite.cc b/ios/chrome/test/ios_chrome_unit_test_suite.cc
index 7e97b9b9e2b40a57a7895576a1d8ef1b9505391c..bb28a4252fabc4d90cfd3ef8376926f0325d0f43 100644
--- a/ios/chrome/test/ios_chrome_unit_test_suite.cc
+++ b/ios/chrome/test/ios_chrome_unit_test_suite.cc
@@ -4,6 +4,8 @@
#include "ios/chrome/test/ios_chrome_unit_test_suite.h"
+#include "ios/chrome/browser/browser_state/browser_state_keyed_service_factories.h"
+#include "ios/chrome/browser/chrome_paths.h"
#include "ios/public/test/test_chrome_browser_provider.h"
#include "ios/public/test/test_chrome_provider_initializer.h"
#include "ios/web/public/web_client.h"
@@ -56,6 +58,11 @@ void IOSChromeUnitTestSuite::Initialize() {
testing::UnitTest::GetInstance()->listeners();
listeners.Append(new IOSChromeUnitTestSuiteInitializer);
+ // Ensure that all BrowserStateKeyedServiceFactories are built before any
+ // test is run so that the dependencies are correctly resolved.
+ EnsureBrowserStateKeyedServiceFactoriesBuilt();
+
+ ios::RegisterPathProvider();
ui::RegisterPathProvider();
{
« no previous file with comments | « ios/chrome/ios_chrome.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698