From 1adc137bc1bc1d8cadf5f691dc3a4da2848eb7ed Mon Sep 17 00:00:00 2001 From: aberent Date: Fri, 24 Jul 2015 05:53:54 -0700 Subject: Read Android policies early in startup The IO thread constructor reads preferences that are set from policies, so Chrome should read the policies before the IO thread constructor is called. Two parts to this: 1 - create a persistant policy cache and read it cache synchronously 2 - reorder various things so that the Android PolicyManager and PolicyProviders are created earlier in startup. Also merge (C++) PolicyProviderAndroid into PolicyManager and add Junit tests for the Java PolicyManager. TBR=nyquist BUG=510813 Review URL: https://codereview.chromium.org/1239323002 Cr-Commit-Position: refs/heads/master@{#340265} --- components/components_tests.gyp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'components/components_tests.gyp') diff --git a/components/components_tests.gyp b/components/components_tests.gyp index afa86ee..09d599f 100644 --- a/components/components_tests.gyp +++ b/components/components_tests.gyp @@ -396,6 +396,7 @@ 'password_manager/core/common/credential_manager_types_unittest.cc', ], 'policy_unittest_sources': [ + 'policy/core/browser/android/android_combined_policy_provider_unittest.cc', 'policy/core/browser/android/policy_converter_unittest.cc', 'policy/core/browser/autofill_policy_handler_unittest.cc', 'policy/core/browser/browser_policy_connector_unittest.cc', @@ -429,7 +430,6 @@ 'policy/core/common/policy_loader_mac_unittest.cc', 'policy/core/common/policy_loader_win_unittest.cc', 'policy/core/common/policy_map_unittest.cc', - 'policy/core/common/policy_provider_android_unittest.cc', 'policy/core/common/policy_service_impl_unittest.cc', 'policy/core/common/policy_statistics_collector_unittest.cc', 'policy/core/common/preg_parser_win_unittest.cc', @@ -990,6 +990,7 @@ 'conditions': [ ['OS=="android"', { 'dependencies': [ + 'components.gyp:policy_java', '../build/android/ndk.gyp:cpu_features', ], }], @@ -1556,6 +1557,25 @@ }, 'includes': [ '../build/apk_test.gypi' ], }, + { + 'target_name': 'components_junit_tests', + 'type': 'none', + 'dependencies': [ + 'components.gyp:invalidation_java', + 'components.gyp:policy_java', + '../base/base.gyp:base_java', + '../base/base.gyp:base_java_test_support', + '../testing/android/junit/junit_test.gyp:junit_test_support', + ], + 'variables': { + 'main_class': 'org.chromium.testing.local.JunitTestMain', + 'src_paths': [ + 'invalidation/impl/android/junit/', + 'policy/android/junit/' + ], + }, + 'includes': [ '../build/host_jar.gypi' ], + }, ], }], ], -- cgit v1.1