| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #include "base/strings/utf_string_conversions.h" | 33 #include "base/strings/utf_string_conversions.h" |
| 34 #include "base/test/test_file_util.h" | 34 #include "base/test/test_file_util.h" |
| 35 #include "base/threading/sequenced_worker_pool.h" | 35 #include "base/threading/sequenced_worker_pool.h" |
| 36 #include "base/time/time.h" | 36 #include "base/time/time.h" |
| 37 #include "base/values.h" | 37 #include "base/values.h" |
| 38 #include "build/build_config.h" | 38 #include "build/build_config.h" |
| 39 #include "chrome/app/chrome_command_ids.h" | 39 #include "chrome/app/chrome_command_ids.h" |
| 40 #include "chrome/browser/background/background_contents_service.h" | 40 #include "chrome/browser/background/background_contents_service.h" |
| 41 #include "chrome/browser/browser_process.h" | 41 #include "chrome/browser/browser_process.h" |
| 42 #include "chrome/browser/chrome_notification_types.h" | 42 #include "chrome/browser/chrome_notification_types.h" |
| 43 #include "chrome/browser/component_updater/chrome_component_updater_configurator
.h" |
| 43 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 44 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 44 #include "chrome/browser/devtools/devtools_window_testing.h" | 45 #include "chrome/browser/devtools/devtools_window_testing.h" |
| 45 #include "chrome/browser/download/download_prefs.h" | 46 #include "chrome/browser/download/download_prefs.h" |
| 46 #include "chrome/browser/extensions/api/messaging/message_service.h" | 47 #include "chrome/browser/extensions/api/messaging/message_service.h" |
| 47 #include "chrome/browser/extensions/crx_installer.h" | 48 #include "chrome/browser/extensions/crx_installer.h" |
| 48 #include "chrome/browser/extensions/extension_management_constants.h" | 49 #include "chrome/browser/extensions/extension_management_constants.h" |
| 49 #include "chrome/browser/extensions/extension_management_test_util.h" | 50 #include "chrome/browser/extensions/extension_management_test_util.h" |
| 50 #include "chrome/browser/extensions/extension_service.h" | 51 #include "chrome/browser/extensions/extension_service.h" |
| 51 #include "chrome/browser/extensions/shared_module_service.h" | 52 #include "chrome/browser/extensions/shared_module_service.h" |
| 52 #include "chrome/browser/extensions/unpacked_installer.h" | 53 #include "chrome/browser/extensions/unpacked_installer.h" |
| (...skipping 3768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3821 base::Bind(action, base::Unretained(this))); | 3822 base::Bind(action, base::Unretained(this))); |
| 3822 } | 3823 } |
| 3823 | 3824 |
| 3824 void ComponentUpdaterPolicyTest::OnDemandComplete(update_client::Error error) { | 3825 void ComponentUpdaterPolicyTest::OnDemandComplete(update_client::Error error) { |
| 3825 CallAsync(cur_test_case_.second); | 3826 CallAsync(cur_test_case_.second); |
| 3826 } | 3827 } |
| 3827 | 3828 |
| 3828 void ComponentUpdaterPolicyTest::BeginTest() { | 3829 void ComponentUpdaterPolicyTest::BeginTest() { |
| 3829 cus_ = g_browser_process->component_updater(); | 3830 cus_ = g_browser_process->component_updater(); |
| 3830 | 3831 |
| 3832 const auto config = component_updater::MakeChromeComponentUpdaterConfigurator( |
| 3833 base::CommandLine::ForCurrentProcess(), nullptr, |
| 3834 g_browser_process->local_state()); |
| 3835 const auto urls = config->UpdateUrl(); |
| 3836 ASSERT_TRUE(urls.size()); |
| 3837 const GURL url = urls.front(); |
| 3838 |
| 3831 interceptor_factory_ = | 3839 interceptor_factory_ = |
| 3832 base::MakeUnique<update_client::URLRequestPostInterceptorFactory>( | 3840 base::MakeUnique<update_client::URLRequestPostInterceptorFactory>( |
| 3833 "https", "clients2.google.com", | 3841 url.scheme(), url.host(), |
| 3834 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); | 3842 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
| 3835 | 3843 |
| 3836 post_interceptor_ = interceptor_factory_->CreateInterceptor( | 3844 post_interceptor_ = interceptor_factory_->CreateInterceptor( |
| 3837 base::FilePath(FILE_PATH_LITERAL("service/update2"))); | 3845 base::FilePath(FILE_PATH_LITERAL("service/update2"))); |
| 3838 | 3846 |
| 3839 cur_test_case_ = std::make_pair( | 3847 cur_test_case_ = std::make_pair( |
| 3840 &ComponentUpdaterPolicyTest::DefaultPolicy_GroupPolicySupported, | 3848 &ComponentUpdaterPolicyTest::DefaultPolicy_GroupPolicySupported, |
| 3841 &ComponentUpdaterPolicyTest::FinishDefaultPolicy_GroupPolicySupported); | 3849 &ComponentUpdaterPolicyTest::FinishDefaultPolicy_GroupPolicySupported); |
| 3842 | 3850 |
| 3843 CallAsync(cur_test_case_.first); | 3851 CallAsync(cur_test_case_.first); |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4380 | 4388 |
| 4381 SetEmptyPolicy(); | 4389 SetEmptyPolicy(); |
| 4382 // Policy not set. | 4390 // Policy not set. |
| 4383 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); | 4391 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); |
| 4384 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); | 4392 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); |
| 4385 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); | 4393 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); |
| 4386 } | 4394 } |
| 4387 #endif // defined(OS_CHROMEOS) | 4395 #endif // defined(OS_CHROMEOS) |
| 4388 | 4396 |
| 4389 } // namespace policy | 4397 } // namespace policy |
| OLD | NEW |