Bug 883798 - B2G SMS: test cases should initialize all necessary preferences and/or settings. r=gene
authorVicamo Yang <vyang@mozilla.com>
Wed, 19 Jun 2013 10:18:39 +0800
changeset 147071 277745c01bb2ef94930b4d71447ac31b8ec846f3
parent 147070 de0513bf0957729d4b17e04f55314e1518ed946d
child 147072 4e8ac15309c648d0e0e65fb9975d1304316f9b8f
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgene
bugs883798
milestone24.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 883798 - B2G SMS: test cases should initialize all necessary preferences and/or settings. r=gene
dom/mobilemessage/tests/marionette/test_getmessage.js
dom/mobilemessage/tests/marionette/test_outgoing.js
dom/mobilemessage/tests/marionette/test_outgoing_delete.js
--- a/dom/mobilemessage/tests/marionette/test_getmessage.js
+++ b/dom/mobilemessage/tests/marionette/test_getmessage.js
@@ -1,14 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 MARIONETTE_TIMEOUT = 60000;
 
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
+SpecialPowers.setBoolPref("dom.sms.requestStatusReport", true);
 SpecialPowers.addPermission("sms", true, document);
 
 const REMOTE = "5559997777"; // the remote number
 const EMULATOR = "15555215554"; // the emulator's number
 
 let sms = window.navigator.mozSms;
 let inText = "Incoming SMS message. Mozilla Firefox OS!";
 let outText = "Outgoing SMS message. Mozilla Firefox OS!";
@@ -208,14 +209,16 @@ function deleteMsgs() {
         + event.target.error.name );
     cleanUp();
   };
 }
 
 function cleanUp() {
   sms.onreceived = null;
   SpecialPowers.removePermission("sms", document);
-  SpecialPowers.setBoolPref("dom.sms.enabled", false);
+  SpecialPowers.clearUserPref("dom.sms.enabled", false);
+  SpecialPowers.clearUserPref("dom.sms.requestStatusReport");
+
   finish();
 }
 
 // Start the test
 verifyInitialState();
--- a/dom/mobilemessage/tests/marionette/test_outgoing.js
+++ b/dom/mobilemessage/tests/marionette/test_outgoing.js
@@ -1,15 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 MARIONETTE_TIMEOUT = 60000;
 
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
 SpecialPowers.setBoolPref("dom.sms.strict7BitEncoding", false);
+SpecialPowers.setBoolPref("dom.sms.requestStatusReport", true);
 SpecialPowers.addPermission("sms", true, document);
 
 const SENDER = "15555215554"; // the emulator's number
 
 let sms = window.navigator.mozSms;
 const SHORT_BODY = "Hello SMS world!";
 const LONG_BODY = "Let me not to the marriage of true minds\n"
                 + "Admit impediments. Love is not love\n"
@@ -180,12 +181,13 @@ function testSendMessageToMultipleRecipi
   // TODO: bug 788928 - add test cases for nsIDOMSmsManager.ondelivered event
   doSendMessageAndCheckSuccess(["1", "2"], SHORT_BODY, cleanUp);
 }
 
 function cleanUp() {
   SpecialPowers.removePermission("sms", document);
   SpecialPowers.clearUserPref("dom.sms.enabled");
   SpecialPowers.clearUserPref("dom.sms.strict7BitEncoding");
+  SpecialPowers.clearUserPref("dom.sms.requestStatusReport");
   finish();
 }
 
 testSendMessage();
--- a/dom/mobilemessage/tests/marionette/test_outgoing_delete.js
+++ b/dom/mobilemessage/tests/marionette/test_outgoing_delete.js
@@ -1,14 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 MARIONETTE_TIMEOUT = 60000;
 
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
+SpecialPowers.setBoolPref("dom.sms.requestStatusReport", true);
 SpecialPowers.addPermission("sms", true, document);
 
 const SENDER = "15555215554"; // the emulator's number
 const RECEIVER = "5551117777"; // the destination number
 
 let sms = window.navigator.mozSms;
 let msgText = "Mozilla Firefox OS!";
 let gotSmsOnsent = false;
@@ -147,14 +148,15 @@ function verifySmsDeleted(smsId) {
     log("Could not get SMS (id: " + smsId + ") as expected.");
     cleanUp();
   };
 }
 
 function cleanUp() {
   sms.onsent = null;
   SpecialPowers.removePermission("sms", document);
-  SpecialPowers.setBoolPref("dom.sms.enabled", false);
+  SpecialPowers.clearUserPref("dom.sms.enabled", false);
+  SpecialPowers.clearUserPref("dom.sms.requestStatusReport");
   finish();
 }
 
 // Start the test
 verifyInitialState();