summaryrefslogtreecommitdiffstats
path: root/ios/chrome/test
diff options
context:
space:
mode:
authorsdefresne <sdefresne@chromium.org>2015-06-15 07:12:22 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-15 14:13:03 +0000
commit87b99b8a14a750b6fa5eb0b414956a01ee0bb35e (patch)
tree1da757afecfa0f1e5b690b62eee6ba94e532b90a /ios/chrome/test
parent1fc2b3dc77072f7973bf5209f1699a54b3ba7f2b (diff)
downloadchromium_src-87b99b8a14a750b6fa5eb0b414956a01ee0bb35e.zip
chromium_src-87b99b8a14a750b6fa5eb0b414956a01ee0bb35e.tar.gz
chromium_src-87b99b8a14a750b6fa5eb0b414956a01ee0bb35e.tar.bz2
[iOS] KeyedServiceProvider improvements
Decouple the KeyedServiceProvider access and lifetime from ChromeBrowserProvider as the KeyedService factory dependencies is resolved at instantiation time and thus KeyedServiceProvider must never be replaced. KeyedServiceProvider export a method to force instantiation of all factories so that the dependencies are correctly enforced. BUG=478763 Review URL: https://codereview.chromium.org/1179173006 Cr-Commit-Position: refs/heads/master@{#334373}
Diffstat (limited to 'ios/chrome/test')
-rw-r--r--ios/chrome/test/ios_chrome_unit_test_suite.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/ios/chrome/test/ios_chrome_unit_test_suite.cc b/ios/chrome/test/ios_chrome_unit_test_suite.cc
index 7b59a14..c7c2bb3 100644
--- a/ios/chrome/test/ios_chrome_unit_test_suite.cc
+++ b/ios/chrome/test/ios_chrome_unit_test_suite.cc
@@ -8,6 +8,7 @@
#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/public/test/test_keyed_service_provider.h"
#include "ios/web/public/web_client.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/resource/resource_bundle.h"
@@ -64,6 +65,8 @@ void IOSChromeUnitTestSuite::Initialize() {
// Ensure that all BrowserStateKeyedServiceFactories are built before any
// test is run so that the dependencies are correctly resolved.
+ ios::TestKeyedServiceProvider keyed_service_provider;
+ ios::SetKeyedServiceProvider(&keyed_service_provider);
EnsureBrowserStateKeyedServiceFactoriesBuilt();
ios::RegisterPathProvider();