summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjknotten@chromium.org <jknotten@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-27 14:59:25 +0000
committerjknotten@chromium.org <jknotten@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-27 14:59:25 +0000
commit5ba9c9ae342ff20bde44be9dfc538727d3696865 (patch)
tree800a2b6f6b3c2cad5b300d2ed7ca6087233cac89 /chrome
parentb20c4619af68cfc2969a22d9f73cc0fc79487297 (diff)
downloadchromium_src-5ba9c9ae342ff20bde44be9dfc538727d3696865.zip
chromium_src-5ba9c9ae342ff20bde44be9dfc538727d3696865.tar.gz
chromium_src-5ba9c9ae342ff20bde44be9dfc538727d3696865.tar.bz2
Put geolocation unit and browser test code in anonymous namespaces.
Avoid overlapping class definitions (e.g. MessageLoopQuitListener). BUG=None TEST=unit_tests,browser_tests Review URL: http://codereview.chromium.org/6341013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72793 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/geolocation/access_token_store_browsertest.cc4
-rw-r--r--chrome/browser/geolocation/device_data_provider_unittest.cc4
-rw-r--r--chrome/browser/geolocation/gateway_data_provider_common_unittest.cc4
-rw-r--r--chrome/browser/geolocation/geolocation_browsertest.cc4
-rw-r--r--chrome/browser/geolocation/geolocation_exceptions_table_model_unittest.cc3
-rw-r--r--chrome/browser/geolocation/geolocation_permission_context_unittest.cc4
-rw-r--r--chrome/browser/geolocation/network_location_provider_unittest.cc4
-rw-r--r--chrome/browser/geolocation/wifi_data_provider_common_unittest.cc5
-rw-r--r--chrome/browser/geolocation/win7_location_api_unittest_win.cc4
-rw-r--r--chrome/browser/geolocation/win7_location_provider_unittest_win.cc3
10 files changed, 34 insertions, 5 deletions
diff --git a/chrome/browser/geolocation/access_token_store_browsertest.cc b/chrome/browser/geolocation/access_token_store_browsertest.cc
index 802d16d..4893194 100644
--- a/chrome/browser/geolocation/access_token_store_browsertest.cc
+++ b/chrome/browser/geolocation/access_token_store_browsertest.cc
@@ -11,13 +11,13 @@
#include "chrome/test/ui_test_utils.h"
namespace {
+
// The token store factory implementation expects to be used from any well-known
// chrome thread other than UI. We could use any arbitrary thread; IO is
// a good choice as this is the expected usage.
const BrowserThread::ID kExpectedClientThreadId = BrowserThread::IO;
const char* kRefServerUrl1 = "https://test.domain.example/foo?id=bar.bar";
const char* kRefServerUrl2 = "http://another.domain.example/foo?id=bar.bar#2";
-} // namespace
class GeolocationAccessTokenStoreTest
: public InProcessBrowserTest {
@@ -149,3 +149,5 @@ IN_PROC_BROWSER_TEST_F(GeolocationAccessTokenStoreTest, CancelRequest) {
RunCancelTestInClientTread));
ui_test_utils::RunMessageLoop();
}
+
+} // namespace
diff --git a/chrome/browser/geolocation/device_data_provider_unittest.cc b/chrome/browser/geolocation/device_data_provider_unittest.cc
index a361fc6..b4d4ac6 100644
--- a/chrome/browser/geolocation/device_data_provider_unittest.cc
+++ b/chrome/browser/geolocation/device_data_provider_unittest.cc
@@ -9,6 +9,7 @@
#include "testing/gtest/include/gtest/gtest.h"
namespace {
+
class NullWifiDataListenerInterface
: public WifiDataProviderCommon::ListenerInterface {
public:
@@ -16,7 +17,6 @@ class NullWifiDataListenerInterface
virtual void DeviceDataUpdateAvailable(
DeviceDataProvider<WifiData>* provider) {}
};
-}
TEST(GeolocationDeviceDataProviderWifiData, CreateDestroy) {
// See http://crbug.com/59913 . The main_message_loop is not required to be
@@ -38,3 +38,5 @@ TEST(GeolocationDeviceDataProviderWifiData, CreateDestroy) {
}
}
}
+
+} // namespace
diff --git a/chrome/browser/geolocation/gateway_data_provider_common_unittest.cc b/chrome/browser/geolocation/gateway_data_provider_common_unittest.cc
index 1f8b072..cc7b83f 100644
--- a/chrome/browser/geolocation/gateway_data_provider_common_unittest.cc
+++ b/chrome/browser/geolocation/gateway_data_provider_common_unittest.cc
@@ -17,6 +17,8 @@ using testing::DoDefault;
using testing::Invoke;
using testing::Return;
+namespace {
+
class MockGatewayApi : public GatewayDataProviderCommon::GatewayApiInterface {
public:
MockGatewayApi() {
@@ -185,3 +187,5 @@ TEST_F(GeolocationGatewayDataProviderCommonTest, DoScanWithResults) {
EXPECT_EQ(1, static_cast<int>(data.router_data.size()));
EXPECT_EQ(single_router.mac_address, data.router_data.begin()->mac_address);
}
+
+} // namespace
diff --git a/chrome/browser/geolocation/geolocation_browsertest.cc b/chrome/browser/geolocation/geolocation_browsertest.cc
index 55316c5..47272b6 100644
--- a/chrome/browser/geolocation/geolocation_browsertest.cc
+++ b/chrome/browser/geolocation/geolocation_browsertest.cc
@@ -27,6 +27,8 @@
#include "net/base/net_util.h"
#include "net/test/test_server.h"
+namespace {
+
// Used to block until an iframe is loaded via a javascript call.
// Note: NavigateToURLBlockUntilNavigationsComplete doesn't seem to work for
// multiple embedded iframes, as notifications seem to be 'batched'. Instead, we
@@ -635,3 +637,5 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, DISABLED_TabDestroyed) {
L"", UTF8ToWide(script));
EXPECT_EQ(result, true);
}
+
+} // namespace
diff --git a/chrome/browser/geolocation/geolocation_exceptions_table_model_unittest.cc b/chrome/browser/geolocation/geolocation_exceptions_table_model_unittest.cc
index 301a7b2..5dd18a1 100644
--- a/chrome/browser/geolocation/geolocation_exceptions_table_model_unittest.cc
+++ b/chrome/browser/geolocation/geolocation_exceptions_table_model_unittest.cc
@@ -15,7 +15,6 @@ namespace {
const GURL kUrl0("http://www.example.com");
const GURL kUrl1("http://www.example1.com");
const GURL kUrl2("http://www.example2.com");
-} // namespace
class GeolocationExceptionsTableModelTest : public RenderViewHostTestHarness {
public:
@@ -141,3 +140,5 @@ TEST_F(GeolocationExceptionsTableModelTest, GetText) {
EXPECT_NE(string16::npos,
text.find(content_settings_helper::OriginToString16(kUrl2)));
}
+
+} // namespace
diff --git a/chrome/browser/geolocation/geolocation_permission_context_unittest.cc b/chrome/browser/geolocation/geolocation_permission_context_unittest.cc
index f0346f4..22039d2 100644
--- a/chrome/browser/geolocation/geolocation_permission_context_unittest.cc
+++ b/chrome/browser/geolocation/geolocation_permission_context_unittest.cc
@@ -21,6 +21,8 @@
#include "chrome/test/testing_profile.h"
#include "testing/gtest/include/gtest/gtest.h"
+namespace {
+
// TestTabContents short-circuits TAB_CONTENTS_INFOBAR_REMOVED to call
// InfoBarClosed() directly. We need to observe it and call InfoBarClosed()
// later.
@@ -421,3 +423,5 @@ TEST_F(GeolocationPermissionContextTests, TabDestroyed) {
// Delete the tab contents.
DeleteContents();
}
+
+} // namespace
diff --git a/chrome/browser/geolocation/network_location_provider_unittest.cc b/chrome/browser/geolocation/network_location_provider_unittest.cc
index c56c3d9..3969ad1 100644
--- a/chrome/browser/geolocation/network_location_provider_unittest.cc
+++ b/chrome/browser/geolocation/network_location_provider_unittest.cc
@@ -14,6 +14,7 @@
#include "testing/gtest/include/gtest/gtest.h"
namespace {
+
// Constants used in multiple tests.
const char kTestServerUrl[] = "https://www.geolocation.test/service";
const char kTestHost[] = "myclienthost.test";
@@ -21,8 +22,6 @@ const char kTestHostUrl[] = "http://myclienthost.test/some/path";
// Using #define so we can easily paste this into various other strings.
#define REFERENCE_ACCESS_TOKEN "2:k7j3G6LaL6u_lafw:4iXOeOpTh1glSXe"
-} // namespace
-
// Stops the specified (nested) message loop when the listener is called back.
class MessageLoopQuitListener
: public LocationProviderBase::ListenerInterface {
@@ -779,3 +778,4 @@ TEST_F(GeolocationNetworkProviderTest, NetworkPositionCache) {
}
}
+} // namespace
diff --git a/chrome/browser/geolocation/wifi_data_provider_common_unittest.cc b/chrome/browser/geolocation/wifi_data_provider_common_unittest.cc
index 256fbcb..783114c 100644
--- a/chrome/browser/geolocation/wifi_data_provider_common_unittest.cc
+++ b/chrome/browser/geolocation/wifi_data_provider_common_unittest.cc
@@ -19,6 +19,8 @@ using testing::DoDefault;
using testing::Invoke;
using testing::Return;
+namespace {
+
class MockWlanApi : public WifiDataProviderCommon::WlanApiInterface {
public:
MockWlanApi() : calls_(0), bool_return_(true) {
@@ -225,3 +227,6 @@ TEST_F(GeolocationWifiDataProviderCommonTest,
DeviceDataProvider<WifiData>::Unregister(&quit_listener);
DeviceDataProvider<WifiData>::ResetFactory();
}
+
+} // namespace
+
diff --git a/chrome/browser/geolocation/win7_location_api_unittest_win.cc b/chrome/browser/geolocation/win7_location_api_unittest_win.cc
index cfc35c3..66470cf 100644
--- a/chrome/browser/geolocation/win7_location_api_unittest_win.cc
+++ b/chrome/browser/geolocation/win7_location_api_unittest_win.cc
@@ -23,6 +23,8 @@ using testing::DoDefault;
using testing::Invoke;
using testing::Return;
+namespace {
+
class MockLatLongReport : public ILatLongReport {
public:
MockLatLongReport() : ref_count_(1) {
@@ -331,3 +333,5 @@ TEST_F(GeolocationApiWin7Tests, GetInvalidPosition) {
api_->GetPosition(&position);
EXPECT_FALSE(position.IsValidFix());
}
+
+} // namespace
diff --git a/chrome/browser/geolocation/win7_location_provider_unittest_win.cc b/chrome/browser/geolocation/win7_location_provider_unittest_win.cc
index a930db1..d997bf2 100644
--- a/chrome/browser/geolocation/win7_location_provider_unittest_win.cc
+++ b/chrome/browser/geolocation/win7_location_provider_unittest_win.cc
@@ -16,6 +16,7 @@ using testing::DoDefault;
using testing::Invoke;
using testing::Return;
+namespace {
class MockWin7LocationApi : public Win7LocationApi {
public:
@@ -136,3 +137,5 @@ TEST_F(GeolocationProviderWin7Tests, GetInvalidPosition) {
provider_->GetPosition(&position);
EXPECT_FALSE(position.IsValidFix());
}
+
+} // namespace \ No newline at end of file