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 "net/proxy/proxy_config_service_linux.h" | 5 #include "net/proxy/proxy_config_service_linux.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 std::vector<std::string> > string_lists_table; | 255 std::vector<std::string> > string_lists_table; |
256 }; | 256 }; |
257 | 257 |
258 // This helper class runs ProxyConfigServiceLinux::GetLatestProxyConfig() on | 258 // This helper class runs ProxyConfigServiceLinux::GetLatestProxyConfig() on |
259 // the IO thread and synchronously waits for the result. | 259 // the IO thread and synchronously waits for the result. |
260 // Some code duplicated from proxy_script_fetcher_unittest.cc. | 260 // Some code duplicated from proxy_script_fetcher_unittest.cc. |
261 class SynchConfigGetter { | 261 class SynchConfigGetter { |
262 public: | 262 public: |
263 // Takes ownership of |config_service|. | 263 // Takes ownership of |config_service|. |
264 explicit SynchConfigGetter(ProxyConfigServiceLinux* config_service) | 264 explicit SynchConfigGetter(ProxyConfigServiceLinux* config_service) |
265 : event_(false, false), | 265 : event_(base::WaitableEvent::ResetPolicy::AUTOMATIC, |
| 266 base::WaitableEvent::InitialState::NOT_SIGNALED), |
266 io_thread_("IO_Thread"), | 267 io_thread_("IO_Thread"), |
267 config_service_(config_service) { | 268 config_service_(config_service) { |
268 // Start an IO thread. | 269 // Start an IO thread. |
269 base::Thread::Options options; | 270 base::Thread::Options options; |
270 options.message_loop_type = base::MessageLoop::TYPE_IO; | 271 options.message_loop_type = base::MessageLoop::TYPE_IO; |
271 io_thread_.StartWithOptions(options); | 272 io_thread_.StartWithOptions(options); |
272 | 273 |
273 // Make sure the thread started. | 274 // Make sure the thread started. |
274 io_thread_.task_runner()->PostTask( | 275 io_thread_.task_runner()->PostTask( |
275 FROM_HERE, | 276 FROM_HERE, |
(...skipping 1380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1656 EXPECT_EQ(ProxyConfigService::CONFIG_VALID, | 1657 EXPECT_EQ(ProxyConfigService::CONFIG_VALID, |
1657 sync_config_getter.SyncGetLatestProxyConfig(&config)); | 1658 sync_config_getter.SyncGetLatestProxyConfig(&config)); |
1658 EXPECT_FALSE(config.auto_detect()); | 1659 EXPECT_FALSE(config.auto_detect()); |
1659 EXPECT_TRUE(slaverc5_rules.Matches(config.proxy_rules())); | 1660 EXPECT_TRUE(slaverc5_rules.Matches(config.proxy_rules())); |
1660 } | 1661 } |
1661 } | 1662 } |
1662 | 1663 |
1663 } // namespace | 1664 } // namespace |
1664 | 1665 |
1665 } // namespace net | 1666 } // namespace net |
OLD | NEW |