Commit a0164529 authored by Reilly Grant's avatar Reilly Grant Committed by Commit Bot

geolocation: Disable system backend for network location tests

This disables the macOS Core Location backend when running tests which
are meant to exercise NetworkLocationProvider.

Bug: 1051591
Change-Id: I0bbf10b9852e165b5eea2ceb9185adbca2eda1b4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2413247
Auto-Submit: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Ovidio de Jesús Ruiz-Henríquez <odejesush@chromium.org>
Reviewed-by: default avatarOvidio de Jesús Ruiz-Henríquez <odejesush@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807443}
parent dc72ea41
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/test/bind_test_util.h" #include "base/test/bind_test_util.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h" #include "build/build_config.h"
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
#include "chromeos/dbus/shill/shill_clients.h" #include "chromeos/dbus/shill/shill_clients.h"
...@@ -15,6 +16,7 @@ ...@@ -15,6 +16,7 @@
#include "services/device/device_service_test_base.h" #include "services/device/device_service_test_base.h"
#include "services/device/geolocation/geolocation_provider_impl.h" #include "services/device/geolocation/geolocation_provider_impl.h"
#include "services/device/geolocation/network_location_request.h" #include "services/device/geolocation/network_location_request.h"
#include "services/device/public/cpp/device_features.h"
#include "services/device/public/mojom/geolocation.mojom.h" #include "services/device/public/mojom/geolocation.mojom.h"
#include "services/device/public/mojom/geolocation_config.mojom.h" #include "services/device/public/mojom/geolocation_config.mojom.h"
#include "services/device/public/mojom/geolocation_context.mojom.h" #include "services/device/public/mojom/geolocation_context.mojom.h"
...@@ -93,6 +95,11 @@ class GeolocationServiceUnitTest : public DeviceServiceTestBase { ...@@ -93,6 +95,11 @@ class GeolocationServiceUnitTest : public DeviceServiceTestBase {
// detected in a scan: https://crbug.com/767300. // detected in a scan: https://crbug.com/767300.
#else #else
TEST_F(GeolocationServiceUnitTest, UrlWithApiKey) { TEST_F(GeolocationServiceUnitTest, UrlWithApiKey) {
// With this flag enabled macOS will try to use the system location provider
// instead of NetworkLocationProvider.
base::test::ScopedFeatureList feature_list;
feature_list.InitAndDisableFeature(features::kMacCoreLocationImplementation);
base::RunLoop loop; base::RunLoop loop;
test_url_loader_factory_.SetInterceptor(base::BindLambdaForTesting( test_url_loader_factory_.SetInterceptor(base::BindLambdaForTesting(
[&loop](const network::ResourceRequest& request) { [&loop](const network::ResourceRequest& request) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment