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 "content/browser/geolocation/location_arbitrator_impl.h" | 5 #include "device/geolocation/location_arbitrator_impl.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
11 #include "content/browser/geolocation/fake_access_token_store.h" | 11 #include "device/geolocation/fake_access_token_store.h" |
12 #include "content/browser/geolocation/mock_location_provider.h" | 12 #include "device/geolocation/geolocation_delegate.h" |
13 #include "content/public/browser/geolocation_delegate.h" | 13 #include "device/geolocation/geoposition.h" |
14 #include "content/public/common/geoposition.h" | 14 #include "device/geolocation/mock_location_provider.h" |
15 #include "content/test/test_content_browser_client.h" | |
16 #include "testing/gmock/include/gmock/gmock.h" | 15 #include "testing/gmock/include/gmock/gmock.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
18 | 17 |
19 using ::testing::NiceMock; | 18 using ::testing::NiceMock; |
20 | 19 |
21 namespace content { | 20 namespace device { |
22 | 21 |
23 class MockLocationObserver { | 22 class MockLocationObserver { |
24 public: | 23 public: |
25 // Need a vtable for GMock. | 24 // Need a vtable for GMock. |
26 virtual ~MockLocationObserver() {} | 25 virtual ~MockLocationObserver() {} |
27 void InvalidateLastPosition() { | 26 void InvalidateLastPosition() { |
28 last_position_.latitude = 100; | 27 last_position_.latitude = 100; |
29 last_position_.error_code = Geoposition::ERROR_CODE_NONE; | 28 last_position_.error_code = Geoposition::ERROR_CODE_NONE; |
30 ASSERT_FALSE(last_position_.Validate()); | 29 ASSERT_FALSE(last_position_.Validate()); |
31 } | 30 } |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 access_token_store_->NotifyDelegateTokensLoaded(); | 432 access_token_store_->NotifyDelegateTokensLoaded(); |
434 | 433 |
435 // Advance the time a short while to simulate successive calls. | 434 // Advance the time a short while to simulate successive calls. |
436 AdvanceTimeNow(base::TimeDelta::FromMilliseconds(5)); | 435 AdvanceTimeNow(base::TimeDelta::FromMilliseconds(5)); |
437 | 436 |
438 // Update with a less accurate position to verify 240956. | 437 // Update with a less accurate position to verify 240956. |
439 SetPositionFix(cell(), 3, 139, 150); | 438 SetPositionFix(cell(), 3, 139, 150); |
440 CheckLastPositionInfo(3, 139, 150); | 439 CheckLastPositionInfo(3, 139, 150); |
441 } | 440 } |
442 | 441 |
443 } // namespace content | 442 } // namespace device |
OLD | NEW |