B2G/QA/WebAPI Test Plan/Geolocation: Difference between revisions

 
(11 intermediate revisions by the same user not shown)
Line 32: Line 32:
== Strategy ==
== Strategy ==
* There are already mochitests for the Geolocation API here: http://mxr.mozilla.org/mozilla-central/source/dom/tests/mochitest/geolocation/
* There are already mochitests for the Geolocation API here: http://mxr.mozilla.org/mozilla-central/source/dom/tests/mochitest/geolocation/
* UI testing related to the Geolocation API - tbd - john Hammink, Matt Brandt
* A test app should be created to verify the API on-device.
* A test app should be created to verify the API on-device.


Line 42: Line 41:
** Full screen
** Full screen
** Private browsing mode
** Private browsing mode
** related prefs: ?
** related prefs: geolocation.enabled, geo.enabled , browser.geolocation.warning.infoURL , geo.wifi.uri , geo.wifi.access_token. , geo.gps.apn.name , geo.gps.apn.user , geo.gps.apn.password , geo.default.update , geo.gps.supl_server , geo.gps.supl_port , geo.wifi.logging.enabled, geo.wifi.access_token.recycle_interval , geo.prompt.testing, geo.prompt.testing.allow , geo.request.remember.


== API ==
== API ==
Line 56: Line 55:


==== Methods ====
==== Methods ====
* <tt>void getCurrentPosition(in nsIDOMGeoPositionCallback successCallback,
* <tt><nowiki>void getCurrentPosition(in nsIDOMGeoPositionCallback successCallback,
                           [optional] in nsIDOMGeoPositionErrorCallback errorCallback,
                           [optional] in nsIDOMGeoPositionErrorCallback errorCallback,
                           \/* GeoPositionOptions */
                           /* GeoPositionOptions */
                           [optional] in jsval options);</tt>
                           [optional] in jsval options);</nowiki></tt>
* <tt>long watchPosition(in nsIDOMGeoPositionCallback successCallback,
* <tt><nowiki>long watchPosition(in nsIDOMGeoPositionCallback successCallback,
                     [optional] in nsIDOMGeoPositionErrorCallback errorCallback,
                     [optional] in nsIDOMGeoPositionErrorCallback errorCallback,
                     /* GeoPositionOptions */
                     /* GeoPositionOptions */
                     [optional] in jsval options);</tt>
                     [optional] in jsval options);</nowiki></tt>
* <tt>void clearWatch(in long watchId);</tt>
* <tt>void clearWatch(in long watchId);</tt>


== Tests ==
== Tests ==
=== Marionette/JS ===
=== Marionette/JS ===
* https://bugzilla.mozilla.org/show_bug.cgi?id=777983 for writing a Marionette test for normal gps geolocation.
==== Basic Positive Tests ====
==== Basic Positive Tests ====


Line 73: Line 73:
* http://mxr.mozilla.org/mozilla-central/source/dom/tests/mochitest/geolocation/
* http://mxr.mozilla.org/mozilla-central/source/dom/tests/mochitest/geolocation/
* http://mxr.mozilla.org/mozilla-central/source/dom/tests/mochitest/chrome/test_geolocation.xul
* http://mxr.mozilla.org/mozilla-central/source/dom/tests/mochitest/chrome/test_geolocation.xul
* http://mxr.mozilla.org/mozilla-central/source/browser/components/privatebrowsing/test/unit/test_geoClearCookie.js


==== Sanity Tests ====
==== Sanity Tests ====


==== Basic Negative Tests ====
==== Basic Negative Tests ====


=== Test App Design ===
=== Test App Design ===
Line 89: Line 89:
----
----
<small>This page is based on the [[B2G/QA/WebAPI Test Plan/Template|WebAPI Test Plan Template]]</small>
<small>This page is based on the [[B2G/QA/WebAPI Test Plan/Template|WebAPI Test Plan Template]]</small>
=== TBD ===
* {{bug|715788}} - A-GPS for Gonk, what kind of testing needed for this?
* UI testing related to the Geolocation API - tbd - john Hammink, Matt Brandt
* Comments from Kanru for A-GPS testing:
** I filed https://bugzilla.mozilla.org/show_bug.cgi?id=777983 for writing a Marionette test to test normal GPS on emulator. The emulator could inject fake locations so we could test the basic GPS functionality.
** But the A-GPS is a bit hard to test because it needs real hardware and server support, and when it fails the GPS engine usually fallback to normal GPS silently. ** Several ways to do automated test that I can think of are (1) extend the emulator to support A-GPS callbacks (2) monitor if the GPS engine is requesting data connection or not (3) use a fake/proxy A-GPS server
** To turn it on you have to add these prefs:
  pref("geo.gps.supl_server", "supl.google.com");
  pref("geo.gps.supl_port", 7276);
  pref("geo.gps.apn.name", "internet");
  pref("geo.gps.apn.user", "");
  pref("geo.gps.apn.password", "");
** where the "geo.gps.apn.name" is the APN for data connection.
Confirmed users
486

edits