зеркало из https://github.com/mozilla/gecko-dev.git
Bug 850442 - Part 4 - Make nsIDOMGeoGeolocation non-scriptable. r=bz
This commit is contained in:
Родитель
bc55011071
Коммит
60b4bd6ca2
|
@ -20,7 +20,7 @@ dictionary GeoPositionOptions
|
|||
|
||||
[ptr] native NamespacedGeoPositionOptions(mozilla::idl::GeoPositionOptions);
|
||||
|
||||
[scriptable, builtinclass, uuid(1bc7d103-c7ae-4467-881c-21a8dfa17938)]
|
||||
[builtinclass, uuid(1bc7d103-c7ae-4467-881c-21a8dfa17938)]
|
||||
interface nsIDOMGeoGeolocation : nsISupports
|
||||
{
|
||||
int32_t watchPosition(in nsIDOMGeoPositionCallback callback,
|
||||
|
|
|
@ -15,7 +15,7 @@ SimpleTest.waitForExplicitFinish();
|
|||
const Ci = Components.interfaces;
|
||||
const Cc = Components.classes;
|
||||
|
||||
var geolocation = Cc["@mozilla.org/geolocation;1"].getService(Ci.nsIDOMGeoGeolocation);
|
||||
var geolocation = Cc["@mozilla.org/geolocation;1"].getService(Ci.nsISupports);
|
||||
geolocation.getCurrentPosition(done, error);
|
||||
|
||||
function error(error)
|
||||
|
|
|
@ -68,7 +68,7 @@ function run_test()
|
|||
prefs.setBoolPref("geo.wifi.scan", false);
|
||||
}
|
||||
|
||||
geolocation = Cc["@mozilla.org/geolocation;1"].createInstance(Ci.nsIDOMGeoGeolocation);
|
||||
geolocation = Cc["@mozilla.org/geolocation;1"].createInstance(Ci.nsISupports);
|
||||
geolocation.getCurrentPosition(function() {
|
||||
geolocation.getCurrentPosition(function() {
|
||||
if (runningInParent) {
|
||||
|
|
|
@ -81,6 +81,6 @@ function run_test()
|
|||
obs = obs.QueryInterface(Ci.nsIObserverService);
|
||||
obs.addObserver(observer, "geolocation-device-events", false);
|
||||
|
||||
geolocation = Cc["@mozilla.org/geolocation;1"].getService(Ci.nsIDOMGeoGeolocation);
|
||||
geolocation = Cc["@mozilla.org/geolocation;1"].getService(Ci.nsISupports);
|
||||
watchID = geolocation.watchPosition(successCallback, errorCallback);
|
||||
}
|
||||
|
|
|
@ -57,6 +57,6 @@ function run_test()
|
|||
prefs.setBoolPref("geo.testing.ignore_ipc_principal", true);
|
||||
}
|
||||
|
||||
geolocation = Cc["@mozilla.org/geolocation;1"].getService(Ci.nsIDOMGeoGeolocation);
|
||||
geolocation = Cc["@mozilla.org/geolocation;1"].getService(Ci.nsISupports);
|
||||
geolocation.getCurrentPosition(successCallback, errorCallback, {timeout: 2000});
|
||||
}
|
||||
|
|
|
@ -50,13 +50,13 @@ function run_test()
|
|||
}
|
||||
|
||||
let timesCalled = 0;
|
||||
geolocation = Cc["@mozilla.org/geolocation;1"].createInstance(Ci.nsIDOMGeoGeolocation);
|
||||
geolocation = Cc["@mozilla.org/geolocation;1"].createInstance(Ci.nsISupports);
|
||||
geolocation.watchPosition(function(pos) {
|
||||
do_check_eq(++timesCalled, 1);
|
||||
do_check_eq(pos.coords.accuracy, gAccuracy);
|
||||
|
||||
gAccuracy = 420;
|
||||
geolocation2 = Cc["@mozilla.org/geolocation;1"].createInstance(Ci.nsIDOMGeoGeolocation);
|
||||
geolocation2 = Cc["@mozilla.org/geolocation;1"].createInstance(Ci.nsISupports);
|
||||
geolocation2.getCurrentPosition(function(pos) {
|
||||
do_check_eq(pos.coords.accuracy, gAccuracy);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче