Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1888)

Unified Diff: chrome/browser/geolocation/geolocation_permission_context_unittest.cc

Issue 1515103003: Revert of Removal of geolocation APIs on insecure origins (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/geolocation/geolocation_permission_context_unittest.cc
diff --git a/chrome/browser/geolocation/geolocation_permission_context_unittest.cc b/chrome/browser/geolocation/geolocation_permission_context_unittest.cc
index ab739ef253f85c510602da2aed18f22ec3095fdb..42273ac3be4ebeb9efb8052049a9e50094b3c88d 100644
--- a/chrome/browser/geolocation/geolocation_permission_context_unittest.cc
+++ b/chrome/browser/geolocation/geolocation_permission_context_unittest.cc
@@ -383,7 +383,7 @@
// Tests ----------------------------------------------------------------------
TEST_F(GeolocationPermissionContextTests, SinglePermissionBubble) {
- GURL requesting_frame("https://www.example.com/geolocation");
+ GURL requesting_frame("http://www.example.com/geolocation");
NavigateAndCommit(requesting_frame);
BubbleManagerDocumentLoadCompleted();
@@ -393,21 +393,9 @@
ASSERT_EQ(1U, GetNumberOfPrompts());
}
-TEST_F(GeolocationPermissionContextTests,
- SinglePermissionBubbleFailsOnInsecureOrigin) {
+#if BUILDFLAG(ANDROID_JAVA_UI)
+TEST_F(GeolocationPermissionContextTests, SinglePermissionInfobar) {
GURL requesting_frame("http://www.example.com/geolocation");
- NavigateAndCommit(requesting_frame);
- BubbleManagerDocumentLoadCompleted();
-
- EXPECT_EQ(0U, GetNumberOfPrompts());
- RequestGeolocationPermission(web_contents(), RequestID(0), requesting_frame,
- true);
- ASSERT_EQ(0U, GetNumberOfPrompts());
-}
-
-#if BUILDFLAG(ANDROID_JAVA_UI)
-TEST_F(GeolocationPermissionContextTests, SinglePermissionInfobar) {
- GURL requesting_frame("https://www.example.com/geolocation");
NavigateAndCommit(requesting_frame);
EXPECT_EQ(0U, infobar_service()->infobar_count());
RequestGeolocationPermission(
@@ -425,7 +413,7 @@
// Infobar-only tests; Android doesn't support permission bubbles.
TEST_F(GeolocationPermissionContextTests, GeolocationEnabledDisabled) {
- GURL requesting_frame("https://www.example.com/geolocation");
+ GURL requesting_frame("http://www.example.com/geolocation");
NavigateAndCommit(requesting_frame);
MockLocationSettings::SetLocationStatus(true, true);
EXPECT_EQ(0U, infobar_service()->infobar_count());
@@ -447,7 +435,7 @@
}
TEST_F(GeolocationPermissionContextTests, MasterEnabledGoogleAppsEnabled) {
- GURL requesting_frame("https://www.example.com/geolocation");
+ GURL requesting_frame("http://www.example.com/geolocation");
NavigateAndCommit(requesting_frame);
MockLocationSettings::SetLocationStatus(true, true);
EXPECT_EQ(0U, infobar_service()->infobar_count());
@@ -463,7 +451,7 @@
}
TEST_F(GeolocationPermissionContextTests, MasterEnabledGoogleAppsDisabled) {
- GURL requesting_frame("https://www.example.com/geolocation");
+ GURL requesting_frame("http://www.example.com/geolocation");
NavigateAndCommit(requesting_frame);
MockLocationSettings::SetLocationStatus(true, false);
EXPECT_EQ(0U, infobar_service()->infobar_count());
@@ -474,8 +462,8 @@
#endif
TEST_F(GeolocationPermissionContextTests, QueuedPermission) {
- GURL requesting_frame_0("https://www.example.com/geolocation");
- GURL requesting_frame_1("https://www.example-2.com/geolocation");
+ GURL requesting_frame_0("http://www.example.com/geolocation");
+ GURL requesting_frame_1("http://www.example-2.com/geolocation");
EXPECT_EQ(
CONTENT_SETTING_ASK,
GetGeolocationContentSetting(requesting_frame_0, requesting_frame_1));
@@ -540,8 +528,8 @@
}
TEST_F(GeolocationPermissionContextTests, HashIsIgnored) {
- GURL url_a("https://www.example.com/geolocation#a");
- GURL url_b("https://www.example.com/geolocation#b");
+ GURL url_a("http://www.example.com/geolocation#a");
+ GURL url_b("http://www.example.com/geolocation#b");
// Navigate to the first url.
NavigateAndCommit(url_a);
@@ -607,8 +595,8 @@
}
TEST_F(GeolocationPermissionContextTests, CancelGeolocationPermissionRequest) {
- GURL frame_0("https://www.example.com/geolocation");
- GURL frame_1("https://www.example-2.com/geolocation");
+ GURL frame_0("http://www.example.com/geolocation");
+ GURL frame_1("http://www.example-2.com/geolocation");
EXPECT_EQ(
CONTENT_SETTING_ASK, GetGeolocationContentSetting(frame_0, frame_0));
EXPECT_EQ(
@@ -672,8 +660,8 @@
}
TEST_F(GeolocationPermissionContextTests, SameOriginMultipleTabs) {
- GURL url_a("https://www.example.com/geolocation");
- GURL url_b("https://www.example-2.com/geolocation");
+ GURL url_a("http://www.example.com/geolocation");
+ GURL url_b("http://www.example-2.com/geolocation");
NavigateAndCommit(url_a); // Tab A0
AddNewTab(url_b); // Tab B (extra_tabs_[0])
AddNewTab(url_a); // Tab A1 (extra_tabs_[1])
@@ -733,8 +721,8 @@
}
TEST_F(GeolocationPermissionContextTests, QueuedOriginMultipleTabs) {
- GURL url_a("https://www.example.com/geolocation");
- GURL url_b("https://www.example-2.com/geolocation");
+ GURL url_a("http://www.example.com/geolocation");
+ GURL url_b("http://www.example-2.com/geolocation");
NavigateAndCommit(url_a); // Tab A0.
AddNewTab(url_a); // Tab A1.
#if !BUILDFLAG(ANDROID_JAVA_UI)
@@ -808,8 +796,8 @@
}
TEST_F(GeolocationPermissionContextTests, TabDestroyed) {
- GURL requesting_frame_0("https://www.example.com/geolocation");
- GURL requesting_frame_1("https://www.example-2.com/geolocation");
+ GURL requesting_frame_0("http://www.example.com/geolocation");
+ GURL requesting_frame_1("http://www.example-2.com/geolocation");
EXPECT_EQ(
CONTENT_SETTING_ASK,
GetGeolocationContentSetting(requesting_frame_0, requesting_frame_0));
@@ -847,7 +835,7 @@
}
TEST_F(GeolocationPermissionContextTests, LastUsageAudited) {
- GURL requesting_frame("https://www.example.com/geolocation");
+ GURL requesting_frame("http://www.example.com/geolocation");
NavigateAndCommit(requesting_frame);
BubbleManagerDocumentLoadCompleted();
@@ -899,8 +887,8 @@
HostContentSettingsMapFactory::GetForProfile(profile());
map->SetPrefClockForTesting(scoped_ptr<base::Clock>(test_clock));
- GURL requesting_frame_0("https://www.example.com/geolocation");
- GURL requesting_frame_1("https://www.example-2.com/geolocation");
+ GURL requesting_frame_0("http://www.example.com/geolocation");
+ GURL requesting_frame_1("http://www.example-2.com/geolocation");
// The permission shouldn't have been used yet.
EXPECT_EQ(map->GetLastUsage(requesting_frame_0.GetOrigin(),

Powered by Google App Engine
This is Rietveld 408576698