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

Side by Side Diff: net/android/network_change_notifier_android_unittest.cc

Issue 1398973003: Don't use base::MessageLoop::{Quit,QuitClosure} in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « no previous file | net/base/file_stream_unittest.cc » ('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 // See network_change_notifier_android.h for design explanations. 5 // See network_change_notifier_android.h for design explanations.
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 class DNSChangeObserver : public NetworkChangeNotifier::DNSObserver { 88 class DNSChangeObserver : public NetworkChangeNotifier::DNSObserver {
89 public: 89 public:
90 DNSChangeObserver() 90 DNSChangeObserver()
91 : change_notifications_count_(0), initial_notifications_count_(0) {} 91 : change_notifications_count_(0), initial_notifications_count_(0) {}
92 92
93 // NetworkChangeNotifier::DNSObserver: 93 // NetworkChangeNotifier::DNSObserver:
94 void OnDNSChanged() override { change_notifications_count_++; } 94 void OnDNSChanged() override { change_notifications_count_++; }
95 95
96 void OnInitialDNSConfigRead() override { 96 void OnInitialDNSConfigRead() override {
97 initial_notifications_count_++; 97 initial_notifications_count_++;
98 base::MessageLoop::current()->Quit(); 98 base::MessageLoop::current()->QuitWhenIdle();
99 } 99 }
100 100
101 int change_notifications_count() const { return change_notifications_count_; } 101 int change_notifications_count() const { return change_notifications_count_; }
102 102
103 int initial_notifications_count() const { 103 int initial_notifications_count() const {
104 return initial_notifications_count_; 104 return initial_notifications_count_;
105 } 105 }
106 106
107 private: 107 private:
108 int change_notifications_count_; 108 int change_notifications_count_;
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 NetworkChangeNotifier::GetConnectedNetworks(&network_list); 475 NetworkChangeNotifier::GetConnectedNetworks(&network_list);
476 EXPECT_EQ(1u, network_list.size()); 476 EXPECT_EQ(1u, network_list.size());
477 EXPECT_EQ(100, network_list[0]); 477 EXPECT_EQ(100, network_list[0]);
478 EXPECT_EQ(NetworkChangeNotifier::kInvalidNetworkHandle, 478 EXPECT_EQ(NetworkChangeNotifier::kInvalidNetworkHandle,
479 NetworkChangeNotifier::GetDefaultNetwork()); 479 NetworkChangeNotifier::GetDefaultNetwork());
480 480
481 NetworkChangeNotifier::RemoveNetworkObserver(&network_observer); 481 NetworkChangeNotifier::RemoveNetworkObserver(&network_observer);
482 } 482 }
483 483
484 } // namespace net 484 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/base/file_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698