From d544cfcdd8aed01578fe6992bc2991af73694289 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Tue, 18 Jun 2013 12:31:56 -0400 Subject: [PATCH] Backed out changeset 9915f8dae4e5 (bug 867895) for xpcshell bustage and landing on the wrong branch. --- dom/src/geolocation/nsGeolocation.cpp | 6 -- dom/tests/unit/test_highaccuracy.js | 86 ------------------------ dom/tests/unit/test_highaccuracy_wrap.js | 52 -------------- dom/tests/unit/xpcshell.ini | 3 +- 4 files changed, 1 insertion(+), 146 deletions(-) delete mode 100644 dom/tests/unit/test_highaccuracy.js delete mode 100644 dom/tests/unit/test_highaccuracy_wrap.js diff --git a/dom/src/geolocation/nsGeolocation.cpp b/dom/src/geolocation/nsGeolocation.cpp index 5735d58b92d5..d5e8c0e48612 100644 --- a/dom/src/geolocation/nsGeolocation.cpp +++ b/dom/src/geolocation/nsGeolocation.cpp @@ -509,12 +509,6 @@ nsGeolocationRequest::MarkCleared() mTimeoutTimer = nullptr; } mCleared = true; - - // Attempt to save power when possible - if (WantsHighAccuracy()) { - nsRefPtr gs = nsGeolocationService::GetGeolocationService(); - gs->SetHigherAccuracy(false); - } } void diff --git a/dom/tests/unit/test_highaccuracy.js b/dom/tests/unit/test_highaccuracy.js deleted file mode 100644 index 8ce30e4c3793..000000000000 --- a/dom/tests/unit/test_highaccuracy.js +++ /dev/null @@ -1,86 +0,0 @@ -const Cc = Components.classes; -const Ci = Components.interfaces; - -const providerCID = Components.ID("{14aa4b81-e266-45cb-88f8-89595dece114}"); -const providerContract = "@mozilla.org/geolocation/provider;1"; - -var provider = { - QueryInterface: function eventsink_qi(iid) { - if (iid.equals(Components.interfaces.nsISupports) || - iid.equals(Components.interfaces.nsIFactory) || - iid.equals(Components.interfaces.nsIGeolocationProvider)) - return this; - throw Components.results.NS_ERROR_NO_INTERFACE; - }, - createInstance: function eventsink_ci(outer, iid) { - if (outer) - throw Components.results.NS_ERROR_NO_AGGREGATION; - return this.QueryInterface(iid); - }, - lockFactory: function eventsink_lockf(lock) { - throw Components.results.NS_ERROR_NOT_IMPLEMENTED; - }, - startup: function() { - }, - watch: function(callback, isPrivate) { - do_execute_soon(function() { - callback.update({coords: {latitude: 42, longitude: 42}, timestamp: 0}); - }); - }, - shutdown: function() { - }, - setHighAccuracy: function(enable) { - this._status = enable; - }, - _status: false -}; - -let runningInParent = true; -try { - runningInParent = Components.classes["@mozilla.org/xre/runtime;1"]. - getService(Components.interfaces.nsIXULRuntime).processType - == Components.interfaces.nsIXULRuntime.PROCESS_TYPE_DEFAULT; -} -catch (e) { } - -var geolocation; - -add_test(function() { - geolocation.getCurrentPosition(function() { - do_execute_soon(function() { - if (runningInParent) { - do_check_false(provider._status); - } - run_next_test(); - }); - }, null, {enableHighAccuracy: true, maxAge: 0}); -}); - -add_test(function() { - var watchId = geolocation.watchPosition(function() { - do_execute_soon(function() { - geolocation.clearWatch(watchId); - if (runningInParent) { - do_check_false(provider._status); - } - run_next_test(); - }); - }, null, {enableHighAccuracy: true, maxAge: 0}); -}); - -function run_test() -{ - if (runningInParent) { - Components.manager.nsIComponentRegistrar.registerFactory(providerCID, - "Unit test geo provider", providerContract, provider); - var catMan = Components.classes["@mozilla.org/categorymanager;1"] - .getService(Components.interfaces.nsICategoryManager); - - var prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch); - prefs.setBoolPref("geo.testing.ignore_ipc_principal", true); - prefs.setBoolPref("geo.wifi.scan", false); - } - - geolocation = Cc["@mozilla.org/geolocation;1"].createInstance(Ci.nsISupports); - run_next_test(); -} \ No newline at end of file diff --git a/dom/tests/unit/test_highaccuracy_wrap.js b/dom/tests/unit/test_highaccuracy_wrap.js deleted file mode 100644 index 4edd609906c6..000000000000 --- a/dom/tests/unit/test_highaccuracy_wrap.js +++ /dev/null @@ -1,52 +0,0 @@ -const Cc = Components.classes; -const Ci = Components.interfaces; - -const providerCID = Components.ID("{14aa4b81-e266-45cb-88f8-89595dece114}"); -const providerContract = "@mozilla.org/geolocation/provider;1"; - -var provider = { - QueryInterface: function eventsink_qi(iid) { - if (iid.equals(Components.interfaces.nsISupports) || - iid.equals(Components.interfaces.nsIFactory) || - iid.equals(Components.interfaces.nsIGeolocationProvider)) - return this; - throw Components.results.NS_ERROR_NO_INTERFACE; - }, - createInstance: function eventsink_ci(outer, iid) { - if (outer) - throw Components.results.NS_ERROR_NO_AGGREGATION; - return this.QueryInterface(iid); - }, - lockFactory: function eventsink_lockf(lock) { - throw Components.results.NS_ERROR_NOT_IMPLEMENTED; - }, - startup: function() { - }, - watch: function(callback, isPrivate) { - do_execute_soon(function() { - callback.update({coords: {latitude: 42, longitude: 42}, timestamp: 0}); - }); - }, - shutdown: function() { - }, - setHighAccuracy: function(enable) { - this._status = enable; - }, - _status: false -}; - -function run_test() { - Components.manager.nsIComponentRegistrar.registerFactory(providerCID, - "Unit test geo provider", providerContract, provider); - var catMan = Components.classes["@mozilla.org/categorymanager;1"] - .getService(Components.interfaces.nsICategoryManager); - - var prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch); - prefs.setBoolPref("geo.testing.ignore_ipc_principal", true); - prefs.setBoolPref("geo.wifi.scan", false); - - run_test_in_child("test_highaccuracy.js", function() { - do_check_false(provider._status); - do_test_finished(); - }); -} \ No newline at end of file diff --git a/dom/tests/unit/xpcshell.ini b/dom/tests/unit/xpcshell.ini index 5ba115eec7d8..e4dc5103a380 100644 --- a/dom/tests/unit/xpcshell.ini +++ b/dom/tests/unit/xpcshell.ini @@ -9,6 +9,5 @@ tail = skip-if = os == "android" [test_geolocation_timeout.js] [test_geolocation_timeout_wrap.js] -[test_highaccuracy.js] -[test_highaccuracy_wrap.js]skip-if = os == "mac" +skip-if = os == "mac" skip-if = os == "android"