Bug 1216853 - B2G RIL: chain promises properly in test_network_interface_mtu.js. r=echen
authorJessica Jong <jjong@mozilla.com>
Thu, 22 Oct 2015 15:43:48 +0800
changeset 304202 1280b5e0bbcf041563edf23c3aa38336d1afe464
parent 304201 69eaa3d5acc5175ae140d6da75f700710902a785
child 304203 18315e28bc6e245560e2ea8a207bf1e97c8596df
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersechen
bugs1216853
milestone44.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 1216853 - B2G RIL: chain promises properly in test_network_interface_mtu.js. r=echen
dom/system/gonk/tests/marionette/test_network_interface_mtu.js
--- a/dom/system/gonk/tests/marionette/test_network_interface_mtu.js
+++ b/dom/system/gonk/tests/marionette/test_network_interface_mtu.js
@@ -27,17 +27,17 @@ function verifyInitialState() {
   // Data should be off before starting any test.
   return getSettings(SETTINGS_KEY_DATA_ENABLED)
     .then(value => {
       is(value, false, "Data must be off");
     });
 }
 
 function verifyMtu(aInterfaceName, aMtu) {
-  runEmulatorShellCmdSafe(['ip', 'link', 'show', 'dev', aInterfaceName])
+  return runEmulatorShellCmdSafe(['ip', 'link', 'show', 'dev', aInterfaceName])
     .then(aLines => {
       // Sample output:
       //
       // 4: rmnet0: <BROADCAST,MULTICAST> mtu 1410 qdisc pfifo_fast state DOWN mode DEFAULT qlen 1000
       // link/ether 52:54:00:12:34:58 brd ff:ff:ff:ff:ff:ff
       //
       let mtu;
       aLines.some(function (aLine) {
@@ -54,32 +54,28 @@ function verifyMtu(aInterfaceName, aMtu)
       is(mtu, aMtu, aInterfaceName + "'s mtu.");
     });
 }
 
 function testDefaultDataCallMtu() {
   log("= testDefaultDataCallMtu =");
 
   return setDataEnabledAndWait(true)
-    .then(aNetworkInfo => {
-      verifyMtu(aNetworkInfo.name, TEST_MTU1);
-    })
+    .then(aNetworkInfo => verifyMtu(aNetworkInfo.name, TEST_MTU1))
     .then(() => setDataEnabledAndWait(false));
 }
 
 function testNonDefaultDataCallMtu() {
   log("= testNonDefaultDataCallMtu =");
 
   function doTestNonDefaultDataCallMtu(aType) {
     log("doTestNonDefaultDataCallMtu: " + aType);
 
     return setupDataCallAndWait(aType)
-      .then(aNetworkInfo => {
-        verifyMtu(aNetworkInfo.name, TEST_MTU2);
-      })
+      .then(aNetworkInfo => verifyMtu(aNetworkInfo.name, TEST_MTU2))
       .then(() => deactivateDataCallAndWait(aType));
   }
 
   return doTestNonDefaultDataCallMtu(NETWORK_TYPE_MOBILE_MMS)
     .then(() => doTestNonDefaultDataCallMtu(NETWORK_TYPE_MOBILE_SUPL))
     .then(() => doTestNonDefaultDataCallMtu(NETWORK_TYPE_MOBILE_IMS))
     .then(() => doTestNonDefaultDataCallMtu(NETWORK_TYPE_MOBILE_DUN))
     .then(() => doTestNonDefaultDataCallMtu(NETWORK_TYPE_MOBILE_FOTA));