Bug 819213 - Change filter tests to use international format and reenable on TBPL, also remove previous changes by gwagner. r=gwagner
authorRob Wood <rwood@mozilla.com>
Thu, 13 Dec 2012 13:39:02 -0800
changeset 125437 8ef4348286d57dc50673d855afc0b7ab61fc174d
parent 125436 87ec624190f251450623789c9f315e721fe7202a
child 125438 69dd94ceaf7e856f7cfdf8f5e74dff13b0260e9e
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgwagner
bugs819213
milestone20.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 819213 - Change filter tests to use international format and reenable on TBPL, also remove previous changes by gwagner. r=gwagner
dom/sms/tests/marionette/manifest.ini
dom/sms/tests/marionette/test_filter_number_multiple.js
dom/sms/tests/marionette/test_filter_number_single.js
--- a/dom/sms/tests/marionette/manifest.ini
+++ b/dom/sms/tests/marionette/manifest.ini
@@ -10,18 +10,18 @@ qemu = true
 [test_incoming_delete.js]
 [test_outgoing_delete.js]
 [test_getmessage.js]
 [test_getmessage_notfound.js]
 [test_incoming_multipart.js]
 [test_getmessages.js]
 [test_filter_date.js]
 [test_filter_date_notfound.js]
-;[test_filter_number_single.js]
-;[test_filter_number_multiple.js]
+[test_filter_number_single.js]
+[test_filter_number_multiple.js]
 [test_filter_received.js]
 [test_filter_sent.js]
 [test_filter_read.js]
 [test_filter_unread.js]
 [test_number_of_messages.js]
 [test_mark_msg_read.js]
 [test_mark_msg_read_error.js]
 [test_bug814761.js]
--- a/dom/sms/tests/marionette/test_filter_number_multiple.js
+++ b/dom/sms/tests/marionette/test_filter_number_multiple.js
@@ -4,17 +4,17 @@
 MARIONETTE_TIMEOUT = 20000;
 
 SpecialPowers.addPermission("sms", true, document);
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
 
 let sms = window.navigator.mozSms;
 let numberMsgs = 10;
 let smsList = new Array();
-let defaultRemoteNumber = "5552227777";
+let defaultRemoteNumber = "+15552227777";
 
 function verifyInitialState() {
   log("Verifying initial state.");
   ok(sms, "mozSms");
   // Ensure test is starting clean with no existing sms messages
   deleteAllMsgs(sendSms);
 }
 
@@ -90,17 +90,17 @@ function deleteMsgs(msgList, nextFunctio
     cleanUp();
   };
 }
 
 function sendSms() {
   // Send an SMS to a unique number that will fall outside of the filter
   let gotSmsSent = false;
   let gotRequestSuccess = false;
-  let remoteNumber = "5558120649";
+  let remoteNumber = "+15558120649";
   let text = "Outgoing SMS brought to you by Firefox OS!";
 
   log("Sending an SMS.");
 
   sms.onsent = function(event) {
     log("Received 'onsent' smsmanager event.");
     gotSmsSent = true;
     log("Sent SMS (id: " + event.message.id + ").");
@@ -164,17 +164,17 @@ sms.onreceived = function onreceived(eve
   // Wait for emulator to catch up before continuing
   waitFor(nextRep,function() {
     return(rcvdEmulatorCallback);
   });
 };
 
 function nextRep() {
   // Keep simulating incoming messages until have received specified number
-  let secondNumber = "5559990000";
+  let secondNumber = "+15559990000";
   if (smsList.length < (numberMsgs - 1)) {
     // Have every other SMS be from different number, so filter won't find all
     if (smsList.length % 2) {
       simulateIncomingSms(secondNumber);
     } else {
       simulateIncomingSms();
     }
   } else {
--- a/dom/sms/tests/marionette/test_filter_number_single.js
+++ b/dom/sms/tests/marionette/test_filter_number_single.js
@@ -4,18 +4,17 @@
 MARIONETTE_TIMEOUT = 20000;
 
 SpecialPowers.addPermission("sms", true, document);
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
 
 let sms = window.navigator.mozSms;
 let numberMsgs = 10;
 let smsList = new Array();
-let defaultRemoteNumber = "5552227777";
-let defaultRemoteNumberFormats = ["5552227777", "+15552227777"];
+let defaultRemoteNumber = "+15552227777";
 
 function verifyInitialState() {
   log("Verifying initial state.");
   ok(sms, "mozSms");
   // Ensure test is starting clean with no existing sms messages
   deleteAllMsgs(simulateIncomingSms);
 }
 
@@ -123,33 +122,33 @@ sms.onreceived = function onreceived(eve
   });
 };
 
 function nextRep() {
   // Keep simulating incoming messages until have received specified number
   if (smsList.length < numberMsgs) {
     // Have every other sms be from different number, so filter won't find all
     if (smsList.length % 2) {
-      simulateIncomingSms("5559990000");
+      simulateIncomingSms("+15559990000");
     } else {
       simulateIncomingSms();
     }
   } else {
     getMsgs();
   }
 }
 
 function getMsgs() {
   // Set the filter and test it via getMessages
   var filter = new MozSmsFilter();
   let foundSmsList = new Array();
 
   // Going to filter for one number only, so set our expected SMS array
   smsList = smsList.filter(function(i) {
-    return defaultRemoteNumberFormats.indexOf(i.sender) >= 0 ? true : false;
+    return i.sender != defaultRemoteNumber ? false: true;
   });
 
   // Set filter for default remote number
   filter.numbers = new Array(defaultRemoteNumber);
 
   log("Getting the SMS messages from sender " + defaultRemoteNumber + ".");
   let request = sms.getMessages(filter, false);
   ok(request instanceof MozSmsRequest,