summaryrefslogtreecommitdiffstats
path: root/content/browser/geolocation/gps_location_provider_unittest_linux.cc
diff options
context:
space:
mode:
Diffstat (limited to 'content/browser/geolocation/gps_location_provider_unittest_linux.cc')
-rw-r--r--content/browser/geolocation/gps_location_provider_unittest_linux.cc33
1 files changed, 14 insertions, 19 deletions
diff --git a/content/browser/geolocation/gps_location_provider_unittest_linux.cc b/content/browser/geolocation/gps_location_provider_unittest_linux.cc
index 6f4053c..4cba202 100644
--- a/content/browser/geolocation/gps_location_provider_unittest_linux.cc
+++ b/content/browser/geolocation/gps_location_provider_unittest_linux.cc
@@ -8,16 +8,14 @@
#include "base/bind.h"
-using content::BrowserThread;
-using content::BrowserThreadImpl;
+namespace content {
-namespace {
class MockLibGps : public LibGps {
public:
MockLibGps();
~MockLibGps();
- virtual bool GetPositionIfFixed(content::Geoposition* position) {
+ virtual bool GetPositionIfFixed(Geoposition* position) {
CHECK(position);
++get_position_calls_;
*position = get_position_;
@@ -46,7 +44,7 @@ class MockLibGps : public LibGps {
int gps_open_ret_;
int gps_read_calls_;
int gps_read_ret_;
- content::Geoposition get_position_;
+ Geoposition get_position_;
static MockLibGps* g_instance_;
};
@@ -77,8 +75,8 @@ class GeolocationGpsProviderLinuxTests : public testing::Test {
scoped_ptr<GpsLocationProviderLinux> provider_;
};
-void CheckValidPosition(const content::Geoposition& expected,
- const content::Geoposition& actual) {
+void CheckValidPosition(const Geoposition& expected,
+ const Geoposition& actual) {
EXPECT_TRUE(actual.Validate());
EXPECT_DOUBLE_EQ(expected.latitude, actual.latitude);
EXPECT_DOUBLE_EQ(expected.longitude, actual.longitude);
@@ -95,8 +93,7 @@ MockLibGps::MockLibGps()
gps_open_ret_(0),
gps_read_calls_(0),
gps_read_ret_(0) {
- get_position_.error_code =
- content::Geoposition::ERROR_CODE_POSITION_UNAVAILABLE;
+ get_position_.error_code = Geoposition::ERROR_CODE_POSITION_UNAVAILABLE;
EXPECT_FALSE(g_instance_);
g_instance_ = this;
}
@@ -121,11 +118,10 @@ TEST_F(GeolocationGpsProviderLinuxTests, NoLibGpsInstalled) {
ASSERT_TRUE(provider_.get());
const bool ok = provider_->StartProvider(true);
EXPECT_FALSE(ok);
- content::Geoposition position;
+ Geoposition position;
provider_->GetPosition(&position);
EXPECT_FALSE(position.Validate());
- EXPECT_EQ(content::Geoposition::ERROR_CODE_POSITION_UNAVAILABLE,
- position.error_code);
+ EXPECT_EQ(Geoposition::ERROR_CODE_POSITION_UNAVAILABLE, position.error_code);
}
#if defined(OS_CHROMEOS)
@@ -138,13 +134,12 @@ TEST_F(GeolocationGpsProviderLinuxTests, GetPosition) {
EXPECT_EQ(0, MockLibGps::g_instance_->get_position_calls_);
EXPECT_EQ(0, MockLibGps::g_instance_->gps_open_calls_);
EXPECT_EQ(0, MockLibGps::g_instance_->gps_read_calls_);
- content::Geoposition position;
+ Geoposition position;
provider_->GetPosition(&position);
EXPECT_FALSE(position.Validate());
- EXPECT_EQ(content::Geoposition::ERROR_CODE_POSITION_UNAVAILABLE,
- position.error_code);
+ EXPECT_EQ(Geoposition::ERROR_CODE_POSITION_UNAVAILABLE, position.error_code);
MockLibGps::g_instance_->get_position_.error_code =
- content::Geoposition::ERROR_CODE_NONE;
+ Geoposition::ERROR_CODE_NONE;
MockLibGps::g_instance_->get_position_.latitude = 4.5;
MockLibGps::g_instance_->get_position_.longitude = -34.1;
MockLibGps::g_instance_->get_position_.accuracy = 345;
@@ -183,9 +178,9 @@ TEST_F(GeolocationGpsProviderLinuxTests, LibGpsReconnect) {
// Let gps_open() fails, and so will LibGps::Start().
// Reconnect will happen in 1000ms.
MockLibGps::g_instance_->gps_open_ret_ = 1;
- content::Geoposition position;
+ Geoposition position;
MockLibGps::g_instance_->get_position_.error_code =
- content::Geoposition::ERROR_CODE_NONE;
+ Geoposition::ERROR_CODE_NONE;
MockLibGps::g_instance_->get_position_.latitude = 4.5;
MockLibGps::g_instance_->get_position_.longitude = -34.1;
MockLibGps::g_instance_->get_position_.accuracy = 345;
@@ -209,4 +204,4 @@ TEST_F(GeolocationGpsProviderLinuxTests, LibGpsReconnect) {
#endif // #if defined(OS_CHROMEOS)
-} // namespace
+} // namespace content