| 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/location_arbitrator.h" | |
| 6 | |
| 7 #include "base/scoped_ptr.h" | 5 #include "base/scoped_ptr.h" |
| 8 #include "chrome/browser/geolocation/arbitrator_dependency_factory.h" | |
| 9 #include "chrome/browser/geolocation/fake_access_token_store.h" | |
| 10 #include "chrome/browser/geolocation/geolocation_observer.h" | |
| 11 #include "chrome/browser/geolocation/location_provider.h" | |
| 12 #include "chrome/browser/geolocation/mock_location_provider.h" | |
| 13 #include "chrome/common/geoposition.h" | 6 #include "chrome/common/geoposition.h" |
| 7 #include "content/browser/geolocation/arbitrator_dependency_factory.h" |
| 8 #include "content/browser/geolocation/fake_access_token_store.h" |
| 9 #include "content/browser/geolocation/geolocation_observer.h" |
| 10 #include "content/browser/geolocation/location_arbitrator.h" |
| 11 #include "content/browser/geolocation/location_provider.h" |
| 12 #include "content/browser/geolocation/mock_location_provider.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 14 |
| 16 namespace { | 15 namespace { |
| 17 | 16 |
| 18 class MockLocationObserver : public GeolocationObserver { | 17 class MockLocationObserver : public GeolocationObserver { |
| 19 public: | 18 public: |
| 20 void InvalidateLastPosition() { | 19 void InvalidateLastPosition() { |
| 21 last_position_.latitude = 100; | 20 last_position_.latitude = 100; |
| 22 last_position_.error_code = Geoposition::ERROR_CODE_NONE; | 21 last_position_.error_code = Geoposition::ERROR_CODE_NONE; |
| 23 ASSERT_FALSE(last_position_.IsInitialized()); | 22 ASSERT_FALSE(last_position_.IsInitialized()); |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 CheckLastPositionInfo(3.5657104, 139.690341, 300); | 293 CheckLastPositionInfo(3.5657104, 139.690341, 300); |
| 295 | 294 |
| 296 // 2 minutes later | 295 // 2 minutes later |
| 297 AdvanceTimeNow(base::TimeDelta::FromMinutes(2)); | 296 AdvanceTimeNow(base::TimeDelta::FromMinutes(2)); |
| 298 // Arrive in station. Cell moves but GPS is stale. Switch to fresher cell. | 297 // Arrive in station. Cell moves but GPS is stale. Switch to fresher cell. |
| 299 SetPositionFix(cell(), 3.5658700, 139.069979, 1000); | 298 SetPositionFix(cell(), 3.5658700, 139.069979, 1000); |
| 300 CheckLastPositionInfo(3.5658700, 139.069979, 1000); | 299 CheckLastPositionInfo(3.5658700, 139.069979, 1000); |
| 301 } | 300 } |
| 302 | 301 |
| 303 } // namespace | 302 } // namespace |
| OLD | NEW |