| Index: content/browser/geolocation/network_location_provider_unittest.cc
|
| diff --git a/content/browser/geolocation/network_location_provider_unittest.cc b/content/browser/geolocation/network_location_provider_unittest.cc
|
| index 63de4cab78050097074586ce5fdf574e65dc5180..49f2671539ca59bf9d8d1ed8fca42b8aeb7d1e54 100644
|
| --- a/content/browser/geolocation/network_location_provider_unittest.cc
|
| +++ b/content/browser/geolocation/network_location_provider_unittest.cc
|
| @@ -58,29 +58,27 @@ class MessageLoopQuitListener
|
|
|
| // A mock implementation of DeviceDataProviderImplBase for testing. Adapted from
|
| // http://gears.googlecode.com/svn/trunk/gears/geolocation/geolocation_test.cc
|
| -template<typename DataType>
|
| -class MockDeviceDataProviderImpl
|
| - : public DeviceDataProviderImplBase<DataType> {
|
| +class MockWifiDataProviderImpl : public WifiDataProviderImplBase {
|
| public:
|
| // Factory method for use with DeviceDataProvider::SetFactory.
|
| - static DeviceDataProviderImplBase<DataType>* GetInstance() {
|
| + static WifiDataProviderImplBase* GetInstance() {
|
| CHECK(instance_);
|
| return instance_;
|
| }
|
|
|
| - static MockDeviceDataProviderImpl<DataType>* CreateInstance() {
|
| + static MockWifiDataProviderImpl* CreateInstance() {
|
| CHECK(!instance_);
|
| - instance_ = new MockDeviceDataProviderImpl<DataType>;
|
| + instance_ = new MockWifiDataProviderImpl;
|
| return instance_;
|
| }
|
|
|
| - MockDeviceDataProviderImpl()
|
| + MockWifiDataProviderImpl()
|
| : start_calls_(0),
|
| stop_calls_(0),
|
| got_data_(true) {
|
| }
|
|
|
| - virtual ~MockDeviceDataProviderImpl() {
|
| + virtual ~MockWifiDataProviderImpl() {
|
| CHECK(this == instance_);
|
| instance_ = NULL;
|
| }
|
| @@ -93,13 +91,13 @@ class MockDeviceDataProviderImpl
|
| virtual void StopDataProvider() {
|
| ++stop_calls_;
|
| }
|
| - virtual bool GetData(DataType* data_out) {
|
| + virtual bool GetData(WifiData* data_out) {
|
| CHECK(data_out);
|
| *data_out = data_;
|
| return got_data_;
|
| }
|
|
|
| - void SetData(const DataType& new_data) {
|
| + void SetData(const WifiData& new_data) {
|
| got_data_ = true;
|
| const bool differs = data_.DiffersSignificantly(new_data);
|
| data_ = new_data;
|
| @@ -112,25 +110,22 @@ class MockDeviceDataProviderImpl
|
| int stop_calls_;
|
|
|
| private:
|
| - static MockDeviceDataProviderImpl<DataType>* instance_;
|
| + static MockWifiDataProviderImpl* instance_;
|
|
|
| - DataType data_;
|
| + WifiData data_;
|
| bool got_data_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(MockDeviceDataProviderImpl);
|
| + DISALLOW_COPY_AND_ASSIGN(MockWifiDataProviderImpl);
|
| };
|
|
|
| -template<typename DataType>
|
| -MockDeviceDataProviderImpl<DataType>*
|
| -MockDeviceDataProviderImpl<DataType>::instance_ = NULL;
|
| +MockWifiDataProviderImpl* MockWifiDataProviderImpl::instance_ = NULL;
|
|
|
| // Main test fixture
|
| class GeolocationNetworkProviderTest : public testing::Test {
|
| public:
|
| virtual void SetUp() {
|
| access_token_store_ = new FakeAccessTokenStore;
|
| - wifi_data_provider_ =
|
| - MockDeviceDataProviderImpl<WifiData>::CreateInstance();
|
| + wifi_data_provider_ = MockWifiDataProviderImpl::CreateInstance();
|
| }
|
|
|
| virtual void TearDown() {
|
| @@ -152,8 +147,7 @@ class GeolocationNetworkProviderTest : public testing::Test {
|
| GeolocationNetworkProviderTest() : test_server_url_(kTestServerUrl) {
|
| // TODO(joth): Really these should be in SetUp, not here, but they take no
|
| // effect on Mac OS Release builds if done there. I kid not. Figure out why.
|
| - WifiDataProvider::SetFactory(
|
| - MockDeviceDataProviderImpl<WifiData>::GetInstance);
|
| + WifiDataProvider::SetFactory(MockWifiDataProviderImpl::GetInstance);
|
| }
|
|
|
| // Returns the current url fetcher (if any) and advances the id ready for the
|
| @@ -268,7 +262,7 @@ class GeolocationNetworkProviderTest : public testing::Test {
|
| MessageLoop main_message_loop_;
|
| scoped_refptr<FakeAccessTokenStore> access_token_store_;
|
| TestURLFetcherFactory url_fetcher_factory_;
|
| - scoped_refptr<MockDeviceDataProviderImpl<WifiData> > wifi_data_provider_;
|
| + scoped_refptr<MockWifiDataProviderImpl> wifi_data_provider_;
|
| };
|
|
|
|
|
|
|