зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1613627 - Rename all 'geo.wifi' related preferences to match the 'geo.provider.' convention and move default values to all.js. r=garvan
Differential Revision: https://phabricator.services.mozilla.com/D50209 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
ff31ef7666
Коммит
54e9a591b2
|
@ -1391,28 +1391,6 @@ pref("security.cert_pinning.enforcement_level", 1);
|
|||
// before content.
|
||||
pref("dom.debug.propagate_gesture_events_through_content", false);
|
||||
|
||||
// All the Geolocation preferences are here.
|
||||
//
|
||||
#ifndef EARLY_BETA_OR_EARLIER
|
||||
pref("geo.wifi.uri", "https://www.googleapis.com/geolocation/v1/geolocate?key=%GOOGLE_LOCATION_SERVICE_API_KEY%");
|
||||
#else
|
||||
// Use MLS on Nightly and early Beta.
|
||||
pref("geo.wifi.uri", "https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%");
|
||||
#endif
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
pref("geo.provider.use_corelocation", true);
|
||||
#endif
|
||||
|
||||
// Set to false if things are really broken.
|
||||
#ifdef XP_WIN
|
||||
pref("geo.provider.ms-windows-location", true);
|
||||
#endif
|
||||
|
||||
#if defined(MOZ_WIDGET_GTK) && defined(MOZ_GPSD)
|
||||
pref("geo.provider.use_gpsd", true);
|
||||
#endif
|
||||
|
||||
// CustomizableUI debug logging.
|
||||
pref("browser.uiCustomization.debug", false);
|
||||
|
||||
|
|
|
@ -20,9 +20,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1372069
|
|||
SpecialPowers.pushPrefEnv({"set":
|
||||
[
|
||||
["privacy.resistFingerprinting", true],
|
||||
["geo.prompt.testing", true],
|
||||
["geo.prompt.testing.allow", true],
|
||||
["geo.wifi.uri", BASE_GEO_URL],
|
||||
["geo.prompt.testing", true],
|
||||
["geo.prompt.testing.allow", true],
|
||||
["geo.provider.network.url", BASE_GEO_URL],
|
||||
],
|
||||
}, doTest_getCurrentPosition);
|
||||
}, window);
|
||||
|
|
|
@ -151,7 +151,7 @@ function isCachedRequestMoreAccurateThanServerRequest(newCell, newWifiList) {
|
|||
try {
|
||||
// Mochitest needs this pref to simulate request failure
|
||||
isNetworkRequestCacheEnabled = Services.prefs.getBoolPref(
|
||||
"geo.wifi.debug.requestCache.enabled"
|
||||
"geo.provider.network.debug.requestCache.enabled"
|
||||
);
|
||||
if (!isNetworkRequestCacheEnabled) {
|
||||
gCachedRequest = null;
|
||||
|
@ -252,14 +252,17 @@ WifiGeoPositionObject.prototype = {
|
|||
|
||||
function WifiGeoPositionProvider() {
|
||||
gLoggingEnabled = Services.prefs.getBoolPref(
|
||||
"geo.wifi.logging.enabled",
|
||||
"geo.provider.network.logging.enabled",
|
||||
false
|
||||
);
|
||||
gLocationRequestTimeout = Services.prefs.getIntPref(
|
||||
"geo.wifi.timeToWaitBeforeSending",
|
||||
"geo.provider.network.timeToWaitBeforeSending",
|
||||
5000
|
||||
);
|
||||
gWifiScanningEnabled = Services.prefs.getBoolPref("geo.wifi.scan", true);
|
||||
gWifiScanningEnabled = Services.prefs.getBoolPref(
|
||||
"geo.provider.network.scan",
|
||||
true
|
||||
);
|
||||
|
||||
this.wifiService = null;
|
||||
this.timer = null;
|
||||
|
@ -404,7 +407,7 @@ WifiGeoPositionProvider.prototype = {
|
|||
}
|
||||
|
||||
// From here on, do a network geolocation request //
|
||||
let url = Services.urlFormatter.formatURLPref("geo.wifi.uri");
|
||||
let url = Services.urlFormatter.formatURLPref("geo.provider.network.url");
|
||||
LOG("Sending request");
|
||||
|
||||
let xhr = new XMLHttpRequest();
|
||||
|
@ -418,7 +421,7 @@ WifiGeoPositionProvider.prototype = {
|
|||
xhr.setRequestHeader("Content-Type", "application/json; charset=UTF-8");
|
||||
xhr.responseType = "json";
|
||||
xhr.mozBackgroundRequest = true;
|
||||
xhr.timeout = Services.prefs.getIntPref("geo.wifi.xhr.timeout");
|
||||
xhr.timeout = Services.prefs.getIntPref("geo.provider.network.timeout");
|
||||
xhr.ontimeout = () => {
|
||||
LOG("Location request XHR timed out.");
|
||||
notifyPositionUnavailable(this.listener);
|
||||
|
|
|
@ -18,7 +18,10 @@ add_task(async function() {
|
|||
|
||||
// Make the geolocation provider responder very slowly to ensure that
|
||||
// it does not reply before we close the tab.
|
||||
Services.prefs.setCharPref("geo.wifi.uri", BASE_GEO_URL + "?delay=100000");
|
||||
Services.prefs.setCharPref(
|
||||
"geo.provider.network.url",
|
||||
BASE_GEO_URL + "?delay=100000"
|
||||
);
|
||||
|
||||
// Open the test URI and close it. The test harness will make sure that the
|
||||
// page is cleaned up after some GCs. If geolocation is not shut down properly,
|
||||
|
|
|
@ -11,10 +11,10 @@ const BASE_GEO_URL = "http://mochi.test:8888/tests/dom/tests/mochitest/geolocati
|
|||
var pushPrefs = (...p) => SpecialPowers.pushPrefEnv({set: p});
|
||||
|
||||
(async () => {
|
||||
await pushPrefs(["geo.wifi.debug.requestCache.enabled", false],
|
||||
["geo.prompt.testing", true],
|
||||
["geo.prompt.testing.allow", true],
|
||||
["geo.wifi.uri", BASE_GEO_URL]);
|
||||
await pushPrefs(["geo.provider.network.debug.requestCache.enabled", false],
|
||||
["geo.prompt.testing", true],
|
||||
["geo.prompt.testing.allow", true],
|
||||
["geo.provider.network.url", BASE_GEO_URL]);
|
||||
|
||||
navigator.geolocation.getCurrentPosition(() => {
|
||||
navigator.geolocation.watchPosition(() => {
|
||||
|
|
|
@ -10,9 +10,12 @@ var BASE_URL =
|
|||
function set_geo_wifi_uri(uri, callback) {
|
||||
// Disable NetworkGeolocationProvider.js request cache because the cache
|
||||
// does not remember from which location service it came from. We expect
|
||||
// different results when we change the provider URL (geo.wifi.uri).
|
||||
// different results when we change the provider URL (geo.provider.network.url).
|
||||
set_network_request_cache_enabled(false, () => {
|
||||
SpecialPowers.pushPrefEnv({ set: [["geo.wifi.uri", uri]] }, callback);
|
||||
SpecialPowers.pushPrefEnv(
|
||||
{ set: [["geo.provider.network.url", uri]] },
|
||||
callback
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -56,7 +59,7 @@ function stop_geolocationProvider(callback) {
|
|||
|
||||
function set_network_request_cache_enabled(enabled, callback) {
|
||||
SpecialPowers.pushPrefEnv(
|
||||
{ set: [["geo.wifi.debug.requestCache.enabled", enabled]] },
|
||||
{ set: [["geo.provider.network.debug.requestCache.enabled", enabled]] },
|
||||
callback
|
||||
);
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ function check() {
|
|||
var timeoutPassed = false;
|
||||
var timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
||||
function test1() {
|
||||
SpecialPowers.pushPrefEnv({"set": [["geo.wifi.timeToWaitBeforeSending", 10]]}, function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [["geo.provider.network.timeToWaitBeforeSending", 10]]}, function() {
|
||||
navigator.geolocation.getCurrentPosition(successCallback, errorCallback, {timeout: 500});
|
||||
timer.initWithCallback(timer => {
|
||||
timeoutPassed = true;
|
||||
|
|
|
@ -21,8 +21,8 @@ function run_test() {
|
|||
// needs a place where it can store databases.
|
||||
do_get_profile();
|
||||
|
||||
Services.prefs.setBoolPref("geo.wifi.scan", false);
|
||||
Services.prefs.setCharPref("geo.wifi.uri", "UrlNotUsedHere:");
|
||||
Services.prefs.setBoolPref("geo.provider.network.scan", false);
|
||||
Services.prefs.setCharPref("geo.provider.network.url", "UrlNotUsedHere:");
|
||||
Services.prefs.setBoolPref("dom.testing.ignore_ipc_principal", true);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
function run_test() {
|
||||
Services.prefs.setBoolPref("geo.wifi.scan", false);
|
||||
Services.prefs.setBoolPref("geo.provider.network.scan", false);
|
||||
|
||||
Services.prefs.setCharPref("geo.wifi.uri", "UrlNotUsedHere");
|
||||
Services.prefs.setCharPref("geo.provider.network.url", "UrlNotUsedHere");
|
||||
Services.prefs.setBoolPref("dom.testing.ignore_ipc_principal", true);
|
||||
run_test_in_child("./test_geolocation_position_unavailable.js");
|
||||
}
|
||||
|
|
|
@ -70,11 +70,11 @@ function run_test() {
|
|||
httpserver.start(-1);
|
||||
|
||||
Services.prefs.setCharPref(
|
||||
"geo.wifi.uri",
|
||||
"geo.provider.network.url",
|
||||
"http://localhost:" + httpserver.identity.primaryPort + "/geo"
|
||||
);
|
||||
Services.prefs.setBoolPref("dom.testing.ignore_ipc_principal", true);
|
||||
Services.prefs.setBoolPref("geo.wifi.scan", false);
|
||||
Services.prefs.setBoolPref("geo.provider.network.scan", false);
|
||||
|
||||
var obs = Cc["@mozilla.org/observer-service;1"].getService();
|
||||
obs = obs.QueryInterface(Ci.nsIObserverService);
|
||||
|
|
|
@ -31,14 +31,14 @@ function run_test() {
|
|||
httpserver.registerPathHandler("/geo", geoHandler);
|
||||
httpserver.start(-1);
|
||||
Services.prefs.setCharPref(
|
||||
"geo.wifi.uri",
|
||||
"geo.provider.network.url",
|
||||
"http://localhost:" + httpserver.identity.primaryPort + "/geo"
|
||||
);
|
||||
Services.prefs.setBoolPref("dom.testing.ignore_ipc_principal", true);
|
||||
Services.prefs.setBoolPref("geo.wifi.scan", false);
|
||||
Services.prefs.setBoolPref("geo.provider.network.scan", false);
|
||||
|
||||
// Setting timeout to a very low value to ensure time out will happen.
|
||||
Services.prefs.setIntPref("geo.wifi.xhr.timeout", 5);
|
||||
Services.prefs.setIntPref("geo.provider.network.timeout", 5);
|
||||
|
||||
geolocation = Cc["@mozilla.org/geolocation;1"].getService(Ci.nsISupports);
|
||||
geolocation.getCurrentPosition(successCallback, errorCallback);
|
||||
|
|
|
@ -69,7 +69,7 @@ function run_test() {
|
|||
);
|
||||
|
||||
Services.prefs.setBoolPref("dom.testing.ignore_ipc_principal", true);
|
||||
Services.prefs.setBoolPref("geo.wifi.scan", false);
|
||||
Services.prefs.setBoolPref("geo.provider.network.scan", false);
|
||||
}
|
||||
|
||||
do_test_pending();
|
||||
|
|
|
@ -55,7 +55,7 @@ function run_test() {
|
|||
);
|
||||
|
||||
Services.prefs.setBoolPref("dom.testing.ignore_ipc_principal", true);
|
||||
Services.prefs.setBoolPref("geo.wifi.scan", false);
|
||||
Services.prefs.setBoolPref("geo.provider.network.scan", false);
|
||||
|
||||
run_test_in_child("test_geolocation_reset_accuracy.js", check_results);
|
||||
}
|
||||
|
|
|
@ -48,9 +48,9 @@ function run_test() {
|
|||
httpserver = new HttpServer();
|
||||
httpserver.registerPathHandler("/geo", geoHandler);
|
||||
httpserver.start(-1);
|
||||
Services.prefs.setBoolPref("geo.wifi.scan", false);
|
||||
Services.prefs.setBoolPref("geo.provider.network.scan", false);
|
||||
Services.prefs.setCharPref(
|
||||
"geo.wifi.uri",
|
||||
"geo.provider.network.url",
|
||||
"http://localhost:" + httpserver.identity.primaryPort + "/geo"
|
||||
);
|
||||
Services.prefs.setBoolPref("dom.testing.ignore_ipc_principal", true);
|
||||
|
|
|
@ -4,12 +4,12 @@ const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
|||
var httpserver = null;
|
||||
|
||||
function run_test() {
|
||||
Services.prefs.setBoolPref("geo.wifi.scan", false);
|
||||
Services.prefs.setBoolPref("geo.provider.network.scan", false);
|
||||
|
||||
httpserver = new HttpServer();
|
||||
httpserver.start(-1);
|
||||
Services.prefs.setCharPref(
|
||||
"geo.wifi.uri",
|
||||
"geo.provider.network.url",
|
||||
"http://localhost:" + httpserver.identity.primaryPort + "/geo"
|
||||
);
|
||||
Services.prefs.setBoolPref("dom.testing.ignore_ipc_principal", true);
|
||||
|
|
|
@ -4030,8 +4030,30 @@ pref("network.psl.onUpdate_notify", false);
|
|||
pref("widget.wayland_vsync.enabled", false);
|
||||
#endif
|
||||
|
||||
// Timeout for outbound network geolocation provider XHR
|
||||
pref("geo.wifi.xhr.timeout", 60000);
|
||||
// All the Geolocation preferences are here.
|
||||
//
|
||||
#ifndef EARLY_BETA_OR_EARLIER
|
||||
pref("geo.provider.network.url", "https://www.googleapis.com/geolocation/v1/geolocate?key=%GOOGLE_LOCATION_SERVICE_API_KEY%");
|
||||
#else
|
||||
// Use MLS on Nightly and early Beta.
|
||||
pref("geo.provider.network.url", "https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%");
|
||||
#endif
|
||||
|
||||
// Timeout for outbound network geolocation provider.
|
||||
pref("geo.provider.network.timeout", 60000);
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
pref("geo.provider.use_corelocation", true);
|
||||
#endif
|
||||
|
||||
// Set to false if things are really broken.
|
||||
#ifdef XP_WIN
|
||||
pref("geo.provider.ms-windows-location", true);
|
||||
#endif
|
||||
|
||||
#if defined(MOZ_WIDGET_GTK) && defined(MOZ_GPSD)
|
||||
pref("geo.provider.use_gpsd", true);
|
||||
#endif
|
||||
|
||||
// Enable/Disable the device storage API for content
|
||||
pref("device.storage.enabled", false);
|
||||
|
|
|
@ -67,3 +67,5 @@ user_pref("media.block-autoplay-until-in-foreground", false);
|
|||
user_pref("toolkit.telemetry.coverage.endpoint.base", "http://localhost");
|
||||
// Don't ask for a request in testing unless explicitly set this as true.
|
||||
user_pref("media.geckoview.autoplay.request", false);
|
||||
// user_pref("geo.provider.network.url", "http://localhost/geoip-dummy");
|
||||
user_pref("geo.provider-country.network.url", "http://localhost/geoip-dummy");
|
||||
|
|
|
@ -128,10 +128,10 @@ user_pref("general.useragent.updates.url", "https://example.com/0/%APP_ID%");
|
|||
// Always use network provider for geolocation tests
|
||||
// so we bypass the OSX dialog raised by the corelocation provider
|
||||
user_pref("geo.provider.testing", true);
|
||||
user_pref("geo.wifi.logging.enabled", true);
|
||||
user_pref("geo.wifi.scan", false);
|
||||
user_pref("geo.wifi.timeToWaitBeforeSending", 2000);
|
||||
user_pref("geo.wifi.uri", "http://{server}/tests/dom/tests/mochitest/geolocation/network_geolocation.sjs");
|
||||
user_pref("geo.provider.network.logging.enabled", true);
|
||||
user_pref("geo.provider.network.scan", false);
|
||||
user_pref("geo.provider.network.timeToWaitBeforeSending", 2000);
|
||||
user_pref("geo.provider.network.url", "http://{server}/tests/dom/tests/mochitest/geolocation/network_geolocation.sjs");
|
||||
user_pref("gfx.color_management.force_srgb", true);
|
||||
user_pref("gfx.logging.level", 1);
|
||||
// We don't want to hit the real Firefox Accounts server for tests. We don't
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
add_task(async function test_geolocation_nopermission() {
|
||||
let GEO_URL = "http://mochi.test:8888/tests/dom/tests/mochitest/geolocation/network_geolocation.sjs";
|
||||
await SpecialPowers.pushPrefEnv({"set": [["geo.wifi.uri", GEO_URL]]});
|
||||
await SpecialPowers.pushPrefEnv({"set": [["geo.provider.network.url", GEO_URL]]});
|
||||
});
|
||||
|
||||
add_task(async function test_geolocation() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче