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_ALLOW, |
raymes
2017/02/28 01:37:34
This changed to allow? I wonder why tests passed?
Timothy Loh
2017/02/28 04:02:46
Fixed. This test only runs on android (and those b
| |
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 | 919 |
920 // Changing the setting to BLOCK should flow through to incognito. | 920 // Changing the setting to BLOCK should flow through to incognito. |
921 geo_service->SetDSEGeolocationSetting(false); | 921 geo_service->SetDSEGeolocationSetting(false); |
922 ASSERT_EQ(blink::mojom::PermissionStatus::DENIED, | 922 ASSERT_EQ(CONTENT_SETTING_BLOCK, |
923 PermissionManager::Get(otr_profile) | 923 PermissionManager::Get(otr_profile) |
924 ->GetPermissionStatus(CONTENT_SETTINGS_TYPE_GEOLOCATION, | 924 ->GetPermissionStatus(CONTENT_SETTINGS_TYPE_GEOLOCATION, |
925 requesting_frame, requesting_frame)); | 925 requesting_frame, requesting_frame)); |
926 } | 926 } |
927 #endif // defined(OS_ANDROID) | 927 #endif // defined(OS_ANDROID) |
OLD | NEW |