#include "content/browser/geolocation/geolocation_service_impl.h"
#include <memory>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/test_future.h"
#include "content/browser/permissions/permission_controller_impl.h"
#include "content/public/browser/device_service.h"
#include "content/public/browser/permission_controller.h"
#include "content/public/browser/permission_request_description.h"
#include "content/public/test/mock_permission_manager.h"
#include "content/public/test/navigation_simulator.h"
#include "content/public/test/test_browser_context.h"
#include "content/test/test_render_frame_host.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "services/device/public/cpp/test/scoped_geolocation_overrider.h"
#include "services/device/public/mojom/geolocation.mojom.h"
#include "services/device/public/mojom/geolocation_context.mojom.h"
#include "services/device/public/mojom/geoposition.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/permissions/permission_utils.h"
#include "third_party/blink/public/common/permissions_policy/origin_with_possible_wildcards.h"
#include "third_party/blink/public/mojom/permissions_policy/permissions_policy.mojom.h"
namespace content {
namespace {
TestFuture;
GeolocationService;
PermissionStatus;
Geolocation;
GeopositionPtr;
GeopositionResultPtr;
PermissionCallback;
double kMockLatitude = …;
double kMockLongitude = …;
class TestPermissionManager : public MockPermissionManager { … };
class GeolocationServiceTest : public RenderViewHostImplTestHarness { … };
}
TEST_F(GeolocationServiceTest, PermissionGrantedPolicyViolation) { … }
TEST_F(GeolocationServiceTest, PermissionGrantedSync) { … }
TEST_F(GeolocationServiceTest, PermissionDeniedSync) { … }
TEST_F(GeolocationServiceTest, PermissionGrantedAsync) { … }
TEST_F(GeolocationServiceTest, PermissionDeniedAsync) { … }
TEST_F(GeolocationServiceTest, ServiceClosedBeforePermissionResponse) { … }
}