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

Side by Side Diff: components/proxy_config/pref_proxy_config_tracker_impl_unittest.cc

Issue 2444753002: Reduce usage of FOR_EACH_OBSERVER macro in components/ (Closed)
Patch Set: Created 4 years, 2 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/proxy_config/pref_proxy_config_tracker_impl.cc ('k') | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/proxy_config/pref_proxy_config_tracker_impl.h" 5 #include "components/proxy_config/pref_proxy_config_tracker_impl.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 22 matching lines...) Expand all
33 public: 33 public:
34 TestProxyConfigService(const net::ProxyConfig& config, 34 TestProxyConfigService(const net::ProxyConfig& config,
35 ConfigAvailability availability) 35 ConfigAvailability availability)
36 : config_(config), 36 : config_(config),
37 availability_(availability) {} 37 availability_(availability) {}
38 38
39 void SetProxyConfig(const net::ProxyConfig config, 39 void SetProxyConfig(const net::ProxyConfig config,
40 ConfigAvailability availability) { 40 ConfigAvailability availability) {
41 config_ = config; 41 config_ = config;
42 availability_ = availability; 42 availability_ = availability;
43 FOR_EACH_OBSERVER(net::ProxyConfigService::Observer, observers_, 43 for (net::ProxyConfigService::Observer& observer : observers_)
44 OnProxyConfigChanged(config, availability)); 44 observer.OnProxyConfigChanged(config, availability);
45 } 45 }
46 46
47 private: 47 private:
48 void AddObserver(net::ProxyConfigService::Observer* observer) override { 48 void AddObserver(net::ProxyConfigService::Observer* observer) override {
49 observers_.AddObserver(observer); 49 observers_.AddObserver(observer);
50 } 50 }
51 51
52 void RemoveObserver(net::ProxyConfigService::Observer* observer) override { 52 void RemoveObserver(net::ProxyConfigService::Observer* observer) override {
53 observers_.RemoveObserver(observer); 53 observers_.RemoveObserver(observer);
54 } 54 }
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 base::RunLoop().RunUntilIdle(); 264 base::RunLoop().RunUntilIdle();
265 265
266 // Test if we actually use the system setting, which is |kFixedPacUrl|. 266 // Test if we actually use the system setting, which is |kFixedPacUrl|.
267 net::ProxyConfig actual_config; 267 net::ProxyConfig actual_config;
268 EXPECT_EQ(net::ProxyConfigService::CONFIG_VALID, 268 EXPECT_EQ(net::ProxyConfigService::CONFIG_VALID,
269 proxy_config_service_->GetLatestProxyConfig(&actual_config)); 269 proxy_config_service_->GetLatestProxyConfig(&actual_config));
270 EXPECT_EQ(GURL(kFixedPacUrl), actual_config.pac_url()); 270 EXPECT_EQ(GURL(kFixedPacUrl), actual_config.pac_url());
271 } 271 }
272 272
273 } // namespace 273 } // namespace
OLDNEW
« no previous file with comments | « components/proxy_config/pref_proxy_config_tracker_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698