diff options
Diffstat (limited to 'chromium/components/permissions/contexts/geolocation_permission_context_unittest.cc')
-rw-r--r-- | chromium/components/permissions/contexts/geolocation_permission_context_unittest.cc | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/chromium/components/permissions/contexts/geolocation_permission_context_unittest.cc b/chromium/components/permissions/contexts/geolocation_permission_context_unittest.cc index 6664fb1fbea..6241238006e 100644 --- a/chromium/components/permissions/contexts/geolocation_permission_context_unittest.cc +++ b/chromium/components/permissions/contexts/geolocation_permission_context_unittest.cc @@ -56,7 +56,7 @@ #include "content/public/test/web_contents_tester.h" #include "testing/gtest/include/gtest/gtest.h" -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) #include "components/location/android/location_settings_dialog_outcome.h" #include "components/location/android/mock_location_settings.h" #include "components/permissions/contexts/geolocation_permission_context_android.h" @@ -64,7 +64,7 @@ #include "content/public/browser/permission_type.h" #endif -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) #include "components/permissions/contexts/geolocation_permission_context_mac.h" #include "services/device/public/cpp/test/fake_geolocation_manager.h" #endif @@ -81,7 +81,7 @@ class TestGeolocationPermissionContextDelegate public: explicit TestGeolocationPermissionContextDelegate( content::BrowserContext* browser_context) { -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) GeolocationPermissionContextAndroid::RegisterProfilePrefs( prefs_.registry()); #endif @@ -96,7 +96,7 @@ class TestGeolocationPermissionContextDelegate return false; } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) bool IsInteractable(content::WebContents* web_contents) override { return true; } @@ -110,10 +110,6 @@ class TestGeolocationPermissionContextDelegate return dse_origin_ && dse_origin_.value() == url::Origin::Create(requesting_origin); } - - void FinishNotifyPermissionSet(const PermissionRequestID& id, - const GURL& requesting_origin, - const GURL& embedding_origin) override {} #endif void SetDSEOriginForTesting(const url::Origin& dse_origin) { @@ -161,7 +157,7 @@ class GeolocationPermissionContextTests const ContentSettingsPattern& secondary_pattern, ContentSettingsTypeSet content_type_set) override; -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) bool RequestPermissionIsLSDShown(const GURL& origin); bool RequestPermissionIsLSDShownWithPermissionPrompt(const GURL& origin); void AddDayOffsetForTesting(int days); @@ -191,7 +187,7 @@ class GeolocationPermissionContextTests mock_permission_prompt_factories_; std::unique_ptr<PermissionManager> manager_; -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) std::unique_ptr<device::FakeGeolocationManager> fake_geolocation_manager_; #endif @@ -315,7 +311,7 @@ void GeolocationPermissionContextTests::SetUp() { browser_context()); delegate_ = delegate.get(); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) auto context = std::make_unique<GeolocationPermissionContextAndroid>( browser_context(), std::move(delegate)); context->SetLocationSettingsForTesting( @@ -325,7 +321,7 @@ void GeolocationPermissionContextTests::SetUp() { MockLocationSettings::SetLocationSettingsDialogStatus(false /* enabled */, GRANTED); MockLocationSettings::ClearHasShownLocationSettingsDialog(); -#elif defined(OS_MAC) +#elif BUILDFLAG(IS_MAC) fake_geolocation_manager_ = std::make_unique<device::FakeGeolocationManager>(); fake_geolocation_manager_->SetSystemPermission( @@ -368,7 +364,7 @@ void GeolocationPermissionContextTests::SetupRequestManager( permission_request_manager)); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) bool GeolocationPermissionContextTests::RequestPermissionIsLSDShown( const GURL& origin) { @@ -406,7 +402,7 @@ void GeolocationPermissionContextTests::RequestManagerDocumentLoadCompleted() { void GeolocationPermissionContextTests::RequestManagerDocumentLoadCompleted( content::WebContents* web_contents) { PermissionRequestManager::FromWebContents(web_contents) - ->DocumentOnLoadCompletedInMainFrame(main_rfh()); + ->DocumentOnLoadCompletedInPrimaryMainFrame(); } ContentSetting GeolocationPermissionContextTests::GetGeolocationContentSetting( @@ -468,7 +464,7 @@ std::u16string GeolocationPermissionContextTests::GetPromptText() { PermissionRequestManager* manager = PermissionRequestManager::FromWebContents(web_contents()); PermissionRequest* request = manager->Requests().front(); -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) return request->GetDialogMessageText(); #else return base::ASCIIToUTF16(request->requesting_origin().spec()) + @@ -501,7 +497,7 @@ TEST_F(GeolocationPermissionContextTests, ASSERT_FALSE(HasActivePrompt()); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) // Tests concerning Android location settings permission TEST_F(GeolocationPermissionContextTests, GeolocationEnabledDisabled) { GURL requesting_frame("https://www.example.com/geolocation"); @@ -1033,7 +1029,7 @@ TEST_F(GeolocationPermissionContextTests, TabDestroyed) { GetGeolocationContentSetting(requesting_frame, requesting_frame)); } -#if defined(OS_ANDROID) +#if BUILDFLAG(IS_ANDROID) TEST_F(GeolocationPermissionContextTests, GeolocationStatusAndroidDisabled) { GURL requesting_frame("https://www.example.com/geolocation"); @@ -1110,9 +1106,9 @@ TEST_F(GeolocationPermissionContextTests, GeolocationStatusSystemDisabled) { manager_->GetPermissionStatus(content::PermissionType::GEOLOCATION, requesting_frame, requesting_frame)); } -#endif // defined(OS_ANDROID) +#endif // BUILDFLAG(IS_ANDROID) -#if defined(OS_MAC) +#if BUILDFLAG(IS_MAC) TEST_F(GeolocationPermissionContextTests, AllSystemAndSitePermissionCombinations) { GURL requesting_frame("https://www.example.com/geolocation"); |