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 "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 Loading... |
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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 registry_->OnNetworkChanged(net::NetworkChangeNotifier::CONNECTION_ETHERNET); | 305 registry_->OnNetworkChanged(net::NetworkChangeNotifier::CONNECTION_ETHERNET); |
306 | 306 |
307 registry_->OnDiscoveryRequest(NULL); | 307 registry_->OnDiscoveryRequest(NULL); |
308 registry_->OnDeviceDiscovered(NULL, third_device_); | 308 registry_->OnDeviceDiscovered(NULL, third_device_); |
309 registry_->OnDiscoveryFinished(NULL); | 309 registry_->OnDiscoveryFinished(NULL); |
310 | 310 |
311 registry_->OnListenerRemoved(); | 311 registry_->OnListenerRemoved(); |
312 } | 312 } |
313 | 313 |
314 } // namespace extensions | 314 } // namespace extensions |
OLD | NEW |