Bug 1159132 - Part 2: Set ro.tethering.dun_required when running dun test case. r=echen
authorJessica Jong <jjong>
Mon, 04 May 2015 02:33:00 -0400
changeset 242543 b086661e0d37c24ff8a6fa868abb9e69bd550edf
parent 242542 71960acb863331d7b80fbf3408d4f9c2c70944bd
child 242544 bdd9a31287d7bad35bc42e93c9ed51ff8b69825b
push id28699
push userryanvm@gmail.com
push dateWed, 06 May 2015 20:01:37 +0000
treeherdermozilla-central@b2a742938d64 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersechen
bugs1159132
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1159132 - Part 2: Set ro.tethering.dun_required when running dun test case. r=echen
dom/tethering/tests/marionette/head.js
dom/tethering/tests/marionette/manifest.ini
dom/tethering/tests/marionette/test_wifi_tethering_dun.js
--- a/dom/tethering/tests/marionette/head.js
+++ b/dom/tethering/tests/marionette/head.js
@@ -214,16 +214,24 @@ let gTestSuite = (function() {
   /**
    * Convenient MozSettings setter for SETTINGS_KEY_DATA_APN_SETTINGS.
    */
   function setDataApnSettings(aApnSettings, aAllowError) {
     return setSettings1(SETTINGS_KEY_DATA_APN_SETTINGS, aApnSettings, aAllowError);
   }
 
   /**
+   * Set 'ro.tethering.dun_required' system property to 1. Note that this is a
+   * 'ro' property, it can only be set once.
+   */
+  function setTetheringDunRequired() {
+    return runEmulatorShellSafe(['setprop', 'ro.tethering.dun_required', '1']);
+  }
+
+  /**
    * Wrap DOMRequest onsuccess/onerror events to Promise resolve/reject.
    *
    * Fulfill params: A DOMEvent.
    * Reject params: A DOMEvent.
    *
    * @param aRequest
    *        A DOMRequest instance.
    *
@@ -699,16 +707,17 @@ let gTestSuite = (function() {
 
   //---------------------------------------------------
   // Public test suite functions
   //---------------------------------------------------
   suite.ensureWifiEnabled = ensureWifiEnabled;
   suite.setWifiTetheringEnabled = setWifiTetheringEnabled;
   suite.getDataApnSettings = getDataApnSettings;
   suite.setDataApnSettings = setDataApnSettings;
+  suite.setTetheringDunRequired = setTetheringDunRequired;
 
 
   /**
    * The common test routine for wifi tethering.
    *
    * Set 'ril.data.enabled' to true
    * before testing and restore it afterward. It will also verify 'ril.data.enabled'
    * and 'tethering.wifi.enabled' to be false in the beginning. Note that this routine
--- a/dom/tethering/tests/marionette/manifest.ini
+++ b/dom/tethering/tests/marionette/manifest.ini
@@ -1,7 +1,9 @@
 [DEFAULT]
 b2g = true
 browser = false
 qemu = true
 
 [test_wifi_tethering_enabled.js]
+; The following test must be the last tethering test ran, as it sets the
+; 'ro.tethering.dun_required' property.
 [test_wifi_tethering_dun.js]
--- a/dom/tethering/tests/marionette/test_wifi_tethering_dun.js
+++ b/dom/tethering/tests/marionette/test_wifi_tethering_dun.js
@@ -17,16 +17,17 @@ gTestSuite.startTest(function() {
                              "apn": "epc1.tmobile.com",
                              "mmsc": "http://mms.msg.eng.t-mobile.com/mms/wapenc",
                              "types": ["default","supl","mms"] },
                            { "carrier": "T-Mobile US",
                              "apn": "epc2.tmobile.com",
                              "types": ["dun"] } ]];
       return gTestSuite.setDataApnSettings(apnSettings);
     })
+    .then(() => gTestSuite.setTetheringDunRequired())
     .then(() => gTestSuite.startTetheringTest(function() {
       return gTestSuite.ensureWifiEnabled(false)
         .then(() => gTestSuite.setWifiTetheringEnabled(true, true))
         .then(() => gTestSuite.setWifiTetheringEnabled(false, true));
     }))
     // Restore apn settings.
     .then(() => {
       if (origApnSettings) {