OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/geolocation/geolocation_permission_context.h" | 5 #include "chrome/browser/geolocation/geolocation_permission_context.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
905 // but not if it is ALLOW. | 905 // but not if it is ALLOW. |
906 SearchGeolocationService* geo_service = | 906 SearchGeolocationService* geo_service = |
907 SearchGeolocationService::Factory::GetForBrowserContext(profile()); | 907 SearchGeolocationService::Factory::GetForBrowserContext(profile()); |
908 geo_service->SetSearchEngineDelegateForTest( | 908 geo_service->SetSearchEngineDelegateForTest( |
909 base::MakeUnique<TestSearchEngineDelegate>()); | 909 base::MakeUnique<TestSearchEngineDelegate>()); |
910 | 910 |
911 Profile* otr_profile = profile()->GetOffTheRecordProfile(); | 911 Profile* otr_profile = profile()->GetOffTheRecordProfile(); |
912 | 912 |
913 // A DSE setting of ALLOW should not flow through to incognito. | 913 // A DSE setting of ALLOW should not flow through to incognito. |
914 geo_service->SetDSEGeolocationSetting(true); | 914 geo_service->SetDSEGeolocationSetting(true); |
915 ASSERT_EQ(blink::mojom::PermissionStatus::ASK, | 915 ASSERT_EQ(CONTENT_SETTING_ASK, |
916 PermissionManager::Get(otr_profile) | 916 PermissionManager::Get(otr_profile) |
917 ->GetPermissionStatus(CONTENT_SETTINGS_TYPE_GEOLOCATION, | 917 ->GetPermissionStatus(CONTENT_SETTINGS_TYPE_GEOLOCATION, |
918 requesting_frame, requesting_frame)); | 918 requesting_frame, requesting_frame) |
| 919 .content_setting); |
919 | 920 |
920 // Changing the setting to BLOCK should flow through to incognito. | 921 // Changing the setting to BLOCK should flow through to incognito. |
921 geo_service->SetDSEGeolocationSetting(false); | 922 geo_service->SetDSEGeolocationSetting(false); |
922 ASSERT_EQ(blink::mojom::PermissionStatus::DENIED, | 923 ASSERT_EQ(CONTENT_SETTING_BLOCK, |
923 PermissionManager::Get(otr_profile) | 924 PermissionManager::Get(otr_profile) |
924 ->GetPermissionStatus(CONTENT_SETTINGS_TYPE_GEOLOCATION, | 925 ->GetPermissionStatus(CONTENT_SETTINGS_TYPE_GEOLOCATION, |
925 requesting_frame, requesting_frame)); | 926 requesting_frame, requesting_frame) |
| 927 .content_setting); |
926 } | 928 } |
927 #endif // defined(OS_ANDROID) | 929 #endif // defined(OS_ANDROID) |
OLD | NEW |