OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" | 9 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 return new_wlan_api_.release(); | 90 return new_wlan_api_.release(); |
91 } | 91 } |
92 virtual PollingPolicyInterface* NewPollingPolicy() { | 92 virtual PollingPolicyInterface* NewPollingPolicy() { |
93 CHECK(new_polling_policy_ != NULL); | 93 CHECK(new_polling_policy_ != NULL); |
94 return new_polling_policy_.release(); | 94 return new_polling_policy_.release(); |
95 } | 95 } |
96 | 96 |
97 scoped_ptr<MockWlanApi> new_wlan_api_; | 97 scoped_ptr<MockWlanApi> new_wlan_api_; |
98 scoped_ptr<MockPollingPolicy> new_polling_policy_; | 98 scoped_ptr<MockPollingPolicy> new_polling_policy_; |
99 | 99 |
| 100 private: |
| 101 virtual ~WifiDataProviderCommonWithMock() {} |
| 102 |
100 DISALLOW_COPY_AND_ASSIGN(WifiDataProviderCommonWithMock); | 103 DISALLOW_COPY_AND_ASSIGN(WifiDataProviderCommonWithMock); |
101 }; | 104 }; |
102 | 105 |
103 WifiDataProviderImplBase* CreateWifiDataProviderCommonWithMock() { | 106 WifiDataProviderImplBase* CreateWifiDataProviderCommonWithMock() { |
104 return new WifiDataProviderCommonWithMock; | 107 return new WifiDataProviderCommonWithMock; |
105 } | 108 } |
106 | 109 |
107 // Main test fixture | 110 // Main test fixture |
108 class GeolocationWifiDataProviderCommonTest : public testing::Test { | 111 class GeolocationWifiDataProviderCommonTest : public testing::Test { |
109 public: | 112 public: |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 MessageLoopQuitListener quit_listener(&main_message_loop_); | 225 MessageLoopQuitListener quit_listener(&main_message_loop_); |
223 WifiDataProvider::SetFactory(CreateWifiDataProviderCommonWithMock); | 226 WifiDataProvider::SetFactory(CreateWifiDataProviderCommonWithMock); |
224 DeviceDataProvider<WifiData>::Register(&quit_listener); | 227 DeviceDataProvider<WifiData>::Register(&quit_listener); |
225 main_message_loop_.Run(); | 228 main_message_loop_.Run(); |
226 DeviceDataProvider<WifiData>::Unregister(&quit_listener); | 229 DeviceDataProvider<WifiData>::Unregister(&quit_listener); |
227 DeviceDataProvider<WifiData>::ResetFactory(); | 230 DeviceDataProvider<WifiData>::ResetFactory(); |
228 } | 231 } |
229 | 232 |
230 } // namespace | 233 } // namespace |
231 | 234 |
OLD | NEW |