Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: content/test/mock_geolocation.cc

Issue 10070012: Geolocation support for chromedriver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/test/mock_geolocation.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/mock_geolocation.cc
diff --git a/content/test/mock_geolocation.cc b/content/test/mock_geolocation.cc
deleted file mode 100644
index 9ea4390bc7e0e12246d1bb426ad4e04aab74903e..0000000000000000000000000000000000000000
--- a/content/test/mock_geolocation.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/test/mock_geolocation.h"
-
-#include "base/logging.h"
-#include "content/browser/geolocation/arbitrator_dependency_factories_for_test.h"
-#include "content/browser/geolocation/location_arbitrator.h"
-#include "content/browser/geolocation/mock_location_provider.h"
-#include "content/common/geoposition.h"
-
-namespace content {
-
-MockGeolocation::MockGeolocation() {
- dependency_factory_ =
- new GeolocationArbitratorDependencyFactoryWithLocationProvider(
- &NewAutoSuccessMockLocationProvider);
-}
-
-MockGeolocation::~MockGeolocation() {
-}
-
-void MockGeolocation::Setup() {
- GeolocationArbitrator::SetDependencyFactoryForTest(
- dependency_factory_.get());
-}
-
-void MockGeolocation::TearDown() {
- GeolocationArbitrator::SetDependencyFactoryForTest(NULL);
-}
-
-void MockGeolocation::GetCurrentPosition(double* latitude,
- double* longitude) const {
- *latitude = MockLocationProvider::instance_->position_.latitude;
- *longitude = MockLocationProvider::instance_->position_.longitude;
-}
-
-void MockGeolocation::SetCurrentPosition(double latitude, double longitude) {
- Geoposition geoposition;
- geoposition.latitude = latitude;
- geoposition.longitude = longitude;
- geoposition.accuracy = 0;
- geoposition.error_code = Geoposition::ERROR_CODE_NONE;
- // Webkit compares the timestamp to wall clock time, so we need
- // it to be contemporary.
- geoposition.timestamp = base::Time::Now();
- DCHECK(geoposition.IsValidFix());
-
- MockLocationProvider::instance_->HandlePositionChanged(geoposition);
-}
-
-} // namespace content
« no previous file with comments | « content/test/mock_geolocation.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698