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

Side by Side Diff: net/proxy/proxy_config_service_linux_unittest.cc

Issue 2053133002: Remove MessageLoop::current()->RunUntilIdle() in net. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
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 "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
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/files/file_path.h" 13 #include "base/files/file_path.h"
14 #include "base/files/file_util.h" 14 #include "base/files/file_util.h"
15 #include "base/format_macros.h" 15 #include "base/format_macros.h"
16 #include "base/location.h" 16 #include "base/location.h"
17 #include "base/logging.h" 17 #include "base/logging.h"
18 #include "base/run_loop.h"
18 #include "base/single_thread_task_runner.h" 19 #include "base/single_thread_task_runner.h"
19 #include "base/strings/string_util.h" 20 #include "base/strings/string_util.h"
20 #include "base/strings/stringprintf.h" 21 #include "base/strings/stringprintf.h"
21 #include "base/synchronization/waitable_event.h" 22 #include "base/synchronization/waitable_event.h"
22 #include "base/threading/thread.h" 23 #include "base/threading/thread.h"
23 #include "base/threading/thread_task_runner_handle.h" 24 #include "base/threading/thread_task_runner_handle.h"
24 #include "net/proxy/proxy_config.h" 25 #include "net/proxy/proxy_config.h"
25 #include "net/proxy/proxy_config_service_common_unittest.h" 26 #include "net/proxy/proxy_config_service_common_unittest.h"
26 #include "testing/gtest/include/gtest/gtest.h" 27 #include "testing/gtest/include/gtest/gtest.h"
27 #include "testing/platform_test.h" 28 #include "testing/platform_test.h"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 // Calls GetLatestProxyConfig, running on |io_thread_| Signals |event_| 319 // Calls GetLatestProxyConfig, running on |io_thread_| Signals |event_|
319 // on completion. 320 // on completion.
320 void GetLatestConfigOnIOThread() { 321 void GetLatestConfigOnIOThread() {
321 get_latest_config_result_ = 322 get_latest_config_result_ =
322 config_service_->GetLatestProxyConfig(&proxy_config_); 323 config_service_->GetLatestProxyConfig(&proxy_config_);
323 event_.Signal(); 324 event_.Signal();
324 } 325 }
325 326
326 // [Runs on |io_thread_|] Signals |event_| on cleanup completion. 327 // [Runs on |io_thread_|] Signals |event_| on cleanup completion.
327 void CleanUp() { 328 void CleanUp() {
328 base::MessageLoop::current()->RunUntilIdle(); 329 base::RunLoop().RunUntilIdle();
329 event_.Signal(); 330 event_.Signal();
330 } 331 }
331 332
332 void Wait() { 333 void Wait() {
333 event_.Wait(); 334 event_.Wait();
334 event_.Reset(); 335 event_.Reset();
335 } 336 }
336 337
337 base::WaitableEvent event_; 338 base::WaitableEvent event_;
338 base::Thread io_thread_; 339 base::Thread io_thread_;
(...skipping 1318 matching lines...) Expand 10 before | Expand all | Expand 10 after
1657 EXPECT_EQ(ProxyConfigService::CONFIG_VALID, 1658 EXPECT_EQ(ProxyConfigService::CONFIG_VALID,
1658 sync_config_getter.SyncGetLatestProxyConfig(&config)); 1659 sync_config_getter.SyncGetLatestProxyConfig(&config));
1659 EXPECT_FALSE(config.auto_detect()); 1660 EXPECT_FALSE(config.auto_detect());
1660 EXPECT_TRUE(slaverc5_rules.Matches(config.proxy_rules())); 1661 EXPECT_TRUE(slaverc5_rules.Matches(config.proxy_rules()));
1661 } 1662 }
1662 } 1663 }
1663 1664
1664 } // namespace 1665 } // namespace
1665 1666
1666 } // namespace net 1667 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/network_delegate_error_observer_unittest.cc ('k') | net/proxy/proxy_script_decider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698