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

Side by Side Diff: components/update_client/test_configurator.cc

Issue 1740333002: Allow fallback from https to http for component update checks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « components/update_client/test_configurator.h ('k') | components/update_client/update_checker.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/update_client/test_configurator.h" 5 #include "components/update_client/test_configurator.h"
6 6
7 #include "base/version.h" 7 #include "base/version.h"
8 #include "components/update_client/component_patcher_operation.h" 8 #include "components/update_client/component_patcher_operation.h"
9 #include "url/gurl.h" 9 #include "url/gurl.h"
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 int TestConfigurator::OnDemandDelay() const { 49 int TestConfigurator::OnDemandDelay() const {
50 return ondemand_time_; 50 return ondemand_time_;
51 } 51 }
52 52
53 int TestConfigurator::UpdateDelay() const { 53 int TestConfigurator::UpdateDelay() const {
54 return 1; 54 return 1;
55 } 55 }
56 56
57 std::vector<GURL> TestConfigurator::UpdateUrl() const { 57 std::vector<GURL> TestConfigurator::UpdateUrl() const {
58 if (!update_check_url_.is_empty())
59 return std::vector<GURL>(1, update_check_url_);
60
58 return MakeDefaultUrls(); 61 return MakeDefaultUrls();
59 } 62 }
60 63
61 std::vector<GURL> TestConfigurator::PingUrl() const { 64 std::vector<GURL> TestConfigurator::PingUrl() const {
65 if (!ping_url_.is_empty())
66 return std::vector<GURL>(1, ping_url_);
67
62 return UpdateUrl(); 68 return UpdateUrl();
63 } 69 }
64 70
65 base::Version TestConfigurator::GetBrowserVersion() const { 71 base::Version TestConfigurator::GetBrowserVersion() const {
66 // Needs to be larger than the required version in tested component manifests. 72 // Needs to be larger than the required version in tested component manifests.
67 return base::Version("30.0"); 73 return base::Version("30.0");
68 } 74 }
69 75
70 std::string TestConfigurator::GetChannel() const { 76 std::string TestConfigurator::GetChannel() const {
71 return "fake_channel_string"; 77 return "fake_channel_string";
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 132
127 void TestConfigurator::SetUseCupSigning(bool use_cup_signing) { 133 void TestConfigurator::SetUseCupSigning(bool use_cup_signing) {
128 use_cup_signing_ = use_cup_signing; 134 use_cup_signing_ = use_cup_signing;
129 } 135 }
130 136
131 void TestConfigurator::SetDownloadPreference( 137 void TestConfigurator::SetDownloadPreference(
132 const std::string& download_preference) { 138 const std::string& download_preference) {
133 download_preference_ = download_preference; 139 download_preference_ = download_preference;
134 } 140 }
135 141
142 void TestConfigurator::SetUpdateCheckUrl(const GURL& url) {
143 update_check_url_ = url;
144 }
145
146 void TestConfigurator::SetPingUrl(const GURL& url) {
147 ping_url_ = url;
148 }
149
136 scoped_refptr<base::SequencedTaskRunner> 150 scoped_refptr<base::SequencedTaskRunner>
137 TestConfigurator::GetSequencedTaskRunner() const { 151 TestConfigurator::GetSequencedTaskRunner() const {
138 DCHECK(worker_task_runner_.get()); 152 DCHECK(worker_task_runner_.get());
139 return worker_task_runner_; 153 return worker_task_runner_;
140 } 154 }
141 155
142 } // namespace update_client 156 } // namespace update_client
OLDNEW
« no previous file with comments | « components/update_client/test_configurator.h ('k') | components/update_client/update_checker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698