| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/geolocation/wifi_data_provider_common.h" | 5 #include "chrome/browser/geolocation/wifi_data_provider_common.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/dynamic_annotations.h" | |
| 10 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
| 11 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 11 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 class MockWlanApi : public WifiDataProviderCommon::WlanApiInterface { | 14 class MockWlanApi : public WifiDataProviderCommon::WlanApiInterface { |
| 15 public: | 15 public: |
| 16 MockWlanApi() : calls_(0), bool_return_(true) { | 16 MockWlanApi() : calls_(0), bool_return_(true) { |
| 17 ANNOTATE_BENIGN_RACE(&calls_, "This is a test-only data race on a counter"); | 17 ANNOTATE_BENIGN_RACE(&calls_, "This is a test-only data race on a counter"); |
| 18 } | 18 } |
| 19 virtual bool GetAccessPointData(WifiData::AccessPointDataSet* data) { | 19 virtual bool GetAccessPointData(WifiData::AccessPointDataSet* data) { |
| 20 ++calls_; | 20 ++calls_; |
| 21 *data = data_out_; | 21 *data = data_out_; |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 138 |
| 139 TEST_F(GeolocationWifiDataProviderCommonTest, | 139 TEST_F(GeolocationWifiDataProviderCommonTest, |
| 140 StartThreadViaDeviceDataProvider) { | 140 StartThreadViaDeviceDataProvider) { |
| 141 MessageLoopQuitListener quit_listener(&main_message_loop_); | 141 MessageLoopQuitListener quit_listener(&main_message_loop_); |
| 142 WifiDataProvider::SetFactory(CreateWifiDataProviderCommonWithMock); | 142 WifiDataProvider::SetFactory(CreateWifiDataProviderCommonWithMock); |
| 143 DeviceDataProvider<WifiData>::Register(&quit_listener); | 143 DeviceDataProvider<WifiData>::Register(&quit_listener); |
| 144 main_message_loop_.Run(); | 144 main_message_loop_.Run(); |
| 145 DeviceDataProvider<WifiData>::Unregister(&quit_listener); | 145 DeviceDataProvider<WifiData>::Unregister(&quit_listener); |
| 146 DeviceDataProvider<WifiData>::ResetFactory(); | 146 DeviceDataProvider<WifiData>::ResetFactory(); |
| 147 } | 147 } |
| OLD | NEW |