Bug 819213 - Change filter tests to use international format and reenable on TBPL, also remove previous changes by gwagner. r=gwagner, a=NPOTB
authorRob Wood <rwood@mozilla.com>
Thu, 13 Dec 2012 13:39:02 -0800
changeset 118952 1f02f40898ef0d42a7e563cf5d49b8f67003a931
parent 118951 7c1c3d33b3201430675f57c5809c0296610628ae
child 118953 9c021b033da63caa9cb3a6521ddaf7aa029efbc0
push id3001
push userryanvm@gmail.com
push dateTue, 18 Dec 2012 22:05:56 +0000
treeherdermozilla-aurora@63a5fb585e84 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgwagner, NPOTB
bugs819213
milestone19.0a2
Bug 819213 - Change filter tests to use international format and reenable on TBPL, also remove previous changes by gwagner. r=gwagner, a=NPOTB
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,