mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
ae138d0b78
--HG-- extra : rebase_source : 7f10d1d8486500e569cffea937d7a06bfa67dded
42 lines
1.0 KiB
JavaScript
42 lines
1.0 KiB
JavaScript
|
|
const Ci = Components.interfaces;
|
|
const Cc = Components.classes;
|
|
|
|
function successCallback(pos){}
|
|
|
|
var observer = {
|
|
QueryInterface: function(iid) {
|
|
if (iid.equals(Components.interfaces.nsISupports) ||
|
|
iid.equals(Components.interfaces.nsIObserver))
|
|
return this;
|
|
throw Components.results.NS_ERROR_NO_INTERFACE;
|
|
},
|
|
|
|
observe: function(subject, topic, data) {
|
|
if (data == "shutdown") {
|
|
do_check_true(1)
|
|
do_test_finished();
|
|
}
|
|
else if (data == "starting") {
|
|
do_check_true(1)
|
|
}
|
|
|
|
},
|
|
};
|
|
|
|
|
|
function run_test()
|
|
{
|
|
// only kill this test when shutdown is called on the provider.
|
|
do_test_pending();
|
|
|
|
var obs = Cc["@mozilla.org/observer-service;1"].getService();
|
|
obs = obs.QueryInterface(Ci.nsIObserverService);
|
|
obs.addObserver(observer, "geolocation-device-events", false);
|
|
|
|
var geolocation = Cc["@mozilla.org/geolocation;1"].getService(Ci.nsIDOMGeoGeolocation);
|
|
var watchID = geolocation.watchPosition(successCallback);
|
|
do_timeout(1000, function() { geolocation.clearWatch(watchID);})
|
|
}
|
|
|