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

Side by Side Diff: chrome/browser/policy/policy_browsertest.cc

Issue 2675903002: Revert of Update component updater URLs. (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | components/component_updater/component_updater_url_constants.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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"
44 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 43 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
45 #include "chrome/browser/devtools/devtools_window_testing.h" 44 #include "chrome/browser/devtools/devtools_window_testing.h"
46 #include "chrome/browser/download/download_prefs.h" 45 #include "chrome/browser/download/download_prefs.h"
47 #include "chrome/browser/extensions/api/messaging/message_service.h" 46 #include "chrome/browser/extensions/api/messaging/message_service.h"
48 #include "chrome/browser/extensions/crx_installer.h" 47 #include "chrome/browser/extensions/crx_installer.h"
49 #include "chrome/browser/extensions/extension_management_constants.h" 48 #include "chrome/browser/extensions/extension_management_constants.h"
50 #include "chrome/browser/extensions/extension_management_test_util.h" 49 #include "chrome/browser/extensions/extension_management_test_util.h"
51 #include "chrome/browser/extensions/extension_service.h" 50 #include "chrome/browser/extensions/extension_service.h"
52 #include "chrome/browser/extensions/shared_module_service.h" 51 #include "chrome/browser/extensions/shared_module_service.h"
53 #include "chrome/browser/extensions/unpacked_installer.h" 52 #include "chrome/browser/extensions/unpacked_installer.h"
(...skipping 3715 matching lines...) Expand 10 before | Expand all | Expand 10 after
3769 base::Bind(action, base::Unretained(this))); 3768 base::Bind(action, base::Unretained(this)));
3770 } 3769 }
3771 3770
3772 void ComponentUpdaterPolicyTest::OnDemandComplete(update_client::Error error) { 3771 void ComponentUpdaterPolicyTest::OnDemandComplete(update_client::Error error) {
3773 CallAsync(cur_test_case_.second); 3772 CallAsync(cur_test_case_.second);
3774 } 3773 }
3775 3774
3776 void ComponentUpdaterPolicyTest::BeginTest() { 3775 void ComponentUpdaterPolicyTest::BeginTest() {
3777 cus_ = g_browser_process->component_updater(); 3776 cus_ = g_browser_process->component_updater();
3778 3777
3779 const auto config = component_updater::MakeChromeComponentUpdaterConfigurator(
3780 base::CommandLine::ForCurrentProcess(), nullptr,
3781 g_browser_process->local_state());
3782 const auto urls = config->UpdateUrl();
3783 ASSERT_TRUE(urls.size());
3784 const GURL url = urls.front();
3785
3786 interceptor_factory_ = 3778 interceptor_factory_ =
3787 base::MakeUnique<update_client::URLRequestPostInterceptorFactory>( 3779 base::MakeUnique<update_client::URLRequestPostInterceptorFactory>(
3788 url.scheme(), url.host(), 3780 "https", "clients2.google.com",
3789 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); 3781 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
3790 3782
3791 post_interceptor_ = interceptor_factory_->CreateInterceptor( 3783 post_interceptor_ = interceptor_factory_->CreateInterceptor(
3792 base::FilePath(FILE_PATH_LITERAL("service/update2"))); 3784 base::FilePath(FILE_PATH_LITERAL("service/update2")));
3793 3785
3794 cur_test_case_ = std::make_pair( 3786 cur_test_case_ = std::make_pair(
3795 &ComponentUpdaterPolicyTest::DefaultPolicy_GroupPolicySupported, 3787 &ComponentUpdaterPolicyTest::DefaultPolicy_GroupPolicySupported,
3796 &ComponentUpdaterPolicyTest::FinishDefaultPolicy_GroupPolicySupported); 3788 &ComponentUpdaterPolicyTest::FinishDefaultPolicy_GroupPolicySupported);
3797 3789
3798 CallAsync(cur_test_case_.first); 3790 CallAsync(cur_test_case_.first);
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
4328 4320
4329 SetEmptyPolicy(); 4321 SetEmptyPolicy();
4330 // Policy not set. 4322 // Policy not set.
4331 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); 4323 CheckSystemTimezoneAutomaticDetectionPolicyUnset();
4332 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); 4324 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false));
4333 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); 4325 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests());
4334 } 4326 }
4335 #endif // defined(OS_CHROMEOS) 4327 #endif // defined(OS_CHROMEOS)
4336 4328
4337 } // namespace policy 4329 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | components/component_updater/component_updater_url_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698