Bug 838467 5/5: test cases. r=gwagner, a=leo+
authorVicamo Yang <vyang@mozilla.com>
Thu, 18 Apr 2013 09:09:38 +0800
changeset 119095 28446a795700e64bf5ed7b8c1bb6e08e68eba30b
parent 119094 a60ba4e8f79d3191db7905276025f30dedc513e5
child 119096 585bc5156688d95d17f1f4a1bda61d63f6057d57
push id680
push uservyang@mozilla.com
push dateThu, 18 Apr 2013 01:11:41 +0000
reviewersgwagner, leo
bugs838467
milestone18.0
Bug 838467 5/5: test cases. r=gwagner, a=leo+
dom/mobilemessage/tests/marionette/test_filter_date.js
dom/mobilemessage/tests/marionette/test_filter_date_notfound.js
dom/mobilemessage/tests/marionette/test_filter_mixed.js
dom/mobilemessage/tests/marionette/test_filter_number_multiple.js
dom/mobilemessage/tests/marionette/test_filter_number_single.js
dom/mobilemessage/tests/marionette/test_filter_read.js
dom/mobilemessage/tests/marionette/test_filter_received.js
dom/mobilemessage/tests/marionette/test_filter_sent.js
dom/mobilemessage/tests/marionette/test_filter_unread.js
dom/mobilemessage/tests/marionette/test_getmessages.js
dom/mobilemessage/tests/marionette/test_message_classes.js
dom/mobilemessage/tests/test_sms_basics.html
dom/tests/mochitest/general/test_interfaces.html
--- a/dom/mobilemessage/tests/marionette/test_filter_date.js
+++ b/dom/mobilemessage/tests/marionette/test_filter_date.js
@@ -16,42 +16,40 @@ function verifyInitialState() {
   // Ensure test is starting clean with no existing sms messages
   deleteAllMsgs(simulateIncomingSms);
 }
 
 function deleteAllMsgs(nextFunction) {
   let msgList = new Array();
   let filter = new MozSmsFilter;
 
-  let request = sms.getMessages(filter, false);
-  ok(request instanceof MozSmsRequest,
-      "request is instanceof " + request.constructor);
+  let cursor = sms.getMessages(filter, false);
+  ok(cursor instanceof DOMCursor,
+      "cursor is instanceof " + cursor.constructor);
 
-  request.onsuccess = function(event) {
-    ok(event.target.result, "smsrequest event.target.result");
-    cursor = event.target.result;
+  cursor.onsuccess = function(event) {
     // Check if message was found
-    if (cursor.message) {
-      msgList.push(cursor.message.id);
+    if (cursor.result) {
+      msgList.push(cursor.result.id);
       // Now get next message in the list
       cursor.continue();
     } else {
       // No (more) messages found
       if (msgList.length) {
         log("Found " + msgList.length + " SMS messages to delete.");
         deleteMsgs(msgList, nextFunction);
       } else {
         log("No SMS messages found.");
         nextFunction();
       }
     }
   };
 
-  request.onerror = function(event) {
-    log("Received 'onerror' smsrequest event.");
+  cursor.onerror = function(event) {
+    log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
     log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function deleteMsgs(msgList, nextFunction) {
@@ -133,30 +131,28 @@ function getMsgs() {
   // Set filter for start date yesterday and end date tomorrow
   let yesterday = new Date(Date.now() - 86400000); // 24 hours = 86400000 ms
   let tomorrow = new Date(Date.now() + 86400000);
   filter.startDate = yesterday;
   filter.endDate = tomorrow;
 
   log("Getting SMS messages with dates between " + yesterday + " and "
       + tomorrow +".");
-  let request = sms.getMessages(filter, false);
-  ok(request instanceof MozSmsRequest,
-      "request is instanceof " + request.constructor);
+  let cursor = sms.getMessages(filter, false);
+  ok(cursor instanceof DOMCursor,
+      "cursor is instanceof " + cursor.constructor);
 
-  request.onsuccess = function(event) {
-    log("Received 'onsuccess' smsrequest event.");
-    ok(event.target.result, "smsrequest event.target.result");
-    cursor = event.target.result;
+  cursor.onsuccess = function(event) {
+    log("Received 'onsuccess' event.");
 
-    if (cursor.message) {
+    if (cursor.result) {
       // Another message found
-      log("Got SMS (id: " + cursor.message.id + ").");
+      log("Got SMS (id: " + cursor.result.id + ").");
       // Store found message
-      foundSmsList.push(cursor.message);
+      foundSmsList.push(cursor.result);
       // Now get next message in the list
       cursor.continue();
     } else {
       // No more messages; ensure correct number found
       if (foundSmsList.length == smsList.length) {
         log("SMS getMessages returned " + foundSmsList.length +
             " messages as expected.");
         verifyFoundMsgs(foundSmsList);
@@ -164,18 +160,18 @@ function getMsgs() {
         log("SMS getMessages returned " + foundSmsList.length +
             " messages, but expected " + smsList.length + ".");
         ok(false, "Incorrect number of messages returned by sms.getMessages");
         deleteAllMsgs(cleanUp);
       }
     }
   };
 
-  request.onerror = function(event) {
-    log("Received 'onerror' smsrequest event.");
+  cursor.onerror = function(event) {
+    log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
     log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function verifyFoundMsgs(foundSmsList) {
--- a/dom/mobilemessage/tests/marionette/test_filter_date_notfound.js
+++ b/dom/mobilemessage/tests/marionette/test_filter_date_notfound.js
@@ -16,42 +16,40 @@ function verifyInitialState() {
   // Ensure test is starting clean with no existing sms messages
   deleteAllMsgs(simulateIncomingSms);
 }
 
 function deleteAllMsgs(nextFunction) {
   let msgList = new Array();
   let filter = new MozSmsFilter;
 
-  let request = sms.getMessages(filter, false);
-  ok(request instanceof MozSmsRequest,
-      "request is instanceof " + request.constructor);
+  let cursor = sms.getMessages(filter, false);
+  ok(cursor instanceof DOMCursor,
+      "cursor is instanceof " + cursor.constructor);
 
-  request.onsuccess = function(event) {
-    ok(event.target.result, "smsrequest event.target.result");
-    cursor = event.target.result;
+  cursor.onsuccess = function(event) {
     // Check if message was found
-    if (cursor.message) {
-      msgList.push(cursor.message.id);
+    if (cursor.result) {
+      msgList.push(cursor.result.id);
       // Now get next message in the list
       cursor.continue();
     } else {
       // No (more) messages found
       if (msgList.length) {
         log("Found " + msgList.length + " SMS messages to delete.");
         deleteMsgs(msgList, nextFunction);
       } else {
         log("No SMS messages found.");
         nextFunction();
       }
     }
   };
 
-  request.onerror = function(event) {
-    log("Received 'onerror' smsrequest event.");
+  cursor.onerror = function(event) {
+    log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
     log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function deleteMsgs(msgList, nextFunction) {
@@ -133,39 +131,37 @@ function getMsgs() {
   // Set filter for start date 2 days ago and end date yesterday (so 0 found)
   let yesterday = new Date(Date.now() - 86400000); // 24 hours = 86400000 ms
   let twoDaysAgo = new Date(Date.now() - 172800000);
   filter.startDate = twoDaysAgo;
   filter.endDate = yesterday;
 
   log("Getting SMS messages with dates between " + twoDaysAgo + " and "
       + yesterday +".");
-  let request = sms.getMessages(filter, false);
-  ok(request instanceof MozSmsRequest,
-      "request is instanceof " + request.constructor);
+  let cursor = sms.getMessages(filter, false);
+  ok(cursor instanceof DOMCursor,
+      "cursor is instanceof " + cursor.constructor);
 
-  request.onsuccess = function(event) {
-    log("Received 'onsuccess' smsrequest event.");
-    ok(event.target.result, "smsrequest event.target.result");
-    cursor = event.target.result;
+  cursor.onsuccess = function(event) {
+    log("Received 'onsuccess' event.");
 
-    if (cursor.message) {
+    if (cursor.result) {
       // Another message found
-      log("Got SMS (id: " + cursor.message.id + ").");
+      log("Got SMS (id: " + cursor.result.id + ").");
       log("SMS getMessages returned a message but should not have.");
       ok(false, "SMS date filter did not work");
     } else {
       // No messages found as expected
       log("SMS getMessages returned zero messages as expected.");
     }
     deleteAllMsgs(cleanUp);
   };
 
-  request.onerror = function(event) {
-    log("Received 'onerror' smsrequest event.");
+  cursor.onerror = function(event) {
+    log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
     log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function cleanUp() {
--- a/dom/mobilemessage/tests/marionette/test_filter_mixed.js
+++ b/dom/mobilemessage/tests/marionette/test_filter_mixed.js
@@ -59,20 +59,19 @@ let tasks = {
 
 function getAllMessages(callback, filter, reverse) {
   if (!filter) {
     filter = new MozSmsFilter;
   }
   let messages = [];
   let request = sms.getMessages(filter, reverse || false);
   request.onsuccess = function(event) {
-    let cursor = event.target.result;
-    if (cursor.message) {
-      messages.push(cursor.message);
-      cursor.continue();
+    if (request.result) {
+      messages.push(request.result);
+      request.continue();
       return;
     }
 
     window.setTimeout(callback.bind(null, messages), 0);
   }
 }
 
 function deleteAllMessages(next) {
--- a/dom/mobilemessage/tests/marionette/test_filter_number_multiple.js
+++ b/dom/mobilemessage/tests/marionette/test_filter_number_multiple.js
@@ -18,42 +18,40 @@ function verifyInitialState() {
   deleteAllMsgs(sendSms);
 }
 
 function deleteAllMsgs(nextFunction) {
   // Check for any existing SMS messages, if any are found delete them
   let msgList = new Array();
   let filter = new MozSmsFilter;
 
-  let request = sms.getMessages(filter, false);
-  ok(request instanceof MozSmsRequest,
-      "request is instanceof " + request.constructor);
+  let cursor = sms.getMessages(filter, false);
+  ok(cursor instanceof DOMCursor,
+      "cursor is instanceof " + cursor.constructor);
 
-  request.onsuccess = function(event) {
-    ok(event.target.result, "smsrequest event.target.result");
-    cursor = event.target.result;
+  cursor.onsuccess = function(event) {
     // Check if message was found
-    if (cursor.message) {
-      msgList.push(cursor.message.id);
+    if (cursor.result) {
+      msgList.push(cursor.result.id);
       // Now get next message in the list
       cursor.continue();
     } else {
       // No (more) messages found
       if (msgList.length) {
         log("Found " + msgList.length + " SMS messages to delete.");
         deleteMsgs(msgList, nextFunction);
       } else {
         log("No SMS messages found.");
         nextFunction();
       }
     }
   };
 
-  request.onerror = function(event) {
-    log("Received 'onerror' smsrequest event.");
+  cursor.onerror = function(event) {
+    log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
     log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function deleteMsgs(msgList, nextFunction) {
@@ -187,30 +185,28 @@ function getMsgs(secondNumber) {
   var filter = new MozSmsFilter();
   let foundSmsList = new Array();
 
   // Set filter for default and second number
   filter.numbers = new Array(defaultRemoteNumber, secondNumber);
 
   log("Getting the SMS messages with numbers " + defaultRemoteNumber + " and "
       + secondNumber + ".");
-  let request = sms.getMessages(filter, false);
-  ok(request instanceof MozSmsRequest,
-      "request is instanceof " + request.constructor);
+  let cursor = sms.getMessages(filter, false);
+  ok(cursor instanceof DOMCursor,
+      "cursor is instanceof " + cursor.constructor);
 
-  request.onsuccess = function(event) {
-    log("Received 'onsuccess' smsrequest event.");
-    ok(event.target.result, "smsrequest event.target.result");
-    cursor = event.target.result;
+  cursor.onsuccess = function(event) {
+    log("Received 'onsuccess' event.");
 
-    if (cursor.message) {
+    if (cursor.result) {
       // Another message found
-      log("Got SMS (id: " + cursor.message.id + ").");
+      log("Got SMS (id: " + cursor.result.id + ").");
       // Store found message
-      foundSmsList.push(cursor.message);
+      foundSmsList.push(cursor.result);
       // Now get next message in the list
       cursor.continue();
     } else {
       // No more messages; ensure correct number of SMS messages were found
       if (foundSmsList.length == smsList.length) {
         log("SMS getMessages returned " + foundSmsList.length +
             " messages as expected.");
         verifyFoundMsgs(foundSmsList);
@@ -218,18 +214,18 @@ function getMsgs(secondNumber) {
         log("SMS getMessages returned " + foundSmsList.length +
             " messages, but expected " + smsList.length + ".");
         ok(false, "Incorrect number of messages returned by sms.getMessages");
         deleteAllMsgs(cleanUp);
       }
     }
   };
 
-  request.onerror = function(event) {
-    log("Received 'onerror' smsrequest event.");
+  cursor.onerror = function(event) {
+    log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
     log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function verifyFoundMsgs(foundSmsList) {
--- a/dom/mobilemessage/tests/marionette/test_filter_number_single.js
+++ b/dom/mobilemessage/tests/marionette/test_filter_number_single.js
@@ -18,42 +18,40 @@ function verifyInitialState() {
   deleteAllMsgs(simulateIncomingSms);
 }
 
 function deleteAllMsgs(nextFunction) {
   // Check for any existing SMS messages, if any are found delete them
   let msgList = new Array();
   let filter = new MozSmsFilter;
 
-  let request = sms.getMessages(filter, false);
-  ok(request instanceof MozSmsRequest,
-      "request is instanceof " + request.constructor);
+  let cursor = sms.getMessages(filter, false);
+  ok(cursor instanceof DOMCursor,
+      "cursor is instanceof " + cursor.constructor);
 
-  request.onsuccess = function(event) {
-    ok(event.target.result, "smsrequest event.target.result");
-    cursor = event.target.result;
+  cursor.onsuccess = function(event) {
     // Check if message was found
-    if (cursor.message) {
-      msgList.push(cursor.message.id);
+    if (cursor.result) {
+      msgList.push(cursor.result.id);
       // Now get next message in the list
       cursor.continue();
     } else {
       // No (more) messages found
       if (msgList.length) {
         log("Found " + msgList.length + " SMS messages to delete.");
         deleteMsgs(msgList, nextFunction);
       } else {
         log("No SMS messages found.");
         nextFunction();
       }
     }
   };
 
-  request.onerror = function(event) {
-    log("Received 'onerror' smsrequest event.");
+  cursor.onerror = function(event) {
+    log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
     log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function deleteMsgs(msgList, nextFunction) {
@@ -145,30 +143,28 @@ function getMsgs() {
   smsList = smsList.filter(function(i) {
     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,
-      "request is instanceof " + request.constructor);
+  let cursor = sms.getMessages(filter, false);
+  ok(cursor instanceof DOMCursor,
+      "cursor is instanceof " + cursor.constructor);
 
-  request.onsuccess = function(event) {
-    log("Received 'onsuccess' smsrequest event.");
-    ok(event.target.result, "smsrequest event.target.result");
-    cursor = event.target.result;
+  cursor.onsuccess = function(event) {
+    log("Received 'onsuccess' event.");
 
-    if (cursor.message) {
+    if (cursor.result) {
       // Another message found
-      log("Got SMS (id: " + cursor.message.id + ").");
+      log("Got SMS (id: " + cursor.result.id + ").");
       // Store found message
-      foundSmsList.push(cursor.message);
+      foundSmsList.push(cursor.result);
       // Now get next message in the list
       cursor.continue();
     } else {
       // No more messages; ensure correct number of SMS messages were found
       if (foundSmsList.length == smsList.length) {
         log("SMS getMessages returned " + foundSmsList.length +
             " messages as expected.");
         verifyFoundMsgs(foundSmsList);
@@ -176,18 +172,18 @@ function getMsgs() {
         log("SMS getMessages returned " + foundSmsList.length +
             " messages, but expected " + smsList.length + ".");
         ok(false, "Incorrect number of messages returned by sms.getMessages");
         deleteAllMsgs(cleanUp);
       }
     }
   };
 
-  request.onerror = function(event) {
-    log("Received 'onerror' smsrequest event.");
+  cursor.onerror = function(event) {
+    log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
     log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function verifyFoundMsgs(foundSmsList) {
--- a/dom/mobilemessage/tests/marionette/test_filter_read.js
+++ b/dom/mobilemessage/tests/marionette/test_filter_read.js
@@ -16,42 +16,40 @@ function verifyInitialState() {
   // Ensure test is starting clean with no existing sms messages
   deleteAllMsgs(simulateIncomingSms);
 }
 
 function deleteAllMsgs(nextFunction) {
   let msgList = new Array();
   let filter = new MozSmsFilter;
 
-  let request = sms.getMessages(filter, false);
-  ok(request instanceof MozSmsRequest,
-      "request is instanceof " + request.constructor);
+  let cursor = sms.getMessages(filter, false);
+  ok(cursor instanceof DOMCursor,
+      "cursor is instanceof " + cursor.constructor);
 
-  request.onsuccess = function(event) {
-    ok(event.target.result, "smsrequest event.target.result");
-    cursor = event.target.result;
+  cursor.onsuccess = function(event) {
     // Check if message was found
-    if (cursor.message) {
-      msgList.push(cursor.message.id);
+    if (cursor.result) {
+      msgList.push(cursor.result.id);
       // Now get next message in the list
       cursor.continue();
     } else {
       // No (more) messages found
       if (msgList.length) {
         log("Found " + msgList.length + " SMS messages to delete.");
         deleteMsgs(msgList, nextFunction);
       } else {
         log("No SMS messages found.");
         nextFunction();
       }
     }
   };
 
-  request.onerror = function(event) {
-    log("Received 'onerror' smsrequest event.");
+  cursor.onerror = function(event) {
+    log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
     log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function deleteMsgs(msgList, nextFunction) {
@@ -165,30 +163,28 @@ function markMsgRead(smsMsgs) {
 function getMsgs() {
   var filter = new MozSmsFilter();
   let foundSmsList = new Array();
 
   // Set filter for read messages
   filter.read = true;
 
   log("Getting the read SMS messages.");
-  let request = sms.getMessages(filter, false);
-  ok(request instanceof MozSmsRequest,
-      "request is instanceof " + request.constructor);
+  let cursor = sms.getMessages(filter, false);
+  ok(cursor instanceof DOMCursor,
+      "cursor is instanceof " + cursor.constructor);
 
-  request.onsuccess = function(event) {
-    log("Received 'onsuccess' smsrequest event.");
-    ok(event.target.result, "smsrequest event.target.result");
-    cursor = event.target.result;
+  cursor.onsuccess = function(event) {
+    log("Received 'onsuccess' event.");
 
-    if (cursor.message) {
+    if (cursor.result) {
       // Another message found
-      log("Got SMS (id: " + cursor.message.id + ").");
+      log("Got SMS (id: " + cursor.result.id + ").");
       // Store found message
-      foundSmsList.push(cursor.message);
+      foundSmsList.push(cursor.result);
       // Now get next message in the list
       cursor.continue();
     } else {
       // No more messages; ensure correct number found
       if (foundSmsList.length == smsList.length) {
         log("SMS getMessages returned " + foundSmsList.length +
             " messages as expected.");
         verifyFoundMsgs(foundSmsList);
@@ -196,18 +192,18 @@ function getMsgs() {
         log("SMS getMessages returned " + foundSmsList.length +
             " messages, but expected " + smsList.length + ".");
         ok(false, "Incorrect number of messages returned by sms.getMessages");
         deleteAllMsgs(cleanUp);
       }
     }
   };
 
-  request.onerror = function(event) {
-    log("Received 'onerror' smsrequest event.");
+  cursor.onerror = function(event) {
+    log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
     log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function verifyFoundMsgs(foundSmsList) {
--- a/dom/mobilemessage/tests/marionette/test_filter_received.js
+++ b/dom/mobilemessage/tests/marionette/test_filter_received.js
@@ -16,42 +16,40 @@ function verifyInitialState() {
   // Ensure test is starting clean with no existing sms messages
   deleteAllMsgs(simulateIncomingSms);
 }
 
 function deleteAllMsgs(nextFunction) {
   let msgList = new Array();
   let filter = new MozSmsFilter;
 
-  let request = sms.getMessages(filter, false);
-  ok(request instanceof MozSmsRequest,
-      "request is instanceof " + request.constructor);
+  let cursor = sms.getMessages(filter, false);
+  ok(cursor instanceof DOMCursor,
+      "cursor is instanceof " + cursor.constructor);
 
-  request.onsuccess = function(event) {
-    ok(event.target.result, "smsrequest event.target.result");
-    cursor = event.target.result;
+  cursor.onsuccess = function(event) {
     // Check if message was found
-    if (cursor.message) {
-      msgList.push(cursor.message.id);
+    if (cursor.result) {
+      msgList.push(cursor.result.id);
       // Now get next message in the list
       cursor.continue();
     } else {
       // No (more) messages found
       if (msgList.length) {
         log("Found " + msgList.length + " SMS messages to delete.");
         deleteMsgs(msgList, nextFunction);
       } else {
         log("No SMS messages found.");
         nextFunction();
       }
     }
   };
 
-  request.onerror = function(event) {
-    log("Received 'onerror' smsrequest event.");
+  cursor.onerror = function(event) {
+    log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
     log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function deleteMsgs(msgList, nextFunction) {
@@ -177,30 +175,28 @@ function sendSms() {
 function getMsgs() {
   var filter = new MozSmsFilter();
   let foundSmsList = new Array();
 
   // Set filter for received messages
   filter.delivery = "received";
 
   log("Getting the received SMS messages.");
-  let request = sms.getMessages(filter, false);
-  ok(request instanceof MozSmsRequest,
-      "request is instanceof " + request.constructor);
+  let cursor = sms.getMessages(filter, false);
+  ok(cursor instanceof DOMCursor,
+      "cursor is instanceof " + cursor.constructor);
 
-  request.onsuccess = function(event) {
-    log("Received 'onsuccess' smsrequest event.");
-    ok(event.target.result, "smsrequest event.target.result");
-    cursor = event.target.result;
+  cursor.onsuccess = function(event) {
+    log("Received 'onsuccess' event.");
 
-    if (cursor.message) {
+    if (cursor.result) {
       // Another message found
-      log("Got SMS (id: " + cursor.message.id + ").");
+      log("Got SMS (id: " + cursor.result.id + ").");
       // Store found message
-      foundSmsList.push(cursor.message);
+      foundSmsList.push(cursor.result);
       // Now get next message in the list
       cursor.continue();
     } else {
       // No more messages; ensure correct number found
       if (foundSmsList.length == smsList.length) {
         log("SMS getMessages returned " + foundSmsList.length +
             " messages as expected.");
         verifyFoundMsgs(foundSmsList);
@@ -208,18 +204,18 @@ function getMsgs() {
         log("SMS getMessages returned " + foundSmsList.length +
             " messages, but expected " + smsList.length + ".");
         ok(false, "Incorrect number of messages returned by sms.getMessages");
         deleteAllMsgs(cleanUp);
       }
     }
   };
 
-  request.onerror = function(event) {
-    log("Received 'onerror' smsrequest event.");
+  cursor.onerror = function(event) {
+    log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
     log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function verifyFoundMsgs(foundSmsList) {
--- a/dom/mobilemessage/tests/marionette/test_filter_sent.js
+++ b/dom/mobilemessage/tests/marionette/test_filter_sent.js
@@ -16,42 +16,40 @@ function verifyInitialState() {
   // Ensure test is starting clean with no existing sms messages
   deleteAllMsgs(sendSms);
 }
 
 function deleteAllMsgs(nextFunction) {
   let msgList = new Array();
   let filter = new MozSmsFilter;
 
-  let request = sms.getMessages(filter, false);
-  ok(request instanceof MozSmsRequest,
-      "request is instanceof " + request.constructor);
+  let cursor = sms.getMessages(filter, false);
+  ok(cursor instanceof DOMCursor,
+      "cursor is instanceof " + cursor.constructor);
 
-  request.onsuccess = function(event) {
-    ok(event.target.result, "smsrequest event.target.result");
-    cursor = event.target.result;
+  cursor.onsuccess = function(event) {
     // Check if message was found
-    if (cursor.message) {
-      msgList.push(cursor.message.id);
+    if (cursor.result) {
+      msgList.push(cursor.result.id);
       // Now get next message in the list
       cursor.continue();
     } else {
       // No (more) messages found
       if (msgList.length) {
         log("Found " + msgList.length + " SMS messages to delete.");
         deleteMsgs(msgList, nextFunction);
       } else {
         log("No SMS messages found.");
         nextFunction();
       }
     }
   };
 
-  request.onerror = function(event) {
-    log("Received 'onerror' smsrequest event.");
+  cursor.onerror = function(event) {
+    log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
     log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function deleteMsgs(msgList, nextFunction) {
@@ -174,30 +172,28 @@ sms.onreceived = function onreceived(eve
 function getMsgs() {
   var filter = new MozSmsFilter();
   let foundSmsList = new Array();
 
   // Set filter for sent messages
   filter.delivery = "sent";
 
   log("Getting the sent SMS messages.");
-  let request = sms.getMessages(filter, false);
-  ok(request instanceof MozSmsRequest,
-      "request is instanceof " + request.constructor);
+  let cursor = sms.getMessages(filter, false);
+  ok(cursor instanceof DOMCursor,
+      "cursor is instanceof " + cursor.constructor);
 
-  request.onsuccess = function(event) {
-    log("Received 'onsuccess' smsrequest event.");
-    ok(event.target.result, "smsrequest event.target.result");
-    cursor = event.target.result;
+  cursor.onsuccess = function(event) {
+    log("Received 'onsuccess' event.");
 
-    if (cursor.message) {
+    if (cursor.result) {
       // Another message found
-      log("Got SMS (id: " + cursor.message.id + ").");
+      log("Got SMS (id: " + cursor.result.id + ").");
       // Store found message
-      foundSmsList.push(cursor.message);
+      foundSmsList.push(cursor.result);
       // Now get next message in the list
       cursor.continue();
     } else {
       // No more messages; ensure correct number found
       if (foundSmsList.length == smsList.length) {
         log("SMS getMessages returned " + foundSmsList.length +
             " messages as expected.");
         verifyFoundMsgs(foundSmsList);
@@ -205,18 +201,18 @@ function getMsgs() {
         log("SMS getMessages returned " + foundSmsList.length +
             " messages, but expected " + smsList.length + ".");
         ok(false, "Incorrect number of messages returned by sms.getMessages");
         deleteAllMsgs(cleanUp);
       }
     }
   };
 
-  request.onerror = function(event) {
-    log("Received 'onerror' smsrequest event.");
+  cursor.onerror = function(event) {
+    log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
     log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function verifyFoundMsgs(foundSmsList) {
--- a/dom/mobilemessage/tests/marionette/test_filter_unread.js
+++ b/dom/mobilemessage/tests/marionette/test_filter_unread.js
@@ -16,42 +16,40 @@ function verifyInitialState() {
   // Ensure test is starting clean with no existing sms messages
   deleteAllMsgs(simulateIncomingSms);
 }
 
 function deleteAllMsgs(nextFunction) {
   let msgList = new Array();
   let filter = new MozSmsFilter;
 
-  let request = sms.getMessages(filter, false);
-  ok(request instanceof MozSmsRequest,
-      "request is instanceof " + request.constructor);
+  let cursor = sms.getMessages(filter, false);
+  ok(cursor instanceof DOMCursor,
+      "cursor is instanceof " + cursor.constructor);
 
-  request.onsuccess = function(event) {
-    ok(event.target.result, "smsrequest event.target.result");
-    cursor = event.target.result;
+  cursor.onsuccess = function(event) {
     // Check if message was found
-    if (cursor.message) {
-      msgList.push(cursor.message.id);
+    if (cursor.result) {
+      msgList.push(cursor.result.id);
       // Now get next message in the list
       cursor.continue();
     } else {
       // No (more) messages found
       if (msgList.length) {
         log("Found " + msgList.length + " SMS messages to delete.");
         deleteMsgs(msgList, nextFunction);
       } else {
         log("No SMS messages found.");
         nextFunction();
       }
     }
   };
 
-  request.onerror = function(event) {
-    log("Received 'onerror' smsrequest event.");
+  cursor.onerror = function(event) {
+    log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
     log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function deleteMsgs(msgList, nextFunction) {
@@ -159,30 +157,28 @@ function markMsgRead() {
 function getMsgs() {
   var filter = new MozSmsFilter();
   let foundSmsList = new Array();
 
   // Set filter for read messages
   filter.read = false;
 
   log("Getting the unread SMS messages.");
-  let request = sms.getMessages(filter, false);
-  ok(request instanceof MozSmsRequest,
-      "request is instanceof " + request.constructor);
+  let cursor = sms.getMessages(filter, false);
+  ok(cursor instanceof DOMCursor,
+      "cursor is instanceof " + cursor.constructor);
 
-  request.onsuccess = function(event) {
-    log("Received 'onsuccess' smsrequest event.");
-    ok(event.target.result, "smsrequest event.target.result");
-    cursor = event.target.result;
+  cursor.onsuccess = function(event) {
+    log("Received 'onsuccess' event.");
 
-    if (cursor.message) {
+    if (cursor.result) {
       // Another message found
-      log("Got SMS (id: " + cursor.message.id + ").");
+      log("Got SMS (id: " + cursor.result.id + ").");
       // Store found message
-      foundSmsList.push(cursor.message);
+      foundSmsList.push(cursor.result);
       // Now get next message in the list
       cursor.continue();
     } else {
       // No more messages; ensure correct number found
       if (foundSmsList.length == smsList.length) {
         log("SMS getMessages returned " + foundSmsList.length +
             " messages as expected.");
         verifyFoundMsgs(foundSmsList);
@@ -190,18 +186,18 @@ function getMsgs() {
         log("SMS getMessages returned " + foundSmsList.length +
             " messages, but expected " + smsList.length + ".");
         ok(false, "Incorrect number of messages returned by sms.getMessages");
         deleteAllMsgs(cleanUp);
       }
     }
   };
 
-  request.onerror = function(event) {
-    log("Received 'onerror' smsrequest event.");
+  cursor.onerror = function(event) {
+    log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
     log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function verifyFoundMsgs(foundSmsList) {
--- a/dom/mobilemessage/tests/marionette/test_getmessages.js
+++ b/dom/mobilemessage/tests/marionette/test_getmessages.js
@@ -20,42 +20,40 @@ function verifyInitialState() {
 function isIn(aVal, aArray, aMsg) {
   ok(aArray.indexOf(aVal) >= 0, aMsg);
 }
 
 function deleteAllMsgs(nextFunction) {
   let msgList = new Array();
   let smsFilter = new MozSmsFilter;
 
-  let request = sms.getMessages(smsFilter, false);
-  ok(request instanceof MozSmsRequest,
-      "request is instanceof " + request.constructor);
+  let cursor = sms.getMessages(smsFilter, false);
+  ok(cursor instanceof DOMCursor,
+      "cursor is instanceof " + cursor.constructor);
 
-  request.onsuccess = function(event) {
-    ok(event.target.result, "smsrequest event.target.result");
-    cursor = event.target.result;
+  cursor.onsuccess = function(event) {
     // Check if message was found
-    if (cursor.message) {
-      msgList.push(cursor.message.id);
+    if (cursor.result) {
+      msgList.push(cursor.result.id);
       // Now get next message in the list
       cursor.continue();
     } else {
       // No (more) messages found
       if (msgList.length) {
         log("Found " + msgList.length + " SMS messages to delete.");
         deleteMsgs(msgList, nextFunction);
       } else {
         log("No SMS messages found.");
         nextFunction();
       }
     }
   };
 
-  request.onerror = function(event) {
-    log("Received 'onerror' smsrequest event.");
+  cursor.onerror = function(event) {
+    log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
     log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function deleteMsgs(msgList, nextFunction) {
@@ -139,49 +137,47 @@ function getMsgs(reverse) {
   if (!reverse) {
     log("Getting the sms messages.");
   } else {
     log("Getting the sms messages in reverse order.");
   }
 
   // Note: This test is intended for getMessages, so just a basic test with
   // no filter (default); separate tests will be written for sms filtering
-  let request = sms.getMessages(smsFilter, reverse);
-  ok(request instanceof MozSmsRequest,
-      "request is instanceof " + request.constructor);
+  let cursor = sms.getMessages(smsFilter, reverse);
+  ok(cursor instanceof DOMCursor,
+      "cursor is instanceof " + cursor.constructor);
 
-  request.onsuccess = function(event) {
-    log("Received 'onsuccess' smsrequest event.");
-    ok(event.target.result, "smsrequest event.target.result");
-    cursor = event.target.result;
+  cursor.onsuccess = function(event) {
+    log("Received 'onsuccess' event.");
 
-    if (cursor.message) {
+    if (cursor.result) {
       // Another message found
-      log("Got SMS (id: " + cursor.message.id + ").");
+      log("Got SMS (id: " + cursor.result.id + ").");
       foundSmsCount++;
       // Store found message
-      foundSmsList.push(cursor.message);
+      foundSmsList.push(cursor.result);
       // Now get next message in the list
       cursor.continue();
     } else {
       // No more messages; ensure correct number found
       if (foundSmsCount == numberMsgs) {
         log("SMS getMessages returned " + foundSmsCount +
             " messages as expected.");  
       } else {
         log("SMS getMessages returned " + foundSmsCount +
             " messages, but expected " + numberMsgs + ".");
         ok(false, "Incorrect number of messages returned by sms.getMessages");
       }
       verifyFoundMsgs(foundSmsList, reverse);
     }
   };
 
-  request.onerror = function(event) {
-    log("Received 'onerror' smsrequest event.");
+  cursor.onerror = function(event) {
+    log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
     log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function verifyFoundMsgs(foundSmsList, reverse) {
--- a/dom/mobilemessage/tests/marionette/test_message_classes.js
+++ b/dom/mobilemessage/tests/marionette/test_message_classes.js
@@ -67,36 +67,35 @@ function test_message_class_0() {
       let message = event.message;
       checkMessage(message, -1, 0, "class-0");
       ok(event.message.timestamp.getTime() >= timeBeforeSend,
          "Message's timestamp should be greater then the timetamp of sending");
       ok(event.message.timestamp.getTime() <= Date.now(),
          "Message's timestamp should be lesser than the timestamp of now");
 
       // Make sure the message is not stored.
-      let request = sms.getMessages(null, false);
-      request.onsuccess = function onsuccess() {
-        let cursor = request.result;
-        if (cursor.message) {
+      let cursor = sms.getMessages(null, false);
+      cursor.onsuccess = function onsuccess() {
+        if (cursor.result) {
           // Here we check whether there is any message of the same sender.
-          isnot(cursor.message.sender, message.sender, "cursor.message.sender");
+          isnot(cursor.result.sender, message.sender, "cursor.result.sender");
 
           cursor.continue();
           return;
         }
 
         // All messages checked. Done.
         ++dcsIndex;
         if (dcsIndex >= allDCSs.length) {
           window.setTimeout(test_message_class_1, 0);
         } else {
           window.setTimeout(do_test.bind(null, dcsIndex), 0);
         }
       };
-      request.onerror = function onerror() {
+      cursor.onerror = function onerror() {
         ok(false, "Can't fetch messages from SMS database");
       };
     });
 
     let dcs = allDCSs[dcsIndex];
     log("  Testing DCS " + dcs);
     let pdu = PDU_SMSC + PDU_FIRST_OCTET + PDU_SENDER + PDU_PID_NORMAL +
               dcs + PDU_TIMESTAMP + PDU_UDL + PDU_UD;
--- a/dom/mobilemessage/tests/test_sms_basics.html
+++ b/dom/mobilemessage/tests/test_sms_basics.html
@@ -41,17 +41,16 @@ function test() {
   var gSmsEnabled = SpecialPowers.getBoolPref("dom.sms.enabled");
 
   checkInterface("SmsManager");
   checkInterface("NavigatorSms");
   checkInterface("SmsMessage");
   checkInterface("SmsEvent");
   checkInterface("SmsRequest");
   checkInterface("SmsFilter");
-  checkInterface("SmsCursor");
 
   // If sms is disabled and permission is removed, sms is disabled.
   SpecialPowers.setBoolPref("dom.sms.enabled", false);
   SpecialPowers.removePermission("sms", document);
   checkSmsDisabled();
 
   // If sms is enabled and permission is removed, sms is disabled.
   SpecialPowers.setBoolPref("dom.sms.enabled", true);
--- a/dom/tests/mochitest/general/test_interfaces.html
+++ b/dom/tests/mochitest/general/test_interfaces.html
@@ -435,17 +435,16 @@ var interfaceNamesInGlobalScope =
     "GeoPositionErrorCallback",
     "HTMLVideoElement",
     "MozSettingsEvent",
     "SVGAnimatedPathData",
     "SVGUnitTypes",
     "SVGTests",
     "RGBColor",
     "HTMLLabelElement",
-    "MozSmsCursor",
     "EventSource",
     "MozNavigatorSms",
     "MozNavigatorMobileMessage",
     "SVGSetElement",
     "GlobalObjectConstructor",
     "SVGAnimatedBoolean",
     "HTMLTableElement",
     "Window",