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

Side by Side Diff: chrome/browser/extensions/api/dial/dial_registry_unittest.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 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 | Annotate | Revision Log
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 "base/compiler_specific.h" 5 #include "base/compiler_specific.h"
6 #include "base/message_loop.h" 6 #include "base/message_loop.h"
7 #include "chrome/browser/extensions/api/dial/dial_device_data.h" 7 #include "chrome/browser/extensions/api/dial/dial_device_data.h"
8 #include "chrome/browser/extensions/api/dial/dial_registry.h" 8 #include "chrome/browser/extensions/api/dial/dial_registry.h"
9 #include "chrome/browser/extensions/api/dial/dial_service.h" 9 #include "chrome/browser/extensions/api/dial/dial_service.h"
10 #include "chrome/test/base/testing_profile.h" 10 #include "chrome/test/base/testing_profile.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 const DialDeviceData first_device_; 101 const DialDeviceData first_device_;
102 const DialDeviceData second_device_; 102 const DialDeviceData second_device_;
103 const DialDeviceData third_device_; 103 const DialDeviceData third_device_;
104 104
105 const DialRegistry::DeviceList empty_list_; 105 const DialRegistry::DeviceList empty_list_;
106 DialRegistry::DeviceList list_with_first_device_; 106 DialRegistry::DeviceList list_with_first_device_;
107 DialRegistry::DeviceList list_with_second_device_; 107 DialRegistry::DeviceList list_with_second_device_;
108 108
109 // Must instantiate a MessageLoop for the thread, as the registry starts a 109 // Must instantiate a MessageLoop for the thread, as the registry starts a
110 // RepeatingTimer when there are listeners. 110 // RepeatingTimer when there are listeners.
111 MessageLoop message_loop_; 111 base::MessageLoop message_loop_;
112 112
113 void SetListenerExpectations() { 113 void SetListenerExpectations() {
114 EXPECT_CALL(registry_->mock_service(), 114 EXPECT_CALL(registry_->mock_service(),
115 AddObserver(A<DialService::Observer*>())) 115 AddObserver(A<DialService::Observer*>()))
116 .Times(1); 116 .Times(1);
117 EXPECT_CALL(registry_->mock_service(), 117 EXPECT_CALL(registry_->mock_service(),
118 RemoveObserver(A<DialService::Observer*>())) 118 RemoveObserver(A<DialService::Observer*>()))
119 .Times(1); 119 .Times(1);
120 } 120 }
121 }; 121 };
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 registry_->OnNetworkChanged(net::NetworkChangeNotifier::CONNECTION_ETHERNET); 356 registry_->OnNetworkChanged(net::NetworkChangeNotifier::CONNECTION_ETHERNET);
357 357
358 registry_->OnDiscoveryRequest(NULL); 358 registry_->OnDiscoveryRequest(NULL);
359 registry_->OnDeviceDiscovered(NULL, third_device_); 359 registry_->OnDeviceDiscovered(NULL, third_device_);
360 registry_->OnDiscoveryFinished(NULL); 360 registry_->OnDiscoveryFinished(NULL);
361 361
362 registry_->OnListenerRemoved(); 362 registry_->OnListenerRemoved();
363 } 363 }
364 364
365 } // namespace extensions 365 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698