| Index: device/geolocation/fake_location_provider.cc
|
| diff --git a/device/geolocation/mock_location_provider.cc b/device/geolocation/fake_location_provider.cc
|
| similarity index 57%
|
| copy from device/geolocation/mock_location_provider.cc
|
| copy to device/geolocation/fake_location_provider.cc
|
| index 8e1f1e6bd89664aecb7edfa9af583dc7726b4b50..18e25694bbc2652acee1c95db2e9fa5cae511967 100644
|
| --- a/device/geolocation/mock_location_provider.cc
|
| +++ b/device/geolocation/fake_location_provider.cc
|
| @@ -2,10 +2,12 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -// This file implements a mock location provider and the factory functions for
|
| +// This file implements a fake location provider and the factory functions for
|
| // various ways of creating it.
|
| +// TODO(lethalantidote): Convert location_arbitrator_impl to use actual mock
|
| +// instead of FakeLocationProvider.
|
|
|
| -#include "device/geolocation/mock_location_provider.h"
|
| +#include "device/geolocation/fake_location_provider.h"
|
|
|
| #include "base/bind.h"
|
| #include "base/bind_helpers.h"
|
| @@ -17,14 +19,12 @@
|
|
|
| namespace device {
|
|
|
| -MockLocationProvider::MockLocationProvider()
|
| - : state_(STOPPED),
|
| - is_permission_granted_(false),
|
| - provider_task_runner_(base::ThreadTaskRunnerHandle::Get()) {}
|
| +FakeLocationProvider::FakeLocationProvider()
|
| + : provider_task_runner_(base::ThreadTaskRunnerHandle::Get()) {}
|
|
|
| -MockLocationProvider::~MockLocationProvider() {}
|
| +FakeLocationProvider::~FakeLocationProvider() {}
|
|
|
| -void MockLocationProvider::HandlePositionChanged(const Geoposition& position) {
|
| +void FakeLocationProvider::HandlePositionChanged(const Geoposition& position) {
|
| if (provider_task_runner_->BelongsToCurrentThread()) {
|
| // The location arbitrator unit tests rely on this method running
|
| // synchronously.
|
| @@ -32,25 +32,25 @@ void MockLocationProvider::HandlePositionChanged(const Geoposition& position) {
|
| NotifyCallback(position_);
|
| } else {
|
| provider_task_runner_->PostTask(
|
| - FROM_HERE, base::Bind(&MockLocationProvider::HandlePositionChanged,
|
| + FROM_HERE, base::Bind(&FakeLocationProvider::HandlePositionChanged,
|
| base::Unretained(this), position));
|
| }
|
| }
|
|
|
| -bool MockLocationProvider::StartProvider(bool high_accuracy) {
|
| +bool FakeLocationProvider::StartProvider(bool high_accuracy) {
|
| state_ = high_accuracy ? HIGH_ACCURACY : LOW_ACCURACY;
|
| return true;
|
| }
|
|
|
| -void MockLocationProvider::StopProvider() {
|
| +void FakeLocationProvider::StopProvider() {
|
| state_ = STOPPED;
|
| }
|
|
|
| -const Geoposition& MockLocationProvider::GetPosition() {
|
| +const Geoposition& FakeLocationProvider::GetPosition() {
|
| return position_;
|
| }
|
|
|
| -void MockLocationProvider::OnPermissionGranted() {
|
| +void FakeLocationProvider::OnPermissionGranted() {
|
| is_permission_granted_ = true;
|
| }
|
|
|
|
|