mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-26 18:37:31 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
36
dom/tests/unit/test_geolocation_position_unavailable.js
Normal file
36
dom/tests/unit/test_geolocation_position_unavailable.js
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
var Cc = Components.classes;
|
||||
var Ci = Components.interfaces;
|
||||
var Cu = Components.utils;
|
||||
var Cr = Components.results;
|
||||
|
||||
|
||||
function successCallback() {
|
||||
do_check_true(false);
|
||||
do_test_finished();
|
||||
}
|
||||
|
||||
function errorCallback(err) {
|
||||
do_check_eq(Ci.nsIDOMGeoPositionError.POSITION_UNAVAILABLE, err.code);
|
||||
do_test_finished();
|
||||
}
|
||||
|
||||
function run_test()
|
||||
{
|
||||
do_test_pending();
|
||||
|
||||
if (Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime)
|
||||
.processType == Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT) {
|
||||
// XPCShell does not get a profile by default. The geolocation service
|
||||
// depends on the settings service which uses IndexedDB and IndexedDB
|
||||
// needs a place where it can store databases.
|
||||
do_get_profile();
|
||||
|
||||
var prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
|
||||
prefs.setBoolPref("geo.wifi.scan", false);
|
||||
prefs.setCharPref("geo.wifi.uri", "UrlNotUsedHere:");
|
||||
prefs.setBoolPref("dom.testing.ignore_ipc_principal", true);
|
||||
}
|
||||
|
||||
geolocation = Cc["@mozilla.org/geolocation;1"].getService(Ci.nsISupports);
|
||||
geolocation.getCurrentPosition(successCallback, errorCallback);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue