Backed out changeset 5ce6a2000fa3 (bug 891235) for failures in test_getthreads.js
authorEd Morley <emorley@mozilla.com>
Wed, 24 Jul 2013 10:11:57 +0100
changeset 151982 483f3f62f0927193c9a168c0d68974833a0ec0c1
parent 151981 20c44ac1bd141ae16f435126a10c08a0e51a2edb
child 151983 021d081e55883998285267c5ed52b92ba27dbefe
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs891235
milestone25.0a1
backs out5ce6a2000fa3e026338e225bf1410ce9526e491e
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
Backed out changeset 5ce6a2000fa3 (bug 891235) for failures in test_getthreads.js
dom/base/Navigator.cpp
dom/base/Navigator.h
dom/base/nsDOMClassInfo.cpp
dom/base/nsDOMClassInfoClasses.h
dom/bindings/Bindings.conf
dom/mobilemessage/interfaces/moz.build
dom/mobilemessage/interfaces/nsIDOMSmsManager.idl
dom/mobilemessage/src/MobileMessageCursorCallback.h
dom/mobilemessage/src/SmsManager.cpp
dom/mobilemessage/src/SmsManager.h
dom/mobilemessage/src/moz.build
dom/mobilemessage/tests/marionette/test_between_emulators.py
dom/mobilemessage/tests/marionette/test_bug814761.js
dom/mobilemessage/tests/marionette/test_emulator_loopback.js
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_getmessage.js
dom/mobilemessage/tests/marionette/test_getmessage_notfound.js
dom/mobilemessage/tests/marionette/test_getmessages.js
dom/mobilemessage/tests/marionette/test_getsegmentinfofortext.js
dom/mobilemessage/tests/marionette/test_getthreads.js
dom/mobilemessage/tests/marionette/test_incoming.js
dom/mobilemessage/tests/marionette/test_incoming_delete.js
dom/mobilemessage/tests/marionette/test_incoming_max_segments.js
dom/mobilemessage/tests/marionette/test_incoming_multipart.js
dom/mobilemessage/tests/marionette/test_mark_msg_read.js
dom/mobilemessage/tests/marionette/test_mark_msg_read_error.js
dom/mobilemessage/tests/marionette/test_massive_incoming_delete.js
dom/mobilemessage/tests/marionette/test_message_classes.js
dom/mobilemessage/tests/marionette/test_outgoing.js
dom/mobilemessage/tests/marionette/test_outgoing_delete.js
dom/mobilemessage/tests/marionette/test_outgoing_max_segments.js
dom/mobilemessage/tests/marionette/test_phone_number_normalization.js
dom/mobilemessage/tests/marionette/test_segment_info.js
dom/mobilemessage/tests/marionette/test_strict_7bit_encoding.js
dom/mobilemessage/tests/marionette/test_update_thread_record_in_delete.js
dom/mobilemessage/tests/test_sms_basics.html
dom/permission/tests/test_sms.html
dom/tests/mochitest/general/test_interfaces.html
dom/webidl/Navigator.webidl
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -25,16 +25,17 @@
 #include "nsUnicharUtils.h"
 #include "nsVariant.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Telemetry.h"
 #include "BatteryManager.h"
 #include "PowerManager.h"
 #include "nsIDOMWakeLock.h"
 #include "nsIPowerManagerService.h"
+#include "mozilla/dom/SmsManager.h"
 #include "mozilla/dom/MobileMessageManager.h"
 #include "nsISmsService.h"
 #include "mozilla/Hal.h"
 #include "nsIWebNavigation.h"
 #include "nsISiteSpecificUserAgent.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/StaticPtr.h"
 #include "Connection.h"
@@ -135,16 +136,17 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Navigator)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPlugins)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMimeTypes)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mGeolocation)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mNotification)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mBatteryManager)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPowerManager)
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSmsManager)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMobileMessageManager)
 #ifdef MOZ_B2G_RIL
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTelephony)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mVoicemail)
 #endif
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mConnection)
 #ifdef MOZ_B2G_RIL
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMobileConnection)
@@ -197,16 +199,21 @@ Navigator::Invalidate()
     mBatteryManager = nullptr;
   }
 
   if (mPowerManager) {
     mPowerManager->Shutdown();
     mPowerManager = nullptr;
   }
 
+  if (mSmsManager) {
+    mSmsManager->Shutdown();
+    mSmsManager = nullptr;
+  }
+
   if (mMobileMessageManager) {
     mMobileMessageManager->Shutdown();
     mMobileMessageManager = nullptr;
   }
 
 #ifdef MOZ_B2G_RIL
   if (mTelephony) {
     mTelephony = nullptr;
@@ -1102,16 +1109,29 @@ Navigator::RequestWakeLock(const nsAStri
   // from our XPCOM method.
   NS_ENSURE_TRUE(pmService, nullptr);
 
   nsCOMPtr<nsIDOMMozWakeLock> wakelock;
   aRv = pmService->NewWakeLock(aTopic, mWindow, getter_AddRefs(wakelock));
   return wakelock.forget();
 }
 
+nsIDOMMozSmsManager*
+Navigator::GetMozSms()
+{
+  if (!mSmsManager) {
+    NS_ENSURE_TRUE(mWindow, nullptr);
+    NS_ENSURE_TRUE(mWindow->GetDocShell(), nullptr);
+
+    mSmsManager = SmsManager::CreateInstance(mWindow);
+  }
+
+  return mSmsManager;
+}
+
 nsIDOMMozMobileMessageManager*
 Navigator::GetMozMobileMessage()
 {
   if (!mMobileMessageManager) {
     // Check that our window has not gone away
     NS_ENSURE_TRUE(mWindow, nullptr);
     NS_ENSURE_TRUE(mWindow->GetDocShell(), nullptr);
 
@@ -1592,16 +1612,24 @@ Navigator::HasWakeLockSupport(JSContext*
   nsCOMPtr<nsIPowerManagerService> pmService =
     do_GetService(POWERMANAGERSERVICE_CONTRACTID);
   // No service means no wake lock support
   return !!pmService;
 }
 
 /* static */
 bool
+Navigator::HasSmsSupport(JSContext* /* unused */, JSObject* aGlobal)
+{
+  nsCOMPtr<nsPIDOMWindow> win = GetWindowFromGlobal(aGlobal);
+  return win && SmsManager::CreationIsAllowed(win);
+}
+
+/* static */
+bool
 Navigator::HasMobileMessageSupport(JSContext* /* unused */, JSObject* aGlobal)
 {
   nsCOMPtr<nsPIDOMWindow> win = GetWindowFromGlobal(aGlobal);
 
 #ifndef MOZ_WEBSMS_BACKEND
   return false;
 #endif
 
--- a/dom/base/Navigator.h
+++ b/dom/base/Navigator.h
@@ -4,16 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_Navigator_h
 #define mozilla_dom_Navigator_h
 
 #include "mozilla/MemoryReporting.h"
 #include "nsIDOMNavigator.h"
+#include "nsIDOMSmsManager.h"
 #include "nsIDOMMobileMessageManager.h"
 #include "nsIMozNavigatorNetwork.h"
 #include "nsAutoPtr.h"
 #include "nsWeakReference.h"
 #include "DeviceStorage.h"
 #include "nsWrapperCache.h"
 
 class nsPluginArray;
@@ -57,16 +58,17 @@ void NS_GetNavigatorAppName(nsAString& a
 namespace mozilla {
 namespace dom {
 
 namespace battery {
 class BatteryManager;
 } // namespace battery
 
 class DesktopNotificationCenter;
+class SmsManager;
 class MobileMessageManager;
 class MozIdleObserver;
 #ifdef MOZ_GAMEPAD
 class Gamepad;
 #endif // MOZ_GAMEPAD
 #ifdef MOZ_MEDIA_NAVIGATOR
 class MozDOMGetUserMediaSuccessCallback;
 class MozDOMGetUserMediaErrorCallback;
@@ -201,16 +203,17 @@ public:
   nsDOMDeviceStorage* GetDeviceStorage(const nsAString& aType,
                                        ErrorResult& aRv);
   void GetDeviceStorages(const nsAString& aType,
                          nsTArray<nsRefPtr<nsDOMDeviceStorage> >& aStores,
                          ErrorResult& aRv);
   DesktopNotificationCenter* GetMozNotification(ErrorResult& aRv);
   bool MozIsLocallyAvailable(const nsAString& aURI, bool aWhenOffline,
                              ErrorResult& aRv);
+  nsIDOMMozSmsManager* GetMozSms();
   nsIDOMMozMobileMessageManager* GetMozMobileMessage();
   nsIDOMMozConnection* GetMozConnection();
   nsDOMCameraManager* GetMozCameras(ErrorResult& aRv);
   void MozSetMessageHandler(const nsAString& aType,
                             systemMessageCallback* aCallback,
                             ErrorResult& aRv);
   bool MozHasPendingMessage(const nsAString& aType, ErrorResult& aRv);
 #ifdef MOZ_B2G_RIL
@@ -249,16 +252,17 @@ public:
   static bool HasPowerSupport(JSContext* /* unused */, JSObject* aGlobal);
   static bool HasIdleSupport(JSContext* /* unused */, JSObject* aGlobal);
   static bool HasWakeLockSupport(JSContext* /* unused*/, JSObject* /*unused */);
   static bool HasDesktopNotificationSupport(JSContext* /* unused*/,
                                             JSObject* /*unused */)
   {
     return HasDesktopNotificationSupport();
   }
+  static bool HasSmsSupport(JSContext* /* unused */, JSObject* aGlobal);
   static bool HasMobileMessageSupport(JSContext* /* unused */,
                                       JSObject* aGlobal);
   static bool HasCameraSupport(JSContext* /* unused */,
                                JSObject* aGlobal);
 #ifdef MOZ_B2G_RIL
   static bool HasTelephonySupport(JSContext* /* unused */,
                                   JSObject* aGlobal);
   static bool HasMobileConnectionSupport(JSContext* /* unused */,
@@ -297,16 +301,17 @@ private:
   static already_AddRefed<nsPIDOMWindow> GetWindowFromGlobal(JSObject* aGlobal);
 
   nsRefPtr<nsMimeTypeArray> mMimeTypes;
   nsRefPtr<nsPluginArray> mPlugins;
   nsRefPtr<Geolocation> mGeolocation;
   nsRefPtr<DesktopNotificationCenter> mNotification;
   nsRefPtr<battery::BatteryManager> mBatteryManager;
   nsRefPtr<power::PowerManager> mPowerManager;
+  nsRefPtr<SmsManager> mSmsManager;
   nsRefPtr<MobileMessageManager> mMobileMessageManager;
 #ifdef MOZ_B2G_RIL
   nsCOMPtr<nsIDOMTelephony> mTelephony;
   nsCOMPtr<nsIDOMMozVoicemail> mVoicemail;
 #endif
   nsRefPtr<network::Connection> mConnection;
 #ifdef MOZ_B2G_RIL
   nsRefPtr<network::MobileConnection> mMobileConnection;
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -213,16 +213,17 @@ using mozilla::dom::workers::ResolveWork
 #include "nsDOMTouchEvent.h"
 
 #include "nsWrapperCacheInlines.h"
 #include "mozilla/dom/HTMLCollectionBinding.h"
 
 #include "BatteryManager.h"
 #include "nsIDOMPowerManager.h"
 #include "nsIDOMWakeLock.h"
+#include "nsIDOMSmsManager.h"
 #include "nsIDOMMobileMessageManager.h"
 #include "nsIDOMMozSmsMessage.h"
 #include "nsIDOMMozMmsMessage.h"
 #include "nsIDOMSmsFilter.h"
 #include "nsIDOMSmsSegmentInfo.h"
 #include "nsIDOMMozMobileMessageThread.h"
 #include "nsIDOMConnection.h"
 
@@ -571,16 +572,19 @@ static nsDOMClassInfoData sClassInfoData
                            WINDOW_SCRIPTABLE_FLAGS)
 
   NS_DEFINE_CLASSINFO_DATA(MozPowerManager, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
   NS_DEFINE_CLASSINFO_DATA(MozWakeLock, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
+  NS_DEFINE_CLASSINFO_DATA(MozSmsManager, nsDOMGenericSH,
+                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
+
   NS_DEFINE_CLASSINFO_DATA(MozMobileMessageManager, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
   NS_DEFINE_CLASSINFO_DATA(MozSmsMessage, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
   NS_DEFINE_CLASSINFO_DATA(MozMmsMessage, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
@@ -1432,16 +1436,20 @@ nsDOMClassInfo::Init()
   DOM_CLASSINFO_MAP_BEGIN(MozPowerManager, nsIDOMMozPowerManager)
      DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozPowerManager)
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(MozWakeLock, nsIDOMMozWakeLock)
      DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozWakeLock)
   DOM_CLASSINFO_MAP_END
 
+  DOM_CLASSINFO_MAP_BEGIN(MozSmsManager, nsIDOMMozSmsManager)
+     DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozSmsManager)
+  DOM_CLASSINFO_MAP_END
+
   DOM_CLASSINFO_MAP_BEGIN(MozMobileMessageManager, nsIDOMMozMobileMessageManager)
      DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozMobileMessageManager)
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(MozSmsMessage, nsIDOMMozSmsMessage)
      DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozSmsMessage)
   DOM_CLASSINFO_MAP_END
 
--- a/dom/base/nsDOMClassInfoClasses.h
+++ b/dom/base/nsDOMClassInfoClasses.h
@@ -90,16 +90,17 @@ DOMCI_CLASS(Blob)
 DOMCI_CLASS(File)
 
 // DOM modal content window class, almost identical to Window
 DOMCI_CLASS(ModalContentWindow)
 
 DOMCI_CLASS(MozPowerManager)
 DOMCI_CLASS(MozWakeLock)
 
+DOMCI_CLASS(MozSmsManager)
 DOMCI_CLASS(MozMobileMessageManager)
 DOMCI_CLASS(MozSmsMessage)
 DOMCI_CLASS(MozMmsMessage)
 DOMCI_CLASS(MozSmsFilter)
 DOMCI_CLASS(MozSmsSegmentInfo)
 DOMCI_CLASS(MozMobileMessageThread)
 
 DOMCI_CLASS(MozConnection)
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -1726,16 +1726,17 @@ addExternalIface('MozMediaStreamOptions'
                  headerFile='nsIDOMNavigatorUserMedia.h')
 addExternalIface('MozMobileConnection', headerFile='nsIDOMMobileConnection.h')
 addExternalIface('MozMobileMessageManager', headerFile='nsIDOMMobileMessageManager.h')
 addExternalIface('MozObserver', nativeType='nsIObserver', notflattened=True)
 addExternalIface('MozPowerManager', headerFile='nsIDOMPowerManager.h')
 addExternalIface('MozRDFCompositeDataSource', nativeType='nsIRDFCompositeDataSource',
                  notflattened=True)
 addExternalIface('MozRDFResource', nativeType='nsIRDFResource', notflattened=True)
+addExternalIface('MozSmsManager', headerFile='nsIDOMSmsManager.h')
 addExternalIface('MozTelephony', nativeType='nsIDOMTelephony')
 addExternalIface('MozTreeBoxObject', nativeType='nsITreeBoxObject',
                  notflattened=True)
 addExternalIface('MozTreeColumn', nativeType='nsITreeColumn',
                  headerFile='nsITreeColumns.h')
 addExternalIface('MozVoicemail')
 addExternalIface('MozWakeLock', headerFile='nsIDOMWakeLock.h')
 addExternalIface('MozXULTemplateBuilder', nativeType='nsIXULTemplateBuilder')
--- a/dom/mobilemessage/interfaces/moz.build
+++ b/dom/mobilemessage/interfaces/moz.build
@@ -7,16 +7,17 @@
 XPIDL_SOURCES += [
     'nsIDOMMobileMessageManager.idl',
     'nsIDOMMozMmsEvent.idl',
     'nsIDOMMozMmsMessage.idl',
     'nsIDOMMozMobileMessageThread.idl',
     'nsIDOMMozSmsEvent.idl',
     'nsIDOMMozSmsMessage.idl',
     'nsIDOMSmsFilter.idl',
+    'nsIDOMSmsManager.idl',
     'nsIDOMSmsSegmentInfo.idl',
     'nsIMmsService.idl',
     'nsIMobileMessageCallback.idl',
     'nsIMobileMessageCursorCallback.idl',
     'nsIMobileMessageDatabaseService.idl',
     'nsIMobileMessageService.idl',
     'nsISmsService.idl',
     'nsIWapPushApplication.idl',
new file mode 100644
--- /dev/null
+++ b/dom/mobilemessage/interfaces/nsIDOMSmsManager.idl
@@ -0,0 +1,44 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "nsIDOMEventTarget.idl"
+
+interface nsIDOMDOMCursor;
+interface nsIDOMDOMRequest;
+interface nsIDOMEventListener;
+interface nsIDOMMozSmsFilter;
+interface nsIDOMMozSmsSegmentInfo;
+
+[scriptable, builtinclass, uuid(8ce00d77-71b4-43f6-92a1-2eae7c9581b9)]
+interface nsIDOMMozSmsManager : nsIDOMEventTarget
+{
+  nsIDOMMozSmsSegmentInfo getSegmentInfoForText(in DOMString text);
+
+  // The first parameter can be either a DOMString (only one number) or an array
+  // of DOMStrings.
+  // The method returns a DOMRequest object if one number has been passed.
+  // An array of DOMRequest objects otherwise.
+  jsval send(in jsval number, in DOMString message);
+
+  [binaryname(GetMessageMoz)]
+  nsIDOMDOMRequest getMessage(in long id);
+
+  // The parameter can be either a message id or a SmsMessage.
+  nsIDOMDOMRequest delete(in jsval param);
+
+  // Iterates through nsIDOMMozSmsMessage.
+  nsIDOMDOMCursor getMessages(in nsIDOMMozSmsFilter filter, in boolean reverse);
+
+  nsIDOMDOMRequest markMessageRead(in long id, in boolean aValue);
+
+  // Iterates through nsIDOMMozMobileMessageThread.
+  nsIDOMDOMCursor getThreads();
+
+  [implicit_jscontext] attribute jsval onreceived;
+  [implicit_jscontext] attribute jsval onsending;
+  [implicit_jscontext] attribute jsval onsent;
+  [implicit_jscontext] attribute jsval onfailed;
+  [implicit_jscontext] attribute jsval ondeliverysuccess;
+  [implicit_jscontext] attribute jsval ondeliveryerror;
+};
--- a/dom/mobilemessage/src/MobileMessageCursorCallback.h
+++ b/dom/mobilemessage/src/MobileMessageCursorCallback.h
@@ -13,22 +13,24 @@
 
 class nsICursorContinueCallback;
 
 namespace mozilla {
 namespace dom {
 
 class DOMCursor;
 class MobileMessageManager;
+class SmsManager;
 
 namespace mobilemessage {
 
 class MobileMessageCursorCallback : public nsIMobileMessageCursorCallback
 {
   friend class mozilla::dom::MobileMessageManager;
+  friend class mozilla::dom::SmsManager;
 
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_NSIMOBILEMESSAGECURSORCALLBACK
 
   NS_DECL_CYCLE_COLLECTION_CLASS(MobileMessageCursorCallback)
 
   MobileMessageCursorCallback()
new file mode 100644
--- /dev/null
+++ b/dom/mobilemessage/src/SmsManager.cpp
@@ -0,0 +1,502 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "SmsFilter.h"
+#include "SmsManager.h"
+#include "nsIDOMClassInfo.h"
+#include "nsISmsService.h"
+#include "nsIObserverService.h"
+#include "mozilla/Preferences.h"
+#include "mozilla/Services.h"
+#include "Constants.h"
+#include "nsIDOMMozSmsEvent.h"
+#include "nsIDOMMozSmsMessage.h"
+#include "nsJSUtils.h"
+#include "nsContentUtils.h"
+#include "nsCxPusher.h"
+#include "nsIMobileMessageDatabaseService.h"
+#include "nsIXPConnect.h"
+#include "nsIPermissionManager.h"
+#include "GeneratedEvents.h"
+#include "MobileMessageCallback.h"
+#include "MobileMessageCursorCallback.h"
+#include "DOMCursor.h"
+
+#define RECEIVED_EVENT_NAME         NS_LITERAL_STRING("received")
+#define SENDING_EVENT_NAME          NS_LITERAL_STRING("sending")
+#define SENT_EVENT_NAME             NS_LITERAL_STRING("sent")
+#define FAILED_EVENT_NAME           NS_LITERAL_STRING("failed")
+#define DELIVERY_SUCCESS_EVENT_NAME NS_LITERAL_STRING("deliverysuccess")
+#define DELIVERY_ERROR_EVENT_NAME   NS_LITERAL_STRING("deliveryerror")
+
+using namespace mozilla::dom::mobilemessage;
+
+DOMCI_DATA(MozSmsManager, mozilla::dom::SmsManager)
+
+namespace mozilla {
+namespace dom {
+
+NS_INTERFACE_MAP_BEGIN(SmsManager)
+  NS_INTERFACE_MAP_ENTRY(nsIDOMMozSmsManager)
+  NS_INTERFACE_MAP_ENTRY(nsIObserver)
+  NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MozSmsManager)
+NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper)
+
+NS_IMPL_ADDREF_INHERITED(SmsManager, nsDOMEventTargetHelper)
+NS_IMPL_RELEASE_INHERITED(SmsManager, nsDOMEventTargetHelper)
+
+NS_IMPL_EVENT_HANDLER(SmsManager, received)
+NS_IMPL_EVENT_HANDLER(SmsManager, sending)
+NS_IMPL_EVENT_HANDLER(SmsManager, sent)
+NS_IMPL_EVENT_HANDLER(SmsManager, failed)
+NS_IMPL_EVENT_HANDLER(SmsManager, deliverysuccess)
+NS_IMPL_EVENT_HANDLER(SmsManager, deliveryerror)
+
+/* static */
+bool
+SmsManager::CreationIsAllowed(nsPIDOMWindow* aWindow)
+{
+  NS_ASSERTION(aWindow, "Null pointer!");
+
+#ifndef MOZ_WEBSMS_BACKEND
+  return false;
+#endif
+
+  // First of all, the general pref has to be turned on.
+  bool enabled = false;
+  Preferences::GetBool("dom.sms.enabled", &enabled);
+  NS_ENSURE_TRUE(enabled, false);
+
+  nsCOMPtr<nsIPermissionManager> permMgr =
+    do_GetService(NS_PERMISSIONMANAGER_CONTRACTID);
+  NS_ENSURE_TRUE(permMgr, false);
+
+  uint32_t permission = nsIPermissionManager::DENY_ACTION;
+  permMgr->TestPermissionFromWindow(aWindow, "sms", &permission);
+
+  if (permission != nsIPermissionManager::ALLOW_ACTION) {
+    return false;
+  }
+
+  // Check the Sms Service:
+  nsCOMPtr<nsISmsService> smsService = do_GetService(SMS_SERVICE_CONTRACTID);
+  NS_ENSURE_TRUE(smsService, false);
+
+  bool result = false;
+  smsService->HasSupport(&result);
+  if (!result) {
+    return false;
+  }
+
+  return true;
+}
+
+// static
+already_AddRefed<SmsManager>
+SmsManager::CreateInstance(nsPIDOMWindow* aWindow)
+{
+  nsRefPtr<SmsManager> smsMgr = new SmsManager();
+  smsMgr->Init(aWindow);
+
+  return smsMgr.forget();
+}
+
+void
+SmsManager::Init(nsPIDOMWindow *aWindow)
+{
+  BindToOwner(aWindow);
+
+  nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
+  // GetObserverService() can return null is some situations like shutdown.
+  if (!obs) {
+    return;
+  }
+
+  obs->AddObserver(this, kSmsReceivedObserverTopic, false);
+  obs->AddObserver(this, kSmsSendingObserverTopic, false);
+  obs->AddObserver(this, kSmsSentObserverTopic, false);
+  obs->AddObserver(this, kSmsFailedObserverTopic, false);
+  obs->AddObserver(this, kSmsDeliverySuccessObserverTopic, false);
+  obs->AddObserver(this, kSmsDeliveryErrorObserverTopic, false);
+}
+
+void
+SmsManager::Shutdown()
+{
+  nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
+  // GetObserverService() can return null is some situations like shutdown.
+  if (!obs) {
+    return;
+  }
+
+  obs->RemoveObserver(this, kSmsReceivedObserverTopic);
+  obs->RemoveObserver(this, kSmsSendingObserverTopic);
+  obs->RemoveObserver(this, kSmsSentObserverTopic);
+  obs->RemoveObserver(this, kSmsFailedObserverTopic);
+  obs->RemoveObserver(this, kSmsDeliverySuccessObserverTopic);
+  obs->RemoveObserver(this, kSmsDeliveryErrorObserverTopic);
+}
+
+NS_IMETHODIMP
+SmsManager::GetSegmentInfoForText(const nsAString& aText,
+                                  nsIDOMMozSmsSegmentInfo** aResult)
+{
+  nsCOMPtr<nsISmsService> smsService = do_GetService(SMS_SERVICE_CONTRACTID);
+  NS_ENSURE_TRUE(smsService, NS_ERROR_FAILURE);
+
+  return smsService->GetSegmentInfoForText(aText, aResult);
+}
+
+nsresult
+SmsManager::Send(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<JSString*> aNumber,
+                 const nsAString& aMessage, JS::Value* aRequest)
+{
+  nsCOMPtr<nsISmsService> smsService = do_GetService(SMS_SERVICE_CONTRACTID);
+  NS_ENSURE_TRUE(smsService, NS_ERROR_FAILURE);
+
+  nsDependentJSString number;
+  number.init(aCx, aNumber);
+
+  nsRefPtr<DOMRequest> request = new DOMRequest(GetOwner());
+  nsCOMPtr<nsIMobileMessageCallback> msgCallback =
+    new MobileMessageCallback(request);
+
+  nsresult rv = smsService->Send(number, aMessage, msgCallback);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  JS::Rooted<JSObject*> global(aCx, aGlobal);
+  rv = nsContentUtils::WrapNative(aCx, global,
+                                  static_cast<nsIDOMDOMRequest*>(request.get()),
+                                  aRequest);
+  if (NS_FAILED(rv)) {
+    NS_ERROR("Failed to create the js value!");
+    return rv;
+  }
+
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+SmsManager::Send(const JS::Value& aNumber, const nsAString& aMessage, JS::Value* aReturn)
+{
+  nsresult rv;
+  nsIScriptContext* sc = GetContextForEventHandlers(&rv);
+  NS_ENSURE_STATE(sc);
+  AutoPushJSContext cx(sc->GetNativeContext());
+  NS_ASSERTION(cx, "Failed to get a context!");
+
+  if (!aNumber.isString() &&
+      !(aNumber.isObject() && JS_IsArrayObject(cx, &aNumber.toObject()))) {
+    return NS_ERROR_INVALID_ARG;
+  }
+
+  JS::Rooted<JSObject*> global(cx, sc->GetNativeGlobal());
+  NS_ASSERTION(global, "Failed to get global object!");
+
+  JSAutoCompartment ac(cx, global);
+
+  if (aNumber.isString()) {
+    JS::Rooted<JSString*> number(cx, aNumber.toString());
+    return Send(cx, global, number, aMessage, aReturn);
+  }
+
+  // Must be an object then.
+  if (!aNumber.isObject()) {
+    return NS_ERROR_FAILURE;
+  }
+
+  JS::Rooted<JSObject*> numbers(cx, &aNumber.toObject());
+  uint32_t size;
+  if (!JS_GetArrayLength(cx, numbers, &size)) {
+    return NS_ERROR_FAILURE;
+  }
+
+  JS::AutoValueVector requests(cx);
+  if (!requests.resize(size)) {
+    return NS_ERROR_FAILURE;
+  }
+
+  JS::RootedString str(cx);
+  for (uint32_t i = 0; i < size; ++i) {
+    JS::Rooted<JS::Value> number(cx);
+    if (!JS_GetElement(cx, numbers, i, number.address())) {
+      return NS_ERROR_INVALID_ARG;
+    }
+
+    str = JS_ValueToString(cx, number);
+    if (!str) {
+      return NS_ERROR_FAILURE;
+    }
+
+    nsresult rv = Send(cx, global, str, aMessage, &requests[i]);
+    NS_ENSURE_SUCCESS(rv, rv);
+  }
+
+  JSObject* obj = JS_NewArrayObject(cx, requests.length(), requests.begin());
+  if (!obj) {
+    return NS_ERROR_FAILURE;
+  }
+
+  aReturn->setObject(*obj);
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+SmsManager::GetMessageMoz(int32_t aId, nsIDOMDOMRequest** aRequest)
+{
+  nsCOMPtr<nsIMobileMessageDatabaseService> dbService =
+    do_GetService(MOBILE_MESSAGE_DATABASE_SERVICE_CONTRACTID);
+  NS_ENSURE_TRUE(dbService, NS_ERROR_FAILURE);
+
+  nsRefPtr<DOMRequest> request = new DOMRequest(GetOwner());
+  nsCOMPtr<nsIMobileMessageCallback> msgCallback =
+    new MobileMessageCallback(request);
+
+  nsresult rv = dbService->GetMessageMoz(aId, msgCallback);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  request.forget(aRequest);
+  return NS_OK;
+}
+
+nsresult
+SmsManager::GetSmsMessageId(AutoPushJSContext &aCx,
+                            const JS::Value &aSmsMessage, int32_t &aId)
+{
+  nsCOMPtr<nsIDOMMozSmsMessage> message =
+    do_QueryInterface(nsContentUtils::XPConnect()->GetNativeOfWrapper(aCx, &aSmsMessage.toObject()));
+  NS_ENSURE_TRUE(message, NS_ERROR_INVALID_ARG);
+
+  return message->GetId(&aId);
+}
+
+NS_IMETHODIMP
+SmsManager::Delete(const JS::Value& aParam, nsIDOMDOMRequest** aRequest)
+{
+  // We expect Int32, SmsMessage, Int32[], SmsMessage[]
+  if (!aParam.isObject() && !aParam.isInt32()) {
+    return NS_ERROR_INVALID_ARG;
+  }
+
+  nsresult rv;
+  nsIScriptContext* sc = GetContextForEventHandlers(&rv);
+  AutoPushJSContext cx(sc->GetNativeContext());
+  NS_ENSURE_STATE(sc);
+
+  int32_t id, *idArray;
+  uint32_t size;
+
+  if (aParam.isInt32()) {
+    // Single Integer Message ID
+    id = aParam.toInt32();
+
+    size = 1;
+    idArray = &id;
+  } else if (!JS_IsArrayObject(cx, &aParam.toObject())) {
+    // Single SmsMessage object
+    rv = GetSmsMessageId(cx, aParam, id);
+    NS_ENSURE_SUCCESS(rv, rv);
+
+    size = 1;
+    idArray = &id;
+  } else {
+    // Int32[] or SmsMessage[]
+    JS::Rooted<JSObject*> ids(cx, &aParam.toObject());
+
+    JS_ALWAYS_TRUE(JS_GetArrayLength(cx, ids, &size));
+    nsAutoArrayPtr<int32_t> idAutoArray(new int32_t[size]);
+
+    JS::Rooted<JS::Value> idJsValue(cx);
+    for (uint32_t i = 0; i < size; i++) {
+      if (!JS_GetElement(cx, ids, i, idJsValue.address())) {
+        return NS_ERROR_INVALID_ARG;
+      }
+
+      if (idJsValue.get().isInt32()) {
+        idAutoArray[i] = idJsValue.get().toInt32();
+      } else if (idJsValue.get().isObject()) {
+        rv = GetSmsMessageId(cx, idJsValue, id);
+        NS_ENSURE_SUCCESS(rv, rv);
+
+        idAutoArray[i] = id;
+      }
+    }
+
+    idArray = idAutoArray.forget();
+  }
+
+  nsCOMPtr<nsIMobileMessageDatabaseService> dbService =
+    do_GetService(MOBILE_MESSAGE_DATABASE_SERVICE_CONTRACTID);
+  NS_ENSURE_TRUE(dbService, NS_ERROR_FAILURE);
+
+  nsRefPtr<DOMRequest> request = new DOMRequest(GetOwner());
+  nsCOMPtr<nsIMobileMessageCallback> msgCallback =
+    new MobileMessageCallback(request);
+
+  rv = dbService->DeleteMessage(idArray, size, msgCallback);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  request.forget(aRequest);
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+SmsManager::GetMessages(nsIDOMMozSmsFilter* aFilter,
+                        bool aReverse,
+                        nsIDOMDOMCursor** aCursor)
+{
+  nsCOMPtr<nsIMobileMessageDatabaseService> dbService =
+    do_GetService(MOBILE_MESSAGE_DATABASE_SERVICE_CONTRACTID);
+  NS_ENSURE_TRUE(dbService, NS_ERROR_FAILURE);
+
+  nsCOMPtr<nsIDOMMozSmsFilter> filter = aFilter;
+  if (!filter) {
+    filter = new SmsFilter();
+  }
+
+  nsRefPtr<MobileMessageCursorCallback> cursorCallback =
+    new MobileMessageCursorCallback();
+
+  nsCOMPtr<nsICursorContinueCallback> continueCallback;
+  nsresult rv = dbService->CreateMessageCursor(filter, aReverse, cursorCallback,
+                                               getter_AddRefs(continueCallback));
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  cursorCallback->mDOMCursor = new DOMCursor(GetOwner(), continueCallback);
+  NS_ADDREF(*aCursor = cursorCallback->mDOMCursor);
+
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+SmsManager::MarkMessageRead(int32_t aId, bool aValue,
+                            nsIDOMDOMRequest** aRequest)
+{
+  nsCOMPtr<nsIMobileMessageDatabaseService> dbService =
+    do_GetService(MOBILE_MESSAGE_DATABASE_SERVICE_CONTRACTID);
+  NS_ENSURE_TRUE(dbService, NS_ERROR_FAILURE);
+
+  nsRefPtr<DOMRequest> request = new DOMRequest(GetOwner());
+  nsCOMPtr<nsIMobileMessageCallback> msgCallback =
+    new MobileMessageCallback(request);
+
+  nsresult rv = dbService->MarkMessageRead(aId, aValue, msgCallback);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  request.forget(aRequest);
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+SmsManager::GetThreads(nsIDOMDOMCursor** aCursor)
+{
+  nsCOMPtr<nsIMobileMessageDatabaseService> dbService =
+    do_GetService(MOBILE_MESSAGE_DATABASE_SERVICE_CONTRACTID);
+  NS_ENSURE_TRUE(dbService, NS_ERROR_FAILURE);
+
+  nsRefPtr<MobileMessageCursorCallback> cursorCallback =
+    new MobileMessageCursorCallback();
+
+  nsCOMPtr<nsICursorContinueCallback> continueCallback;
+  nsresult rv = dbService->CreateThreadCursor(cursorCallback,
+                                              getter_AddRefs(continueCallback));
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  cursorCallback->mDOMCursor = new DOMCursor(GetOwner(), continueCallback);
+  NS_ADDREF(*aCursor = cursorCallback->mDOMCursor);
+
+  return NS_OK;
+}
+
+nsresult
+SmsManager::DispatchTrustedSmsEventToSelf(const nsAString& aEventName, nsIDOMMozSmsMessage* aMessage)
+{
+  nsCOMPtr<nsIDOMEvent> event;
+  NS_NewDOMMozSmsEvent(getter_AddRefs(event), this, nullptr, nullptr);
+  NS_ASSERTION(event, "This should never fail!");
+
+  nsCOMPtr<nsIDOMMozSmsEvent> se = do_QueryInterface(event);
+  MOZ_ASSERT(se);
+  nsresult rv = se->InitMozSmsEvent(aEventName, false, false, aMessage);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  return DispatchTrustedEvent(event);
+}
+
+NS_IMETHODIMP
+SmsManager::Observe(nsISupports* aSubject, const char* aTopic,
+                    const PRUnichar* aData)
+{
+  if (!strcmp(aTopic, kSmsReceivedObserverTopic)) {
+    nsCOMPtr<nsIDOMMozSmsMessage> message = do_QueryInterface(aSubject);
+    if (!message) {
+      NS_ERROR("Got a 'sms-received' topic without a valid message!");
+      return NS_OK;
+    }
+
+    DispatchTrustedSmsEventToSelf(RECEIVED_EVENT_NAME, message);
+    return NS_OK;
+  }
+
+  if (!strcmp(aTopic, kSmsSendingObserverTopic)) {
+    nsCOMPtr<nsIDOMMozSmsMessage> message = do_QueryInterface(aSubject);
+    if (!message) {
+      NS_ERROR("Got a 'sms-sending' topic without a valid message!");
+      return NS_OK;
+    }
+
+    DispatchTrustedSmsEventToSelf(SENDING_EVENT_NAME, message);
+    return NS_OK;
+  }
+
+  if (!strcmp(aTopic, kSmsSentObserverTopic)) {
+    nsCOMPtr<nsIDOMMozSmsMessage> message = do_QueryInterface(aSubject);
+    if (!message) {
+      NS_ERROR("Got a 'sms-sent' topic without a valid message!");
+      return NS_OK;
+    }
+
+    DispatchTrustedSmsEventToSelf(SENT_EVENT_NAME, message);
+    return NS_OK;
+  }
+
+  if (!strcmp(aTopic, kSmsFailedObserverTopic)) {
+    nsCOMPtr<nsIDOMMozSmsMessage> message = do_QueryInterface(aSubject);
+    if (!message) {
+      NS_ERROR("Got a 'sms-failed' topic without a valid message!");
+      return NS_OK;
+    }
+
+    DispatchTrustedSmsEventToSelf(FAILED_EVENT_NAME, message);
+    return NS_OK;
+  }
+
+  if (!strcmp(aTopic, kSmsDeliverySuccessObserverTopic)) {
+    nsCOMPtr<nsIDOMMozSmsMessage> message = do_QueryInterface(aSubject);
+    if (!message) {
+      NS_ERROR("Got a 'sms-delivery-success' topic without a valid message!");
+      return NS_OK;
+    }
+
+    DispatchTrustedSmsEventToSelf(DELIVERY_SUCCESS_EVENT_NAME, message);
+    return NS_OK;
+  }
+
+  if (!strcmp(aTopic, kSmsDeliveryErrorObserverTopic)) {
+    nsCOMPtr<nsIDOMMozSmsMessage> message = do_QueryInterface(aSubject);
+    if (!message) {
+      NS_ERROR("Got a 'sms-delivery-error' topic without a valid message!");
+      return NS_OK;
+    }
+
+    DispatchTrustedSmsEventToSelf(DELIVERY_ERROR_EVENT_NAME, message);
+    return NS_OK;
+  }
+
+  return NS_OK;
+}
+
+} // namespace dom
+} // namespace mozilla
new file mode 100644
--- /dev/null
+++ b/dom/mobilemessage/src/SmsManager.h
@@ -0,0 +1,58 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef mozilla_dom_mobilemessage_SmsManager_h
+#define mozilla_dom_mobilemessage_SmsManager_h
+
+#include "nsIDOMSmsManager.h"
+#include "nsIObserver.h"
+#include "nsDOMEventTargetHelper.h"
+
+class nsIDOMMozSmsMessage;
+
+namespace mozilla {
+namespace dom {
+
+class SmsManager : public nsDOMEventTargetHelper
+                 , public nsIDOMMozSmsManager
+                 , public nsIObserver
+{
+public:
+  NS_DECL_ISUPPORTS_INHERITED
+  NS_DECL_NSIOBSERVER
+  NS_DECL_NSIDOMMOZSMSMANAGER
+
+  NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper)
+
+  static already_AddRefed<SmsManager>
+  CreateInstance(nsPIDOMWindow *aWindow);
+
+  static bool
+  CreationIsAllowed(nsPIDOMWindow *aWindow);
+
+  void Init(nsPIDOMWindow *aWindow);
+  void Shutdown();
+
+private:
+  /**
+   * Internal Send() method used to send one message.
+   */
+  nsresult Send(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<JSString*> aNumber,
+                const nsAString& aMessage, JS::Value* aRequest);
+
+  nsresult DispatchTrustedSmsEventToSelf(const nsAString& aEventName,
+                                         nsIDOMMozSmsMessage* aMessage);
+
+  /**
+   * Helper to get message ID from SMS Message object
+   */
+  nsresult GetSmsMessageId(AutoPushJSContext &aCx, const JS::Value &aSmsMessage,
+                           int32_t &aId);
+};
+
+} // namespace dom
+} // namespace mozilla
+
+#endif // mozilla_dom_mobilemessage_SmsManager_h
--- a/dom/mobilemessage/src/moz.build
+++ b/dom/mobilemessage/src/moz.build
@@ -37,31 +37,33 @@ else:
         'MobileMessageDatabaseService.cpp',
         'MmsService.cpp',
     ]
 
 EXPORTS.mozilla.dom += [
     'MmsMessage.h',
     'MobileMessageManager.h',
     'SmsFilter.h',
+    'SmsManager.h',
     'SmsMessage.h',
     'SmsSegmentInfo.h',
 ]
 
 CPP_SOURCES += [
     'Constants.cpp',
     'MmsMessage.cpp',
     'MobileMessageCallback.cpp',
     'MobileMessageCursorCallback.cpp',
     'MobileMessageManager.cpp',
     'MobileMessageService.cpp',
     'MobileMessageThread.cpp',
     'SmsChild.cpp',
     'SmsFilter.cpp',
     'SmsIPCService.cpp',
+    'SmsManager.cpp',
     'SmsMessage.cpp',
     'SmsParent.cpp',
     'SmsSegmentInfo.cpp',
     'SmsService.cpp',
     'SmsServicesFactory.cpp',
 ]
 
 IPDL_SOURCES += [
--- a/dom/mobilemessage/tests/marionette/test_between_emulators.py
+++ b/dom/mobilemessage/tests/marionette/test_between_emulators.py
@@ -12,27 +12,27 @@ class SMSTest(MarionetteTestCase):
         receiver = self.marionette
 
         self.set_up_test_page(sender, "test.html", ["sms"])
         self.set_up_test_page(receiver, "test.html", ["sms"])
 
         # Setup the event listsener on the receiver, which should store
         # a global variable when an SMS is received.
         message = 'hello world!'
-        self.assertTrue(receiver.execute_script("return window.navigator.mozMobileMessage != null;"))
+        self.assertTrue(receiver.execute_script("return window.navigator.mozSms != null;"))
         receiver.execute_script("""
 global.smsreceived = null;
-window.navigator.mozMobileMessage.addEventListener("received", function(e) {
+window.navigator.mozSms.addEventListener("received", function(e) {
     global.smsreceived = e.message.body;
 });
 """, new_sandbox=False)
 
         # Send the SMS from the sender.
         sender.execute_script("""
-window.navigator.mozMobileMessage.send("%d", "%s");
+window.navigator.mozSms.send("%d", "%s");
 """ % (receiver.emulator.port, message))
 
         # On the receiver, wait up to 10s for an SMS to be received, by 
         # checking the value of the global var that the listener will change.
         receiver.set_script_timeout(0) # TODO no timeout for now since the test fails
         received = receiver.execute_async_script("""
         waitFor(function () {
             marionetteScriptFinished(global.smsreceived);
--- a/dom/mobilemessage/tests/marionette/test_bug814761.js
+++ b/dom/mobilemessage/tests/marionette/test_bug814761.js
@@ -1,22 +1,22 @@
 /* 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.addPermission("sms", true, document);
 
-let manager = window.navigator.mozMobileMessage;
+let sms = window.navigator.mozSms;
 
 // Note: 378 chars and below is fine, but 379 and above will cause the issue.
 // Sending first message works, but second one we get emulator callback but
 // the actual SMS is never received, so script will timeout waiting for the
-// onreceived event. Also note that a single larger message (i.e. 1600
+// sms.onreceived event. Also note that a single larger message (i.e. 1600
 // characters) works; so it is not a compounded send limit.
 let fromNumber = "5551110000";
 let msgLength = 379;
 let msgText = new Array(msgLength + 1).join('a');
 
 let pendingEmulatorCmdCount = 0;
 function sendSmsToEmulator(from, text) {
   ++pendingEmulatorCmdCount;
@@ -36,19 +36,19 @@ function firstIncomingSms() {
 function secondIncomingSms() {
   simulateIncomingSms(cleanUp);
 }
 
 function simulateIncomingSms(nextFunction) {
   log("Simulating incoming multipart SMS (" + msgText.length
       + " chars total).");
 
-  manager.onreceived = function onreceived(event) {
-    log("Received 'onreceived' event.");
-    manager.onreceived = null;
+  sms.onreceived = function onreceived(event) {
+    log("Received 'onreceived' smsmanager event.");
+    sms.onreceived = null;
 
     let incomingSms = event.message;
     ok(incomingSms, "incoming sms");
     is(incomingSms.body, msgText, "msg body");
 
     window.setTimeout(nextFunction, 0);
   };
 
--- a/dom/mobilemessage/tests/marionette/test_emulator_loopback.js
+++ b/dom/mobilemessage/tests/marionette/test_emulator_loopback.js
@@ -9,18 +9,18 @@ SpecialPowers.setBoolPref("dom.sms.enabl
 SpecialPowers.addPermission("sms", true, document);
 
 function cleanUp() {
   SpecialPowers.removePermission("sms", document);
   SpecialPowers.clearUserPref("dom.sms.enabled");
   finish();
 }
 
-let manager = window.navigator.mozMobileMessage;
-ok(manager instanceof MozMobileMessageManager);
+let sms = window.navigator.mozSms;
+ok(sms instanceof MozSmsManager);
 
 function randomString16() {
   return Math.random().toString(36).substr(2, 16);
 }
 
 function times(str, n) {
   return (new Array(n + 1)).join(str);
 }
@@ -28,26 +28,26 @@ function times(str, n) {
 function repeat(func, array, oncomplete) {
   (function do_call(index) {
     let next = index < (array.length - 1) ? do_call.bind(null, index + 1) : oncomplete;
     func.apply(null, [array[index], next]);
   })(0);
 }
 
 function doTest(body, callback) {
-  manager.addEventListener("received", function onReceived(event) {
+  sms.addEventListener("received", function onReceived(event) {
     event.target.removeEventListener(event.type, arguments.callee);
 
     let message = event.message;
     is(message.body, body, "message.body");
 
     window.setTimeout(callback, 0);
   });
 
-  let request = manager.send(SELF, body);
+  let request = sms.send(SELF, body);
   request.onerror = function onerror() {
     ok(false, "failed to send message '" + body + "' to '" + SELF + "'");
   };
 }
 
 repeat(doTest, [
   // Random alphanumeric string of 16 characters.
   randomString16(),
--- a/dom/mobilemessage/tests/marionette/test_filter_date.js
+++ b/dom/mobilemessage/tests/marionette/test_filter_date.js
@@ -1,32 +1,32 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 MARIONETTE_TIMEOUT = 60000;
 
 SpecialPowers.addPermission("sms", true, document);
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
 
-let manager = window.navigator.mozMobileMessage;
+let sms = window.navigator.mozSms;
 let numberMsgs = 10;
 let smsList = new Array();
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(manager, "mozMobileMessage");
+  ok(sms, "mozSms");
   // Ensure test is starting clean with no existing sms messages
   deleteAllMsgs(simulateIncomingSms);
 }
 
 function deleteAllMsgs(nextFunction) {
   let msgList = new Array();
   let filter = new MozSmsFilter;
 
-  let cursor = manager.getMessages(filter, false);
+  let cursor = sms.getMessages(filter, false);
   ok(cursor instanceof DOMCursor,
       "cursor is instanceof " + cursor.constructor);
 
   cursor.onsuccess = function(event) {
     // Check if message was found
     if (cursor.result) {
       msgList.push(cursor.result.id);
       // Now get next message in the list
@@ -41,51 +41,51 @@ function deleteAllMsgs(nextFunction) {
         nextFunction();
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("manager.getMessages error: " + event.target.error.name);
+    log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function deleteMsgs(msgList, nextFunction) {
   let smsId = msgList.shift();
 
   log("Deleting SMS (id: " + smsId + ").");
-  let request = manager.delete(smsId);
+  let request = sms.delete(smsId);
   ok(request instanceof DOMRequest,
       "request is instanceof " + request.constructor);
 
   request.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     if (event.target.result) {
       // Message deleted, continue until none are left
       if (msgList.length) {
         deleteMsgs(msgList, nextFunction);
       } else {
         log("Finished deleting SMS messages.");
         nextFunction();
       }
     } else {
       log("SMS delete failed.");
-      ok(false,"manager.delete request returned false");
+      ok(false,"sms.delete request returned false");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "manager.delete request returned unexpected error: "
+    ok(false, "sms.delete request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 function simulateIncomingSms() {
   let text = "Incoming SMS number " + (smsList.length + 1);
   let remoteNumber = "5552229797";
@@ -97,17 +97,17 @@ function simulateIncomingSms() {
   rcvdEmulatorCallback = false;
   runEmulatorCmd("sms send " + remoteNumber + " " + text, function(result) {
     is(result[0], "OK", "emulator callback");
     rcvdEmulatorCallback = true;
   });
 }
 
 // Callback for incoming sms
-manager.onreceived = function onreceived(event) {
+sms.onreceived = function onreceived(event) {
   log("Received 'onreceived' sms event.");
   let incomingSms = event.message;
   log("Received SMS (id: " + incomingSms.id + ").");
 
   smsList.push(incomingSms);
 
   // Wait for emulator to catch up before continuing
   waitFor(nextRep,function() {
@@ -131,17 +131,17 @@ 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 cursor = manager.getMessages(filter, false);
+  let cursor = sms.getMessages(filter, false);
   ok(cursor instanceof DOMCursor,
       "cursor is instanceof " + cursor.constructor);
 
   cursor.onsuccess = function(event) {
     log("Received 'onsuccess' event.");
 
     if (cursor.result) {
       // Another message found
@@ -154,41 +154,41 @@ function getMsgs() {
       // No more messages; ensure correct number found
       if (foundSmsList.length == smsList.length) {
         log("SMS getMessages returned " + foundSmsList.length +
             " messages as expected.");
         verifyFoundMsgs(foundSmsList);
       } else {
         log("SMS getMessages returned " + foundSmsList.length +
             " messages, but expected " + smsList.length + ".");
-        ok(false, "Incorrect number of messages returned by manager.getMessages");
+        ok(false, "Incorrect number of messages returned by sms.getMessages");
         deleteAllMsgs(cleanUp);
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("manager.getMessages error: " + event.target.error.name);
+    log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function verifyFoundMsgs(foundSmsList) {
   for (var x = 0; x < foundSmsList.length; x++) {
     is(foundSmsList[x].id, smsList[x].id, "id");
     is(foundSmsList[x].timestamp.getTime(), smsList[x].timestamp.getTime(),
         "timestmap");
   }
   deleteAllMsgs(cleanUp);
 }
 
 function cleanUp() {
-  manager.onreceived = null;
+  sms.onreceived = null;
   SpecialPowers.removePermission("sms", document);
   SpecialPowers.clearUserPref("dom.sms.enabled");
   finish();
 }
 
 // Start the test
 verifyInitialState();
--- a/dom/mobilemessage/tests/marionette/test_filter_date_notfound.js
+++ b/dom/mobilemessage/tests/marionette/test_filter_date_notfound.js
@@ -1,32 +1,32 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 MARIONETTE_TIMEOUT = 60000;
 
 SpecialPowers.addPermission("sms", true, document);
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
 
-let manager = window.navigator.mozMobileMessage;
+let sms = window.navigator.mozSms;
 let numberMsgs = 10;
 let smsList = new Array();
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(manager, "mozMobileMessage");
+  ok(sms, "mozSms");
   // Ensure test is starting clean with no existing sms messages
   deleteAllMsgs(simulateIncomingSms);
 }
 
 function deleteAllMsgs(nextFunction) {
   let msgList = new Array();
   let filter = new MozSmsFilter;
 
-  let cursor = manager.getMessages(filter, false);
+  let cursor = sms.getMessages(filter, false);
   ok(cursor instanceof DOMCursor,
       "cursor is instanceof " + cursor.constructor);
 
   cursor.onsuccess = function(event) {
     // Check if message was found
     if (cursor.result) {
       msgList.push(cursor.result.id);
       // Now get next message in the list
@@ -41,51 +41,51 @@ function deleteAllMsgs(nextFunction) {
         nextFunction();
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("manager.getMessages error: " + event.target.error.name);
+    log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function deleteMsgs(msgList, nextFunction) {
   let smsId = msgList.shift();
 
   log("Deleting SMS (id: " + smsId + ").");
-  let request = manager.delete(smsId);
+  let request = sms.delete(smsId);
   ok(request instanceof DOMRequest,
       "request is instanceof " + request.constructor);
 
   request.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     if (event.target.result) {
       // Message deleted, continue until none are left
       if (msgList.length) {
         deleteMsgs(msgList, nextFunction);
       } else {
         log("Finished deleting SMS messages.");
         nextFunction();
       }
     } else {
       log("SMS delete failed.");
-      ok(false,"manager.delete request returned false");
+      ok(false,"sms.delete request returned false");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "manager.delete request returned unexpected error: "
+    ok(false, "sms.delete request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 function simulateIncomingSms() {
   let text = "Incoming SMS number " + (smsList.length + 1);
   let remoteNumber = "5552229797";
@@ -97,17 +97,17 @@ function simulateIncomingSms() {
   rcvdEmulatorCallback = false;
   runEmulatorCmd("sms send " + remoteNumber + " " + text, function(result) {
     is(result[0], "OK", "emulator callback");
     rcvdEmulatorCallback = true;
   });
 }
 
 // Callback for incoming sms
-manager.onreceived = function onreceived(event) {
+sms.onreceived = function onreceived(event) {
   log("Received 'onreceived' sms event.");
   let incomingSms = event.message;
   log("Received SMS (id: " + incomingSms.id + ").");
 
   smsList.push(incomingSms);
 
   // Wait for emulator to catch up before continuing
   waitFor(nextRep,function() {
@@ -131,17 +131,17 @@ 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 cursor = manager.getMessages(filter, false);
+  let cursor = sms.getMessages(filter, false);
   ok(cursor instanceof DOMCursor,
       "cursor is instanceof " + cursor.constructor);
 
   cursor.onsuccess = function(event) {
     log("Received 'onsuccess' event.");
 
     if (cursor.result) {
       // Another message found
@@ -153,23 +153,23 @@ function getMsgs() {
       log("SMS getMessages returned zero messages as expected.");
     }
     deleteAllMsgs(cleanUp);
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("manager.getMessages error: " + event.target.error.name);
+    log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function cleanUp() {
-  manager.onreceived = null;
+  sms.onreceived = null;
   SpecialPowers.removePermission("sms", document);
   SpecialPowers.clearUserPref("dom.sms.enabled");
   finish();
 }
 
 // Start the test
 verifyInitialState();
--- a/dom/mobilemessage/tests/marionette/test_filter_mixed.js
+++ b/dom/mobilemessage/tests/marionette/test_filter_mixed.js
@@ -4,18 +4,18 @@
 MARIONETTE_TIMEOUT = 60000;
 
 const SELF = 5554;
 const NUM_THREADS = 10;
 
 SpecialPowers.addPermission("sms", true, document);
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
 
-let manager = window.navigator.mozMobileMessage;
-ok(manager instanceof MozMobileMessageManager);
+let sms = window.navigator.mozSms;
+ok(sms instanceof MozSmsManager);
 
 let pendingEmulatorCmdCount = 0;
 function sendSmsToEmulator(from, text) {
   ++pendingEmulatorCmdCount;
 
   let cmd = "sms send " + from + " " + text;
   runEmulatorCmd(cmd, function (result) {
     --pendingEmulatorCmdCount;
@@ -57,17 +57,17 @@ let tasks = {
   }
 };
 
 function getAllMessages(callback, filter, reverse) {
   if (!filter) {
     filter = new MozSmsFilter;
   }
   let messages = [];
-  let request = manager.getMessages(filter, reverse || false);
+  let request = sms.getMessages(filter, reverse || false);
   request.onsuccess = function(event) {
     if (request.result) {
       messages.push(request.result);
       request.continue();
       return;
     }
 
     window.setTimeout(callback.bind(null, messages), 0);
@@ -78,17 +78,17 @@ function deleteAllMessages(next) {
   getAllMessages(function deleteAll(messages) {
     let message = messages.shift();
     if (!message) {
       ok(true, "all messages deleted");
       tasks.next();
       return;
     }
 
-    let request = manager.delete(message.id);
+    let request = sms.delete(message.id);
     request.onsuccess = deleteAll.bind(null, messages);
     request.onerror = function (event) {
       ok(false, "failed to delete all messages");
       tasks.finish();
     }
   });
 }
 
@@ -119,41 +119,41 @@ tasks.push(deleteAllMessages);
  *   send    to   "+15555315559"
  *   receive from "5555315559", count = 10
  */
 let threadIds = [];
 tasks.push(function populateMessages() {
   let count = 0;
 
   function sendMessage(iter) {
-    let request = manager.send("+1555531555" + iter, "Nice to meet you");
+    let request = sms.send("+1555531555" + iter, "Nice to meet you");
     request.onsuccess = function onRequestSuccess(event) {
-      manager.addEventListener("received", onReceived);
+      sms.addEventListener("received", onReceived);
 
       threadIds.push(request.result.threadId);
 
       sendSmsToEmulator("555531555" + iter, "Nice to meet you, too");
     }
     request.onerror = function onRequestError(event) {
       tasks.finish();
     }
   }
 
   function onReceived(event) {
-    manager.removeEventListener("received", onReceived);
+    sms.removeEventListener("received", onReceived);
 
     if (event.message.threadId != threadIds[threadIds.length - 1]) {
       ok(false, "Thread IDs of sent and received message mismatch.");
       tasks.finish();
       return;
     }
 
     ++count;
     if (count % 2) {
-      let request = manager.markMessageRead(event.message.id, true);
+      let request = sms.markMessageRead(event.message.id, true);
       request.onsuccess = function onRequestSuccess(event) {
         if (count < NUM_THREADS) {
           sendMessage(count);
         } else {
           tasks.next();
         }
       }
       request.onerror = function onRequestError(event) {
--- a/dom/mobilemessage/tests/marionette/test_filter_number_multiple.js
+++ b/dom/mobilemessage/tests/marionette/test_filter_number_multiple.js
@@ -1,34 +1,34 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 MARIONETTE_TIMEOUT = 60000;
 
 SpecialPowers.addPermission("sms", true, document);
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
 
-let manager = window.navigator.mozMobileMessage;
+let sms = window.navigator.mozSms;
 let numberMsgs = 10;
 let smsList = new Array();
 let defaultRemoteNumber = "+15552227777";
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(manager, "mozMobileMessage");
+  ok(sms, "mozSms");
   // Ensure test is starting clean with no existing sms messages
   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 cursor = manager.getMessages(filter, false);
+  let cursor = sms.getMessages(filter, false);
   ok(cursor instanceof DOMCursor,
       "cursor is instanceof " + cursor.constructor);
 
   cursor.onsuccess = function(event) {
     // Check if message was found
     if (cursor.result) {
       msgList.push(cursor.result.id);
       // Now get next message in the list
@@ -43,97 +43,97 @@ function deleteAllMsgs(nextFunction) {
         nextFunction();
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("manager.getMessages error: " + event.target.error.name);
+    log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function deleteMsgs(msgList, nextFunction) {
   // Delete the SMS messages specified in the given list
   let smsId = msgList.shift();
 
   log("Deleting SMS (id: " + smsId + ").");
-  let request = manager.delete(smsId);
+  let request = sms.delete(smsId);
   ok(request instanceof DOMRequest,
       "request is instanceof " + request.constructor);
 
   request.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     if (event.target.result) {
       // Message deleted, continue until none are left
       if (msgList.length) {
         deleteMsgs(msgList, nextFunction);
       } else {
         log("Finished deleting SMS messages.");
         nextFunction();
       }
     } else {
       log("SMS delete failed.");
-      ok(false,"manager.delete request returned false");
+      ok(false,"sms.delete request returned false");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "manager.delete request returned unexpected error: "
+    ok(false, "sms.delete request returned unexpected error: "
         + event.target.error.name );
     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 = "+15558120649";
   let text = "Outgoing SMS brought to you by Firefox OS!";
 
   log("Sending an SMS.");
 
-  manager.onsent = function(event) {
-    log("Received 'onsent' event.");
+  sms.onsent = function(event) {
+    log("Received 'onsent' smsmanager event.");
     gotSmsSent = true;
     log("Sent SMS (id: " + event.message.id + ").");
     if (gotSmsSent && gotRequestSuccess) {
       simulateIncomingSms();
     }
   };
 
-  let request = manager.send(remoteNumber, text);
+  let request = sms.send(remoteNumber, text);
   ok(request instanceof DOMRequest,
       "request is instanceof " + request.constructor);
 
   request.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     if (event.target.result) {
       gotRequestSuccess = true;
       if (gotSmsSent && gotRequestSuccess) {
         simulateIncomingSms();
       }
     } else {
-      log("smsrequest returned false for manager.send");
+      log("smsrequest returned false for sms.send");
       ok(false,"SMS send failed");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "manager.send request returned unexpected error: "
+    ok(false, "sms.send request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 function simulateIncomingSms(remoteNumber) {
   // Simulate incoming SMS messages from specified (or default) remote number
   let text = "Incoming SMS number " + (smsList.length + 1);
@@ -146,17 +146,17 @@ function simulateIncomingSms(remoteNumbe
   // Simulate incoming SMS sent from remoteNumber to our emulator
   rcvdEmulatorCallback = false;
   runEmulatorCmd("sms send " + remoteNumber + " " + text, function(result) {
     is(result[0], "OK", "emulator callback");
     rcvdEmulatorCallback = true;
   });
 }
 
-manager.onreceived = function onreceived(event) {
+sms.onreceived = function onreceived(event) {
   // Callback for incoming SMS
   log("Received 'onreceived' sms event.");
   let incomingSms = event.message;
   log("Received SMS (id: " + incomingSms.id + ").");
 
   smsList.push(incomingSms);
 
   // Wait for emulator to catch up before continuing
@@ -185,17 +185,17 @@ 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 cursor = manager.getMessages(filter, false);
+  let cursor = sms.getMessages(filter, false);
   ok(cursor instanceof DOMCursor,
       "cursor is instanceof " + cursor.constructor);
 
   cursor.onsuccess = function(event) {
     log("Received 'onsuccess' event.");
 
     if (cursor.result) {
       // Another message found
@@ -208,41 +208,41 @@ function getMsgs(secondNumber) {
       // 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);
       } else {
         log("SMS getMessages returned " + foundSmsList.length +
             " messages, but expected " + smsList.length + ".");
-        ok(false, "Incorrect number of messages returned by manager.getMessages");
+        ok(false, "Incorrect number of messages returned by sms.getMessages");
         deleteAllMsgs(cleanUp);
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("manager.getMessages error: " + event.target.error.name);
+    log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function verifyFoundMsgs(foundSmsList) {
   // Verify the SMS messages returned by getMessages are the correct ones
   for (var x = 0; x < foundSmsList.length; x++) {
     is(foundSmsList[x].id, smsList[x].id, "id");
     is(foundSmsList[x].sender, smsList[x].sender, "number");
   }
   deleteAllMsgs(cleanUp);
 }
 
 function cleanUp() {
-  manager.onreceived = null;
+  sms.onreceived = null;
   SpecialPowers.removePermission("sms", document);
   SpecialPowers.clearUserPref("dom.sms.enabled");
   finish();
 }
 
 // Start the test
 verifyInitialState();
--- a/dom/mobilemessage/tests/marionette/test_filter_number_single.js
+++ b/dom/mobilemessage/tests/marionette/test_filter_number_single.js
@@ -1,34 +1,34 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 MARIONETTE_TIMEOUT = 60000;
 
 SpecialPowers.addPermission("sms", true, document);
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
 
-let manager = window.navigator.mozMobileMessage;
+let sms = window.navigator.mozSms;
 let numberMsgs = 10;
 let smsList = new Array();
 let defaultRemoteNumber = "+15552227777";
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(manager, "mozMobileMessage");
+  ok(sms, "mozSms");
   // Ensure test is starting clean with no existing sms messages
   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 cursor = manager.getMessages(filter, false);
+  let cursor = sms.getMessages(filter, false);
   ok(cursor instanceof DOMCursor,
       "cursor is instanceof " + cursor.constructor);
 
   cursor.onsuccess = function(event) {
     // Check if message was found
     if (cursor.result) {
       msgList.push(cursor.result.id);
       // Now get next message in the list
@@ -43,52 +43,52 @@ function deleteAllMsgs(nextFunction) {
         nextFunction();
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("manager.getMessages error: " + event.target.error.name);
+    log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function deleteMsgs(msgList, nextFunction) {
   // Delete the SMS messages specified in the given list
   let smsId = msgList.shift();
 
   log("Deleting SMS (id: " + smsId + ").");
-  let request = manager.delete(smsId);
+  let request = sms.delete(smsId);
   ok(request instanceof DOMRequest,
       "request is instanceof " + request.constructor);
 
   request.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     if (event.target.result) {
       // Message deleted, continue until none are left
       if (msgList.length) {
         deleteMsgs(msgList, nextFunction);
       } else {
         log("Finished deleting SMS messages.");
         nextFunction();
       }
     } else {
       log("SMS delete failed.");
-      ok(false,"manager.delete request returned false");
+      ok(false,"sms.delete request returned false");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "manager.delete request returned unexpected error: "
+    ok(false, "sms.delete request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 function simulateIncomingSms(remoteNumber) {
   // Simulate incoming SMS messages from specified (or default) remote number
   let text = "Incoming SMS number " + (smsList.length + 1);
@@ -101,17 +101,17 @@ function simulateIncomingSms(remoteNumbe
   // Simulate incoming sms sent from remoteNumber to our emulator
   rcvdEmulatorCallback = false;
   runEmulatorCmd("sms send " + remoteNumber + " " + text, function(result) {
     is(result[0], "OK", "emulator callback");
     rcvdEmulatorCallback = true;
   });
 }
 
-manager.onreceived = function onreceived(event) {
+sms.onreceived = function onreceived(event) {
   // Callback for incoming SMS
   log("Received 'onreceived' sms event.");
   let incomingSms = event.message;
   log("Received SMS (id: " + incomingSms.id + ").");
 
   smsList.push(incomingSms);
 
   // Wait for emulator to catch up before continuing
@@ -143,17 +143,17 @@ 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 cursor = manager.getMessages(filter, false);
+  let cursor = sms.getMessages(filter, false);
   ok(cursor instanceof DOMCursor,
       "cursor is instanceof " + cursor.constructor);
 
   cursor.onsuccess = function(event) {
     log("Received 'onsuccess' event.");
 
     if (cursor.result) {
       // Another message found
@@ -166,41 +166,41 @@ function getMsgs() {
       // 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);
       } else {
         log("SMS getMessages returned " + foundSmsList.length +
             " messages, but expected " + smsList.length + ".");
-        ok(false, "Incorrect number of messages returned by manager.getMessages");
+        ok(false, "Incorrect number of messages returned by sms.getMessages");
         deleteAllMsgs(cleanUp);
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("manager.getMessages error: " + event.target.error.name);
+    log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function verifyFoundMsgs(foundSmsList) {
   // Verify the SMS messages returned by getMessages are the correct ones
   for (var x = 0; x < foundSmsList.length; x++) {
     is(foundSmsList[x].id, smsList[x].id, "id");
     is(foundSmsList[x].sender, smsList[x].sender, "number");
   }
   deleteAllMsgs(cleanUp);
 }
 
 function cleanUp() {
-  manager.onreceived = null;
+  sms.onreceived = null;
   SpecialPowers.removePermission("sms", document);
   SpecialPowers.clearUserPref("dom.sms.enabled");
   finish();
 }
 
 // Start the test
 verifyInitialState();
--- a/dom/mobilemessage/tests/marionette/test_filter_read.js
+++ b/dom/mobilemessage/tests/marionette/test_filter_read.js
@@ -1,32 +1,32 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 MARIONETTE_TIMEOUT = 60000;
 
 SpecialPowers.addPermission("sms", true, document);
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
 
-let manager = window.navigator.mozMobileMessage;
+let sms = window.navigator.mozSms;
 let numberMsgs = 10;
 let smsList = new Array();
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(manager, "mozMobileMessage");
+  ok(sms, "mozSms");
   // Ensure test is starting clean with no existing sms messages
   deleteAllMsgs(simulateIncomingSms);
 }
 
 function deleteAllMsgs(nextFunction) {
   let msgList = new Array();
   let filter = new MozSmsFilter;
 
-  let cursor = manager.getMessages(filter, false);
+  let cursor = sms.getMessages(filter, false);
   ok(cursor instanceof DOMCursor,
       "cursor is instanceof " + cursor.constructor);
 
   cursor.onsuccess = function(event) {
     // Check if message was found
     if (cursor.result) {
       msgList.push(cursor.result.id);
       // Now get next message in the list
@@ -41,51 +41,51 @@ function deleteAllMsgs(nextFunction) {
         nextFunction();
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("manager.getMessages error: " + event.target.error.name);
+    log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function deleteMsgs(msgList, nextFunction) {
   let smsId = msgList.shift();
 
   log("Deleting SMS (id: " + smsId + ").");
-  let request = manager.delete(smsId);
+  let request = sms.delete(smsId);
   ok(request instanceof DOMRequest,
       "request is instanceof " + request.constructor);
 
   request.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     if (event.target.result) {
       // Message deleted, continue until none are left
       if (msgList.length) {
         deleteMsgs(msgList, nextFunction);
       } else {
         log("Finished deleting SMS messages.");
         nextFunction();
       }
     } else {
       log("SMS delete failed.");
-      ok(false,"manager.delete request returned false");
+      ok(false,"sms.delete request returned false");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "manager.delete request returned unexpected error: "
+    ok(false, "sms.delete request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 function simulateIncomingSms() {
   let text = "Incoming SMS number " + (smsList.length + 1);
   let remoteNumber = "5552229797";
@@ -97,17 +97,17 @@ function simulateIncomingSms() {
   rcvdEmulatorCallback = false;
   runEmulatorCmd("sms send " + remoteNumber + " " + text, function(result) {
     is(result[0], "OK", "emulator callback");
     rcvdEmulatorCallback = true;
   });
 }
 
 // Callback for incoming sms
-manager.onreceived = function onreceived(event) {
+sms.onreceived = function onreceived(event) {
   log("Received 'onreceived' sms event.");
   let incomingSms = event.message;
   log("Received SMS (id: " + incomingSms.id + ").");
 
   // Add newly received message to array of received msgs
   smsList.push(incomingSms);
 
   // Wait for emulator to catch up before continuing
@@ -125,55 +125,55 @@ function nextRep() {
     smsList.shift();
     markMsgRead(smsList.slice(0));
   }
 }
 
 function markMsgRead(smsMsgs) {  
   nextSms = smsMsgs.shift();
   log("Marking SMS (id: " + nextSms.id + ") as read.");
-  let request = manager.markMessageRead(nextSms.id, true);
+  let request = sms.markMessageRead(nextSms.id, true);
   ok(request instanceof DOMRequest,
       "request is instanceof " + request.constructor);
 
   request.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     if (event.target.result) {
       // Message marked as read, continue until none are left
       if (smsMsgs.length) {
         markMsgRead(smsMsgs);
       } else {
         // Done, now test the filter
         getMsgs();
       }
     } else {
       log("SMS markMessageRead failed.");
-      ok(false,"manager.markMessageRead request returned false");
+      ok(false,"sms.markMessageRead request returned false");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "manager.markMessageRead request returned unexpected error: "
+    ok(false, "sms.markMessageRead request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 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 cursor = manager.getMessages(filter, false);
+  let cursor = sms.getMessages(filter, false);
   ok(cursor instanceof DOMCursor,
       "cursor is instanceof " + cursor.constructor);
 
   cursor.onsuccess = function(event) {
     log("Received 'onsuccess' event.");
 
     if (cursor.result) {
       // Another message found
@@ -186,40 +186,40 @@ function getMsgs() {
       // No more messages; ensure correct number found
       if (foundSmsList.length == smsList.length) {
         log("SMS getMessages returned " + foundSmsList.length +
             " messages as expected.");
         verifyFoundMsgs(foundSmsList);
       } else {
         log("SMS getMessages returned " + foundSmsList.length +
             " messages, but expected " + smsList.length + ".");
-        ok(false, "Incorrect number of messages returned by manager.getMessages");
+        ok(false, "Incorrect number of messages returned by sms.getMessages");
         deleteAllMsgs(cleanUp);
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("manager.getMessages error: " + event.target.error.name);
+    log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function verifyFoundMsgs(foundSmsList) {
   for (var x = 0; x < foundSmsList.length; x++) {
     is(foundSmsList[x].id, smsList[x].id, "id");
     is(foundSmsList[x].read, true, "read");
   }
   deleteAllMsgs(cleanUp);
 }
 
 function cleanUp() {
-  manager.onreceived = null;
+  sms.onreceived = null;
   SpecialPowers.removePermission("sms", document);
   SpecialPowers.clearUserPref("dom.sms.enabled");
   finish();
 }
 
 // Start the test
 verifyInitialState();
--- a/dom/mobilemessage/tests/marionette/test_filter_received.js
+++ b/dom/mobilemessage/tests/marionette/test_filter_received.js
@@ -1,32 +1,32 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 MARIONETTE_TIMEOUT = 60000;
 
 SpecialPowers.addPermission("sms", true, document);
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
 
-let manager = window.navigator.mozMobileMessage;
+let sms = window.navigator.mozSms;
 let numberMsgs = 10;
 let smsList = new Array();
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(manager, "mozMobileMessage");
+  ok(sms, "mozSms");
   // Ensure test is starting clean with no existing sms messages
   deleteAllMsgs(simulateIncomingSms);
 }
 
 function deleteAllMsgs(nextFunction) {
   let msgList = new Array();
   let filter = new MozSmsFilter;
 
-  let cursor = manager.getMessages(filter, false);
+  let cursor = sms.getMessages(filter, false);
   ok(cursor instanceof DOMCursor,
       "cursor is instanceof " + cursor.constructor);
 
   cursor.onsuccess = function(event) {
     // Check if message was found
     if (cursor.result) {
       msgList.push(cursor.result.id);
       // Now get next message in the list
@@ -41,51 +41,51 @@ function deleteAllMsgs(nextFunction) {
         nextFunction();
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("manager.getMessages error: " + event.target.error.name);
+    log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function deleteMsgs(msgList, nextFunction) {
   let smsId = msgList.shift();
 
   log("Deleting SMS (id: " + smsId + ").");
-  let request = manager.delete(smsId);
+  let request = sms.delete(smsId);
   ok(request instanceof DOMRequest,
       "request is instanceof " + request.constructor);
 
   request.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     if (event.target.result) {
       // Message deleted, continue until none are left
       if (msgList.length) {
         deleteMsgs(msgList, nextFunction);
       } else {
         log("Finished deleting SMS messages.");
         nextFunction();
       }
     } else {
       log("SMS delete failed.");
-      ok(false,"manager.delete request returned false");
+      ok(false,"sms.delete request returned false");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "manager.delete request returned unexpected error: "
+    ok(false, "sms.delete request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 function simulateIncomingSms() {
   let text = "Incoming SMS number " + (smsList.length + 1);
   let remoteNumber = "5552229797";
@@ -97,17 +97,17 @@ function simulateIncomingSms() {
   rcvdEmulatorCallback = false;
   runEmulatorCmd("sms send " + remoteNumber + " " + text, function(result) {
     is(result[0], "OK", "emulator callback");
     rcvdEmulatorCallback = true;
   });
 }
 
 // Callback for incoming sms
-manager.onreceived = function onreceived(event) {
+sms.onreceived = function onreceived(event) {
   log("Received 'onreceived' sms event.");
   let incomingSms = event.message;
   log("Received SMS (id: " + incomingSms.id + ").");
 
   smsList.push(incomingSms);
 
   // Wait for emulator to catch up before continuing
   waitFor(nextRep,function() {
@@ -127,65 +127,65 @@ function nextRep() {
 function sendSms() {  
   let gotSmsSent = false;
   let gotRequestSuccess = false;
   let remoteNumber = "5557779999";
   let text = "Outgoing SMS brought to you by Firefox OS!";
 
   log("Sending an SMS.");
 
-  manager.onsent = function(event) {
-    log("Received 'onsent' event.");
+  sms.onsent = function(event) {
+    log("Received 'onsent' smsmanager event.");
     gotSmsSent = true;
     let sentSms = event.message;
     log("Sent SMS (id: " + sentSms.id + ").");
     is(sentSms.delivery, "sent", "delivery");
     if (gotSmsSent && gotRequestSuccess) {
       // Test the filter
       getMsgs();
     }
   };
 
-  let request = manager.send(remoteNumber, text);
+  let request = sms.send(remoteNumber, text);
   ok(request instanceof DOMRequest,
       "request is instanceof " + request.constructor);
 
   request.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     if(event.target.result) {
       gotRequestSuccess = true;
       if (gotSmsSent && gotRequestSuccess) {
         // Test the filter
         getMsgs(); 
       }
     } else {
-      log("smsrequest returned false for manager.send");
+      log("smsrequest returned false for sms.send");
       ok(false,"SMS send failed");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "manager.send request returned unexpected error: "
+    ok(false, "sms.send request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 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 cursor = manager.getMessages(filter, false);
+  let cursor = sms.getMessages(filter, false);
   ok(cursor instanceof DOMCursor,
       "cursor is instanceof " + cursor.constructor);
 
   cursor.onsuccess = function(event) {
     log("Received 'onsuccess' event.");
 
     if (cursor.result) {
       // Another message found
@@ -198,40 +198,40 @@ function getMsgs() {
       // No more messages; ensure correct number found
       if (foundSmsList.length == smsList.length) {
         log("SMS getMessages returned " + foundSmsList.length +
             " messages as expected.");
         verifyFoundMsgs(foundSmsList);
       } else {
         log("SMS getMessages returned " + foundSmsList.length +
             " messages, but expected " + smsList.length + ".");
-        ok(false, "Incorrect number of messages returned by manager.getMessages");
+        ok(false, "Incorrect number of messages returned by sms.getMessages");
         deleteAllMsgs(cleanUp);
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("manager.getMessages error: " + event.target.error.name);
+    log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function verifyFoundMsgs(foundSmsList) {
   for (var x = 0; x < foundSmsList.length; x++) {
     is(foundSmsList[x].id, smsList[x].id, "id");
     is(foundSmsList[x].delivery, "received", "delivery");
   }
   deleteAllMsgs(cleanUp);
 }
 
 function cleanUp() {
-  manager.onreceived = null;
+  sms.onreceived = null;
   SpecialPowers.removePermission("sms", document);
   SpecialPowers.clearUserPref("dom.sms.enabled");
   finish();
 }
 
 // Start the test
 verifyInitialState();
--- a/dom/mobilemessage/tests/marionette/test_filter_sent.js
+++ b/dom/mobilemessage/tests/marionette/test_filter_sent.js
@@ -1,32 +1,32 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 MARIONETTE_TIMEOUT = 60000;
 
 SpecialPowers.addPermission("sms", true, document);
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
 
-let manager = window.navigator.mozMobileMessage;
+let sms = window.navigator.mozSms;
 let numberMsgs = 10;
 let smsList = new Array();
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(manager, "mozMobileMessage");
+  ok(sms, "mozSms");
   // Ensure test is starting clean with no existing sms messages
   deleteAllMsgs(sendSms);
 }
 
 function deleteAllMsgs(nextFunction) {
   let msgList = new Array();
   let filter = new MozSmsFilter;
 
-  let cursor = manager.getMessages(filter, false);
+  let cursor = sms.getMessages(filter, false);
   ok(cursor instanceof DOMCursor,
       "cursor is instanceof " + cursor.constructor);
 
   cursor.onsuccess = function(event) {
     // Check if message was found
     if (cursor.result) {
       msgList.push(cursor.result.id);
       // Now get next message in the list
@@ -41,99 +41,99 @@ function deleteAllMsgs(nextFunction) {
         nextFunction();
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("manager.getMessages error: " + event.target.error.name);
+    log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function deleteMsgs(msgList, nextFunction) {
   let smsId = msgList.shift();
 
   log("Deleting SMS (id: " + smsId + ").");
-  let request = manager.delete(smsId);
+  let request = sms.delete(smsId);
   ok(request instanceof DOMRequest,
       "request is instanceof " + request.constructor);
 
   request.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     if (event.target.result) {
       // Message deleted, continue until none are left
       if (msgList.length) {
         deleteMsgs(msgList, nextFunction);
       } else {
         log("Finished deleting SMS messages.");
         nextFunction();
       }
     } else {
       log("SMS delete failed.");
-      ok(false,"manager.delete request returned false");
+      ok(false,"sms.delete request returned false");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "manager.delete request returned unexpected error: "
+    ok(false, "sms.delete request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 function sendSms() {  
   let gotSmsSent = false;
   let gotRequestSuccess = false;
   let remoteNumber = "5557779999";
   let text = "Outgoing SMS brought to you by Firefox OS!";
 
   log("Sending SMS " + (smsList.length + 1) + " of "
       + (numberMsgs - 1) + ".");
 
-  manager.onsent = function(event) {
-    log("Received 'onsent' event.");
+  sms.onsent = function(event) {
+    log("Received 'onsent' smsmanager event.");
     gotSmsSent = true;
     let sentSms = event.message;
     log("Sent SMS (id: " + sentSms.id + ").");
     is(sentSms.delivery, "sent", "delivery");
     smsList.push(sentSms);
     if (gotSmsSent && gotRequestSuccess) {
       nextRep();
     }
   };
 
-  let request = manager.send(remoteNumber, text);
+  let request = sms.send(remoteNumber, text);
   ok(request instanceof DOMRequest,
       "request is instanceof " + request.constructor);
 
   request.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     if(event.target.result) {
       gotRequestSuccess = true;
       if (gotSmsSent && gotRequestSuccess) {
         nextRep(); 
       }
     } else {
-      log("smsrequest returned false for manager.send");
+      log("smsrequest returned false for sms.send");
       ok(false,"SMS send failed");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "manager.send request returned unexpected error: "
+    ok(false, "sms.send request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 function nextRep() {
   if (smsList.length < (numberMsgs - 1)) {
     sendSms();
@@ -153,17 +153,17 @@ function simulateIncomingSms() {
   rcvdEmulatorCallback = false;
   runEmulatorCmd("sms send " + remoteNumber + " " + text, function(result) {
     is(result[0], "OK", "emulator callback");
     rcvdEmulatorCallback = true;
   });
 }
 
 // Callback for incoming sms
-manager.onreceived = function onreceived(event) {
+sms.onreceived = function onreceived(event) {
   log("Received 'onreceived' sms event.");
   let incomingSms = event.message;
   log("Received SMS (id: " + incomingSms.id + ").");
 
   // Wait for emulator to catch up before continuing
   waitFor(getMsgs,function() {
     return(rcvdEmulatorCallback);
   });
@@ -172,17 +172,17 @@ manager.onreceived = function onreceived
 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 cursor = manager.getMessages(filter, false);
+  let cursor = sms.getMessages(filter, false);
   ok(cursor instanceof DOMCursor,
       "cursor is instanceof " + cursor.constructor);
 
   cursor.onsuccess = function(event) {
     log("Received 'onsuccess' event.");
 
     if (cursor.result) {
       // Another message found
@@ -195,40 +195,40 @@ function getMsgs() {
       // No more messages; ensure correct number found
       if (foundSmsList.length == smsList.length) {
         log("SMS getMessages returned " + foundSmsList.length +
             " messages as expected.");
         verifyFoundMsgs(foundSmsList);
       } else {
         log("SMS getMessages returned " + foundSmsList.length +
             " messages, but expected " + smsList.length + ".");
-        ok(false, "Incorrect number of messages returned by manager.getMessages");
+        ok(false, "Incorrect number of messages returned by sms.getMessages");
         deleteAllMsgs(cleanUp);
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("manager.getMessages error: " + event.target.error.name);
+    log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function verifyFoundMsgs(foundSmsList) {
   for (var x = 0; x < foundSmsList.length; x++) {
     is(foundSmsList[x].id, smsList[x].id, "id");
     is(foundSmsList[x].delivery, "sent", "delivery");
   }
   deleteAllMsgs(cleanUp);
 }
 
 function cleanUp() {
-  manager.onreceived = null;
+  sms.onreceived = null;
   SpecialPowers.removePermission("sms", document);
   SpecialPowers.clearUserPref("dom.sms.enabled");
   finish();
 }
 
 // Start the test
 verifyInitialState();
--- a/dom/mobilemessage/tests/marionette/test_filter_unread.js
+++ b/dom/mobilemessage/tests/marionette/test_filter_unread.js
@@ -1,32 +1,32 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 MARIONETTE_TIMEOUT = 60000;
 
 SpecialPowers.addPermission("sms", true, document);
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
 
-let manager = window.navigator.mozMobileMessage;
+let sms = window.navigator.mozSms;
 let numberMsgs = 10;
 let smsList = new Array();
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(manager, "mozMobileMessage");
+  ok(sms, "mozSms");
   // Ensure test is starting clean with no existing sms messages
   deleteAllMsgs(simulateIncomingSms);
 }
 
 function deleteAllMsgs(nextFunction) {
   let msgList = new Array();
   let filter = new MozSmsFilter;
 
-  let cursor = manager.getMessages(filter, false);
+  let cursor = sms.getMessages(filter, false);
   ok(cursor instanceof DOMCursor,
       "cursor is instanceof " + cursor.constructor);
 
   cursor.onsuccess = function(event) {
     // Check if message was found
     if (cursor.result) {
       msgList.push(cursor.result.id);
       // Now get next message in the list
@@ -41,51 +41,51 @@ function deleteAllMsgs(nextFunction) {
         nextFunction();
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("manager.getMessages error: " + event.target.error.name);
+    log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function deleteMsgs(msgList, nextFunction) {
   let smsId = msgList.shift();
 
   log("Deleting SMS (id: " + smsId + ").");
-  let request = manager.delete(smsId);
+  let request = sms.delete(smsId);
   ok(request instanceof DOMRequest,
       "request is instanceof " + request.constructor);
 
   request.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     if (event.target.result) {
       // Message deleted, continue until none are left
       if (msgList.length) {
         deleteMsgs(msgList, nextFunction);
       } else {
         log("Finished deleting SMS messages.");
         nextFunction();
       }
     } else {
       log("SMS delete failed.");
-      ok(false,"manager.delete request returned false");
+      ok(false,"sms.delete request returned false");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "manager.delete request returned unexpected error: "
+    ok(false, "sms.delete request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 function simulateIncomingSms() {
   let text = "Incoming SMS number " + (smsList.length + 1);
   let remoteNumber = "5552229797";
@@ -97,17 +97,17 @@ function simulateIncomingSms() {
   rcvdEmulatorCallback = false;
   runEmulatorCmd("sms send " + remoteNumber + " " + text, function(result) {
     is(result[0], "OK", "emulator callback");
     rcvdEmulatorCallback = true;
   });
 }
 
 // Callback for incoming sms
-manager.onreceived = function onreceived(event) {
+sms.onreceived = function onreceived(event) {
   log("Received 'onreceived' sms event.");
   let incomingSms = event.message;
   log("Received SMS (id: " + incomingSms.id + ").");
 
   // Add newly received message to array of received msgs
   smsList.push(incomingSms);
 
   // Wait for emulator to catch up before continuing
@@ -122,52 +122,52 @@ function nextRep() {
   } else {
     markMsgRead();
   }
 }
 
 function markMsgRead() {
   // Mark first message read so not all will be found by filter
   log("Marking SMS (id: " + smsList[0].id + ") as read.");
-  let request = manager.markMessageRead(smsList[0].id, true);
+  let request = sms.markMessageRead(smsList[0].id, true);
   ok(request instanceof DOMRequest,
       "request is instanceof " + request.constructor);
 
   request.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     if (event.target.result) {
       // First message was marked read, so remove from expected smsList
       smsList.shift();
       // Now test the filter
       getMsgs();
     } else {
       log("SMS markMessageRead failed.");
-      ok(false,"manager.markMessageRead request returned false");
+      ok(false,"sms.markMessageRead request returned false");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "manager.markMessageRead request returned unexpected error: "
+    ok(false, "sms.markMessageRead request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 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 cursor = manager.getMessages(filter, false);
+  let cursor = sms.getMessages(filter, false);
   ok(cursor instanceof DOMCursor,
       "cursor is instanceof " + cursor.constructor);
 
   cursor.onsuccess = function(event) {
     log("Received 'onsuccess' event.");
 
     if (cursor.result) {
       // Another message found
@@ -180,40 +180,40 @@ function getMsgs() {
       // No more messages; ensure correct number found
       if (foundSmsList.length == smsList.length) {
         log("SMS getMessages returned " + foundSmsList.length +
             " messages as expected.");
         verifyFoundMsgs(foundSmsList);
       } else {
         log("SMS getMessages returned " + foundSmsList.length +
             " messages, but expected " + smsList.length + ".");
-        ok(false, "Incorrect number of messages returned by manager.getMessages");
+        ok(false, "Incorrect number of messages returned by sms.getMessages");
         deleteAllMsgs(cleanUp);
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("manager.getMessages error: " + event.target.error.name);
+    log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function verifyFoundMsgs(foundSmsList) {
   for (var x = 0; x < foundSmsList.length; x++) {
     is(foundSmsList[x].id, smsList[x].id, "id");
     is(foundSmsList[x].read, false, "read");
   }
   deleteAllMsgs(cleanUp);
 }
 
 function cleanUp() {
-  manager.onreceived = null;
+  sms.onreceived = null;
   SpecialPowers.removePermission("sms", document);
   SpecialPowers.clearUserPref("dom.sms.enabled");
   finish();
 }
 
 // Start the test
 verifyInitialState();
--- a/dom/mobilemessage/tests/marionette/test_getmessage.js
+++ b/dom/mobilemessage/tests/marionette/test_getmessage.js
@@ -5,39 +5,39 @@ 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 manager = window.navigator.mozMobileMessage;
+let sms = window.navigator.mozSms;
 let inText = "Incoming SMS message. Mozilla Firefox OS!";
 let outText = "Outgoing SMS message. Mozilla Firefox OS!";
 let gotSmsOnsent = false;
 let gotReqOnsuccess = false;
 let inSmsId = 0;
 let outSmsId = 0;
 let inThreadId = 0;
 let outThreadId = 0;
 let inSmsTimeStamp;
 let outSmsTimeStamp;
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(manager, "mozMobileMessage");
+  ok(sms, "mozSms");
   simulateIncomingSms();  
 }
 
 function simulateIncomingSms() {
   log("Simulating incoming SMS.");
 
-  manager.onreceived = function onreceived(event) {
-    log("Received 'onreceived' event.");
+  sms.onreceived = function onreceived(event) {
+    log("Received 'onreceived' smsmanager event.");
     let incomingSms = event.message;
     ok(incomingSms, "incoming sms");
     ok(incomingSms.id, "sms id");
     inSmsId = incomingSms.id;
     log("Received SMS (id: " + inSmsId + ").");
     ok(incomingSms.threadId, "thread id");
     inThreadId = incomingSms.threadId;
     is(incomingSms.body, inText, "msg body");
@@ -54,18 +54,18 @@ function simulateIncomingSms() {
   // Simulate incoming sms sent from remoteNumber to our emulator
   runEmulatorCmd("sms send " + REMOTE + " " + inText, function(result) {
     is(result[0], "OK", "emulator output");
   });
 }
 
 function sendSms() {
   log("Sending an SMS.");
-  manager.onsent = function(event) {
-    log("Received 'onsent' event.");
+  sms.onsent = function(event) {
+    log("Received 'onsent' smsmanager event.");
     gotSmsOnsent = true;
     let sentSms = event.message;
     ok(sentSms, "outgoing sms");
     ok(sentSms.id, "sms id");
     outSmsId = sentSms.id;
     log("Sent SMS (id: " + outSmsId + ").");
     ok(sentSms.threadId, "thread id");
     outThreadId = sentSms.threadId;
@@ -77,44 +77,44 @@ function sendSms() {
     is(sentSms.sender, EMULATOR, "sender");
     is(sentSms.messageClass, "normal", "messageClass");
     ok(sentSms.timestamp instanceof Date, "timestamp is instanceof date");  
     outSmsTimeStamp = sentSms.timestamp;
 
     if (gotSmsOnsent && gotReqOnsuccess) { getReceivedSms(); }
   };
 
-  let requestRet = manager.send(REMOTE, outText);
+  let requestRet = sms.send(REMOTE, outText);
   ok(requestRet, "smsrequest obj returned");
 
   requestRet.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     gotReqOnsuccess = true;
     if(event.target.result){
       if (gotSmsOnsent && gotReqOnsuccess) { getReceivedSms(); }
     } else {
-      log("smsrequest returned false for manager.send");
+      log("smsrequest returned false for sms.send");
       ok(false,"SMS send failed");
       cleanUp();
     }
   };
 
   requestRet.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "manager.send request returned unexpected error: "
+    ok(false, "sms.send request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 function getReceivedSms() {
   log("Getting the received SMS message (id: " + inSmsId + ").");
 
-  let requestRet = manager.getMessage(inSmsId);
+  let requestRet = sms.getMessage(inSmsId);
   ok(requestRet, "smsrequest obj returned");
 
   requestRet.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     ok(event.target.result, "smsrequest event.target.result");
     let foundSms = event.target.result;
     is(foundSms.id, inSmsId, "SMS id matches");
     log("Got SMS (id: " + foundSms.id + ").");
@@ -138,17 +138,17 @@ function getReceivedSms() {
     log("Could not get SMS (id: " + inSmsId + ") but should have.");
     ok(false,"Could not get received SMS");
     cleanUp();
   };
 }
 
 function getSentSms() {
   log("Getting the sent SMS message (id: " + outSmsId + ").");
-  let requestRet = manager.getMessage(outSmsId);
+  let requestRet = sms.getMessage(outSmsId);
   ok(requestRet, "smsrequest obj returned");
 
   requestRet.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     ok(event.target.result, "smsrequest event.target.result");
     let foundSms = event.target.result;
     is(foundSms.id, outSmsId, "SMS id matches");
     log("Got SMS (id: " + foundSms.id + ").");
@@ -172,52 +172,52 @@ function getSentSms() {
     log("Could not get SMS (id: " + outSmsId + ") but should have.");
     ok(false,"Could not get sent SMS");
     cleanUp();
   };
 }
 
 function deleteMsgs() {
   log("Deleting SMS (id: " + inSmsId + ").");
-  let requestRet = manager.delete(inSmsId);
+  let requestRet = sms.delete(inSmsId);
   ok(requestRet,"smsrequest obj returned");
 
   requestRet.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     if(event.target.result){
       log("Deleting SMS (id: " + outSmsId + ").");
-      let nextReqRet = manager.delete(outSmsId);
+      let nextReqRet = sms.delete(outSmsId);
       ok(nextReqRet,"smsrequest obj returned");
 
       nextReqRet.onsuccess = function(event) {
         log("Received 'onsuccess' smsrequest event.");
         if(event.target.result) {
           cleanUp();
         } else {
-          log("smsrequest returned false for manager.delete");
+          log("smsrequest returned false for sms.delete");
           ok(false,"SMS delete failed");
         }
       };
     } else {
-      log("smsrequest returned false for manager.delete");
+      log("smsrequest returned false for sms.delete");
       ok(false,"SMS delete failed");
     }
   };
 
   requestRet.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "manager.delete request returned unexpected error: "
+    ok(false, "sms.delete request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 function cleanUp() {
-  manager.onreceived = null;
+  sms.onreceived = null;
   SpecialPowers.removePermission("sms", document);
   SpecialPowers.clearUserPref("dom.sms.enabled");
   SpecialPowers.clearUserPref("dom.sms.requestStatusReport");
 
   finish();
 }
 
 // Start the test
--- a/dom/mobilemessage/tests/marionette/test_getmessage_notfound.js
+++ b/dom/mobilemessage/tests/marionette/test_getmessage_notfound.js
@@ -1,33 +1,33 @@
 /* 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.addPermission("sms", true, document);
 
-let manager = window.navigator.mozMobileMessage;
+let sms = window.navigator.mozSms;
 let myNumber = "15555215554";
 let inText = "Incoming SMS message. Mozilla Firefox OS!";
 let remoteNumber = "5559997777";
 let inSmsId = 0;
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(manager, "mozMobileMessage");
+  ok(sms, "mozSms");
   simulateIncomingSms();  
 }
 
 function simulateIncomingSms() {
   log("Simulating incoming SMS.");
 
-  manager.onreceived = function onreceived(event) {
-    log("Received 'onreceived' event.");
+  sms.onreceived = function onreceived(event) {
+    log("Received 'onreceived' smsmanager event.");
     let incomingSms = event.message;
     ok(incomingSms, "incoming sms");
     ok(incomingSms.id, "sms id");
     inSmsId = incomingSms.id;
     log("Received SMS (id: " + inSmsId + ").");
     is(incomingSms.body, inText, "msg body");
     is(incomingSms.delivery, "received", "delivery");
     getNonExistentMsg();
@@ -36,17 +36,17 @@ function simulateIncomingSms() {
   runEmulatorCmd("sms send " + remoteNumber + " " + inText, function(result) {
     is(result[0], "OK", "emulator output");
   });
 }
 
 function getNonExistentMsg() {
   let msgIdNoExist = inSmsId + 1;
   log("Attempting to get non-existent message (id: " + msgIdNoExist + ").");
-  let requestRet = manager.getMessage(msgIdNoExist);
+  let requestRet = sms.getMessage(msgIdNoExist);
   ok(requestRet, "smsrequest obj returned");
 
   requestRet.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     ok(event.target.result, "smsrequest event.target.result");
     let foundSms = event.target.result;
     log("Got SMS (id: " + foundSms.id + ") but should not have.");
     ok(false, "Smsrequest successful when tried to get non-existent sms");
@@ -60,17 +60,17 @@ function getNonExistentMsg() {
     log("Could not get SMS (id: " + msgIdNoExist + ") as expected.");
     getMsgInvalidId();
   };
 }  
 
 function getMsgInvalidId() {
   invalidId = -1;
   log("Attempting to get sms with invalid id (id: " + invalidId + ").");
-  let requestRet = manager.getMessage(invalidId);
+  let requestRet = sms.getMessage(invalidId);
   ok(requestRet, "smsrequest obj returned");
 
   requestRet.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     ok(event.target.result, "smsrequest event.target.result");
     let foundSms = event.target.result;
     log("Got SMS (id: " + foundSms.id + ") but should not have.");
     ok(false, "Smsrequest successful when tried to get message with " +
@@ -84,36 +84,36 @@ function getMsgInvalidId() {
     is(event.target.error.name, "NotFoundError", "error returned");
     log("Could not get SMS (id: -1) as expected.");
     deleteMsg();
   };
 }
 
 function deleteMsg() {
   log("Deleting SMS (id: " + inSmsId + ").");
-  let requestRet = manager.delete(inSmsId);
+  let requestRet = sms.delete(inSmsId);
   ok(requestRet,"smsrequest obj returned");
 
   requestRet.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     if(event.target.result){
       cleanUp();
     }
   };
 
   requestRet.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "manager.delete request returned unexpected error: "
+    ok(false, "sms.delete request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 function cleanUp() {
-  manager.onreceived = null;
+  sms.onreceived = null;
   SpecialPowers.removePermission("sms", document);
   SpecialPowers.setBoolPref("dom.sms.enabled", false);
   finish();
 }
 
 // Start the test
 verifyInitialState();
--- a/dom/mobilemessage/tests/marionette/test_getmessages.js
+++ b/dom/mobilemessage/tests/marionette/test_getmessages.js
@@ -1,36 +1,36 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 MARIONETTE_TIMEOUT = 60000;
 
 SpecialPowers.addPermission("sms", true, document);
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
 
-let manager = window.navigator.mozMobileMessage;
+let sms = window.navigator.mozSms;
 let numberMsgs = 10;
 let smsList = new Array();
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(manager, "mozMobileMessage");
+  ok(sms, "mozSms");
   // Ensure test is starting clean with no existing sms messages
   deleteAllMsgs(simulateIncomingSms);
 }
 
 function isIn(aVal, aArray, aMsg) {
   ok(aArray.indexOf(aVal) >= 0, aMsg);
 }
 
 function deleteAllMsgs(nextFunction) {
   let msgList = new Array();
   let smsFilter = new MozSmsFilter;
 
-  let cursor = manager.getMessages(smsFilter, false);
+  let cursor = sms.getMessages(smsFilter, false);
   ok(cursor instanceof DOMCursor,
       "cursor is instanceof " + cursor.constructor);
 
   cursor.onsuccess = function(event) {
     // Check if message was found
     if (cursor.result) {
       msgList.push(cursor.result.id);
       // Now get next message in the list
@@ -45,51 +45,51 @@ function deleteAllMsgs(nextFunction) {
         nextFunction();
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("manager.getMessages error: " + event.target.error.name);
+    log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function deleteMsgs(msgList, nextFunction) {
   let smsId = msgList.shift();
 
   log("Deleting SMS (id: " + smsId + ").");
-  let request = manager.delete(smsId);
+  let request = sms.delete(smsId);
   ok(request instanceof DOMRequest,
       "request is instanceof " + request.constructor);
 
   request.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     if (event.target.result) {
       // Message deleted, continue until none are left
       if (msgList.length) {
         deleteMsgs(msgList, nextFunction);
       } else {
         log("Finished deleting SMS messages.");
         nextFunction();
       }
     } else {
       log("SMS delete failed.");
-      ok(false,"manager.delete request returned false");
+      ok(false,"sms.delete request returned false");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "manager.delete request returned unexpected error: "
+    ok(false, "sms.delete request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 function simulateIncomingSms() {
   let text = "Incoming SMS number " + (smsList.length + 1);
   let remoteNumber = "5552229797";
@@ -101,17 +101,17 @@ function simulateIncomingSms() {
   rcvdEmulatorCallback = false;
   runEmulatorCmd("sms send " + remoteNumber + " " + text, function(result) {
     is(result[0], "OK", "emulator callback");
     rcvdEmulatorCallback = true;
   });
 }
 
 // Callback for incoming sms
-manager.onreceived = function onreceived(event) {
+sms.onreceived = function onreceived(event) {
   log("Received 'onreceived' sms event.");
   let incomingSms = event.message;
   log("Received SMS (id: " + incomingSms.id + ").");
 
   // Add newly received message to array of received msgs
   smsList.push(incomingSms);
 
   // Wait for emulator to catch up before continuing
@@ -137,17 +137,17 @@ 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 cursor = manager.getMessages(smsFilter, reverse);
+  let cursor = sms.getMessages(smsFilter, reverse);
   ok(cursor instanceof DOMCursor,
       "cursor is instanceof " + cursor.constructor);
 
   cursor.onsuccess = function(event) {
     log("Received 'onsuccess' event.");
 
     if (cursor.result) {
       // Another message found
@@ -160,26 +160,26 @@ function getMsgs(reverse) {
     } 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 manager.getMessages");
+        ok(false, "Incorrect number of messages returned by sms.getMessages");
       }
       verifyFoundMsgs(foundSmsList, reverse);
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("manager.getMessages error: " + event.target.error.name);
+    log("sms.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function verifyFoundMsgs(foundSmsList, reverse) {
   if (reverse) {
     smsList.reverse();
@@ -211,16 +211,16 @@ function verifyFoundMsgs(foundSmsList, r
     getMsgs(true);
   } else {
     // Finished, delete all messages
     deleteAllMsgs(cleanUp);
   };
 }
 
 function cleanUp() {
-  manager.onreceived = null;
+  sms.onreceived = null;
   SpecialPowers.removePermission("sms", document);
   SpecialPowers.clearUserPref("dom.sms.enabled");
   finish();
 }
 
 // Start the test
 verifyInitialState();
--- a/dom/mobilemessage/tests/marionette/test_getsegmentinfofortext.js
+++ b/dom/mobilemessage/tests/marionette/test_getsegmentinfofortext.js
@@ -4,18 +4,18 @@
 MARIONETTE_TIMEOUT = 60000;
 
 // Copied from dom/system/gonk/ril_consts.js.
 const PDU_MAX_USER_DATA_7BIT = 160;
 
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
 SpecialPowers.addPermission("sms", true, document);
 
-let manager = window.navigator.mozMobileMessage;
-ok(manager instanceof MozMobileMessageManager, "mozMobileMessage");
+let sms = window.navigator.mozSms;
+ok(sms instanceof MozSmsManager, "mozSmsManager");
 
 let tasks = {
   // List of test fuctions. Each of them should call |tasks.next()| when
   // completed or |tasks.finish()| to jump to the last one.
   _tasks: [],
   _nextTaskIndex: 0,
 
   push: function push(func) {
@@ -43,31 +43,31 @@ let tasks = {
   run: function run() {
     this.next();
   }
 };
 
 function addTest(text, segments, charsPerSegment, charsAvailableInLastSegment) {
   tasks.push(function () {
     log("Testing '" + text + "' ...");
-    let info = manager.getSegmentInfoForText(text);
+    let info = sms.getSegmentInfoForText(text);
     is(info.segments, segments, "info.segments");
     is(info.charsPerSegment, charsPerSegment, "info.charsPerSegment");
     is(info.charsAvailableInLastSegment, charsAvailableInLastSegment,
        "info.charsAvailableInLastSegment");
 
     tasks.next();
   });
 }
 
 function addTestThrows(text) {
   tasks.push(function () {
     log("Testing '" + text + "' ...");
     try {
-      let info = manager.getSegmentInfoForText(text);
+      let info = sms.getSegmentInfoForText(text);
 
       ok(false, "Not thrown");
       tasks.finish();
     } catch (e) {
       tasks.next();
     }
   });
 }
--- a/dom/mobilemessage/tests/marionette/test_getthreads.js
+++ b/dom/mobilemessage/tests/marionette/test_getthreads.js
@@ -1,18 +1,18 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 MARIONETTE_TIMEOUT = 40000;
 
 SpecialPowers.addPermission("sms", true, document);
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
 
-let manager = window.navigator.mozMobileMessage;
-ok(manager instanceof MozMobileMessage);
+let sms = window.navigator.mozSms;
+ok(sms instanceof MozSmsManager);
 
 let pendingEmulatorCmdCount = 0;
 function sendSmsToEmulator(from, text, callback) {
   ++pendingEmulatorCmdCount;
 
   let cmd = "sms send " + from + " " + text;
   runEmulatorCmd(cmd, function (result) {
     --pendingEmulatorCmdCount;
@@ -54,17 +54,17 @@ let tasks = {
   }
 };
 
 function getAllMessages(callback, filter, reverse) {
   if (!filter) {
     filter = new MozSmsFilter;
   }
   let messages = [];
-  let request = manager.getMessages(filter, reverse || false);
+  let request = sms.getMessages(filter, reverse || false);
   request.onsuccess = function(event) {
     if (!request.done) {
       messages.push(request.result);
       request.continue();
       return;
     }
 
     window.setTimeout(callback.bind(null, messages), 0);
@@ -75,50 +75,50 @@ function deleteAllMessages() {
   getAllMessages(function deleteAll(messages) {
     let message = messages.shift();
     if (!message) {
       ok(true, "all messages deleted");
       tasks.next();
       return;
     }
 
-    let request = manager.delete(message.id);
+    let request = sms.delete(message.id);
     request.onsuccess = deleteAll.bind(null, messages);
     request.onerror = function (event) {
       ok(false, "failed to delete all messages");
       tasks.finish();
     }
   });
 }
 
 function sendMessage(to, body) {
-  manager.onsent = function () {
-    manager.onsent = null;
+  sms.onsent = function () {
+    sms.onsent = null;
     tasks.next();
   };
-  let request = manager.send(to, body);
+  let request = sms.send(to, body);
   request.onerror = tasks.finish.bind(tasks);
 }
 
 function receiveMessage(from, body) {
-  manager.onreceived = function () {
-    manager.onreceived = null;
+  sms.onreceived = function () {
+    sms.onreceived = null;
     tasks.next();
   };
   sendSmsToEmulator(from, body, function (success) {
     if (!success) {
       tasks.finish();
     }
   });
 }
 
 function getAllThreads(callback) {
   let threads = [];
 
-  let cursor = manager.getThreads();
+  let cursor = sms.getThreads();
   ok(cursor instanceof DOMCursor,
      "cursor is instanceof " + cursor.constructor);
 
   cursor.onsuccess = function (event) {
     if (!cursor.done) {
       threads.push(cursor.result);
       cursor.continue();
       return;
--- a/dom/mobilemessage/tests/marionette/test_incoming.js
+++ b/dom/mobilemessage/tests/marionette/test_incoming.js
@@ -4,27 +4,27 @@
 MARIONETTE_TIMEOUT = 60000;
 
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
 SpecialPowers.addPermission("sms", true, document);
 
 const SENDER = "5555552368"; // the remote number
 const RECEIVER = "15555215554"; // the emulator's number
 
-let manager = window.navigator.mozMobileMessage;
+let sms = window.navigator.mozSms;
 let body = "Hello SMS world!";
 
 let completed = false;
 runEmulatorCmd("sms send " + SENDER + " " + body, function(result) {
   log("Sent fake SMS: " + result);
   is(result[0], "OK", "Emulator command result");
   completed = true;
 });
 
-manager.onreceived = function onreceived(event) {
+sms.onreceived = function onreceived(event) {
   log("Received an SMS!");
 
   let message = event.message;
   ok(message instanceof MozSmsMessage, "Message is instanceof MozSmsMessage");
 
   ok(message.threadId, "thread id");
   is(message.delivery, "received", "Message delivery");
   is(message.deliveryStatus, "success", "Delivery status");
--- a/dom/mobilemessage/tests/marionette/test_incoming_delete.js
+++ b/dom/mobilemessage/tests/marionette/test_incoming_delete.js
@@ -4,30 +4,30 @@
 MARIONETTE_TIMEOUT = 60000;
 
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
 SpecialPowers.addPermission("sms", true, document);
 
 const SENDER = "5555552368"; // the remote number
 const RECEIVER = "15555215554"; // the emulator's number
 
-let manager = window.navigator.mozMobileMessage;
+let sms = window.navigator.mozSms;
 let msgText = "Mozilla Firefox OS!";
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(manager, "mozMobileMessage");
+  ok(sms, "mozSms");
   simulateIncomingSms();  
 }
 
 function simulateIncomingSms() {
   log("Simulating incoming SMS.");
 
-  manager.onreceived = function onreceived(event) {
-    log("Received 'onreceived' event.");
+  sms.onreceived = function onreceived(event) {
+    log("Received 'onreceived' smsmanager event.");
     let incomingSms = event.message;
     ok(incomingSms, "incoming sms");
     ok(incomingSms.id, "sms id");
     log("Received SMS (id: " + incomingSms.id + ").");
     ok(incomingSms.threadId, "thread id");
     is(incomingSms.body, msgText, "msg body");
     is(incomingSms.delivery, "received", "delivery");
     is(incomingSms.deliveryStatus, "success", "deliveryStatus");
@@ -41,17 +41,17 @@ function simulateIncomingSms() {
   };
   runEmulatorCmd("sms send " + SENDER + " " + msgText, function(result) {
     is(result[0], "OK", "emulator output");
   });
 }
 
 function verifySmsExists(incomingSms) {
   log("Getting SMS (id: " + incomingSms.id + ").");
-  let requestRet = manager.getMessage(incomingSms.id);
+  let requestRet = sms.getMessage(incomingSms.id);
   ok(requestRet, "smsrequest obj returned");
 
   requestRet.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     ok(event.target.result, "smsrequest event.target.result");
     let foundSms = event.target.result;
     is(foundSms.id, incomingSms.id, "found SMS id matches");
     is(foundSms.threadId, incomingSms.threadId, "found SMS thread id matches");
@@ -73,42 +73,42 @@ function verifySmsExists(incomingSms) {
     log("Could not get SMS (id: " + incomingSms.id + ") but should have.");
     ok(false,"SMS was not found");
     cleanUp();
   };
 }
 
 function deleteSms(smsMsgObj){
   log("Deleting SMS (id: " + smsMsgObj.id + ") using smsmsg obj parameter.");
-  let requestRet = manager.delete(smsMsgObj);
+  let requestRet = sms.delete(smsMsgObj);
   ok(requestRet,"smsrequest obj returned");
 
   requestRet.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     if(event.target.result){
       verifySmsDeleted(smsMsgObj.id);
     } else {
-      log("smsrequest returned false for manager.delete");
+      log("smsrequest returned false for sms.delete");
       ok(false,"SMS delete failed");
       cleanUp();
     }
   };
 
   requestRet.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "manager.delete request returned unexpected error: "
+    ok(false, "sms.delete request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 function verifySmsDeleted(smsId) {
   log("Getting SMS (id: " + smsId + ").");
-  let requestRet = manager.getMessage(smsId);
+  let requestRet = sms.getMessage(smsId);
   ok(requestRet, "smsrequest obj returned");
 
   requestRet.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     ok(event.target.result, "smsrequest event.target.result");
     let foundSms = event.target.result;
     is(foundSms.id, smsId, "found SMS id matches");
     is(foundSms.body, msgText, "found SMS msg text matches");
@@ -122,16 +122,16 @@ function verifySmsDeleted(smsId) {
     ok(event.target.error, "domerror obj");
     is(event.target.error.name, "NotFoundError", "error returned");
     log("Could not get SMS (id: " + smsId + ") as expected.");
     cleanUp();
   };
 }
 
 function cleanUp() {
-  manager.onreceived = null;
+  sms.onreceived = null;
   SpecialPowers.removePermission("sms", document);
   SpecialPowers.setBoolPref("dom.sms.enabled", false);
   finish();
 }
 
 // Start the test
 verifyInitialState();
--- a/dom/mobilemessage/tests/marionette/test_incoming_max_segments.js
+++ b/dom/mobilemessage/tests/marionette/test_incoming_max_segments.js
@@ -1,41 +1,41 @@
 /* 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.addPermission("sms", true, document);
 
-let manager = window.navigator.mozMobileMessage;
+let sms = window.navigator.mozSms;
 // https://developer.mozilla.org/en-US/docs/DOM/SmsManager
 let maxCharsPerSms = 160;
 let maxSegments = 10; // 10 message segments concatenated into 1 multipart SMS
 
 const REMOTE = "5551234567"; // the remote number
 const EMULATOR = "15555215554"; // the emulator's number
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(manager, "mozMobileMessage");
+  ok(sms, "mozSms");
   simulateIncomingSms();
 }
 
 function simulateIncomingSms() {
   let msgText = "";
 
   // Build the message text
   msgText = new Array((maxCharsPerSms * maxSegments) + 1).join('a');
   log("Simulating incoming multipart SMS (" + msgText.length +
       " chars total).");
 
-  manager.onreceived = function onreceived(event) {
-    manager.onreceived = null;
-    log("Received 'onreceived' event.");
+  sms.onreceived = function onreceived(event) {
+    sms.onreceived = null;
+    log("Received 'onreceived' smsmanager event.");
 
     let incomingSms = event.message;
     ok(incomingSms, "incoming sms");
     ok(incomingSms.id, "sms id");
     log("Received SMS (id: " + incomingSms.id + ").");
     ok(incomingSms.threadId, "thread id");
     is(incomingSms.body.length, msgText.length, "msg body length");
     is(incomingSms.body, msgText, "msg body");
@@ -49,17 +49,17 @@ function simulateIncomingSms() {
   };
   runEmulatorCmd("sms send " + REMOTE + " " + msgText, function(result) {
     is(result[0], "OK", "emulator output");
   });
 }
 
 function verifySmsExists(incomingSms) {
   log("Getting SMS (id: " + incomingSms.id + ").");
-  let requestRet = manager.getMessage(incomingSms.id);
+  let requestRet = sms.getMessage(incomingSms.id);
   ok(requestRet, "smsrequest obj returned");
 
   requestRet.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     ok(event.target.result, "smsrequest event.target.result");
     let foundSms = event.target.result;
     is(foundSms.id, incomingSms.id, "found SMS id matches");
     is(foundSms.body.length, incomingSms.body.length, "SMS text length");
@@ -75,34 +75,34 @@ function verifySmsExists(incomingSms) {
     log("Could not get SMS (id: " + incomingSms.id + ") but should have.");
     ok(false, "SMS was not found");
     cleanUp();
   };
 }
 
 function deleteSms(smsMsgObj){
   log("Deleting SMS (id: " + smsMsgObj.id + ") using smsmsg obj parameter.");
-  let requestRet = manager.delete(smsMsgObj);
+  let requestRet = sms.delete(smsMsgObj);
   ok(requestRet, "smsrequest obj returned");
 
   requestRet.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     if (event.target.result) {
       cleanUp();
     } else {
-      log("smsrequest returned false for manager.delete");
+      log("smsrequest returned false for sms.delete");
       ok(false, "SMS delete failed");
       cleanUp();
     }
   };
 
   requestRet.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "manager.delete request returned unexpected error: " +
+    ok(false, "sms.delete request returned unexpected error: " +
               event.target.error.name);
     cleanUp();
   };
 }
 
 function cleanUp() {
   SpecialPowers.removePermission("sms", document);
   SpecialPowers.clearUserPref("dom.sms.enabled");
--- a/dom/mobilemessage/tests/marionette/test_incoming_multipart.js
+++ b/dom/mobilemessage/tests/marionette/test_incoming_multipart.js
@@ -4,36 +4,36 @@
 MARIONETTE_TIMEOUT = 60000;
 
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
 SpecialPowers.addPermission("sms", true, document);
 
 const SENDER = "5555552368"; // the remote number
 const RECEIVER = "15555215554"; // the emulator's number
 
-let manager = window.navigator.mozMobileMessage;
+let sms = window.navigator.mozSms;
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(manager, "mozMobileMessage");
+  ok(sms, "mozSms");
   simulateIncomingSms();  
 }
 
 function simulateIncomingSms() {
   let msgText = "";
 
   log("Simulating incoming SMS.");
 
   // Have message text > max SMS size (160 char) so will be a multi-part SMS
   for (var x = 1; x <= 24; x++) {
     msgText += 'FirefoxOS ';
   }
 
-  manager.onreceived = function onreceived(event) {
-    log("Received 'onreceived' event.");
+  sms.onreceived = function onreceived(event) {
+    log("Received 'onreceived' smsmanager event.");
     let incomingSms = event.message;
     ok(incomingSms, "incoming sms");
     ok(incomingSms.id, "sms id");
     log("Received SMS (id: " + incomingSms.id + ").");
     ok(incomingSms.threadId, "thread id");
     is(incomingSms.body, msgText, "msg body");
     is(incomingSms.delivery, "received", "delivery");
     is(incomingSms.read, false, "read");
@@ -45,17 +45,17 @@ function simulateIncomingSms() {
   };
   runEmulatorCmd("sms send " + SENDER + " " + msgText, function(result) {
     is(result[0], "OK", "emulator output");
   });
 }
 
 function verifySmsExists(incomingSms) {
   log("Getting SMS (id: " + incomingSms.id + ").");
-  let requestRet = manager.getMessage(incomingSms.id);
+  let requestRet = sms.getMessage(incomingSms.id);
   ok(requestRet, "smsrequest obj returned");
 
   requestRet.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     ok(event.target.result, "smsrequest event.target.result");
     let foundSms = event.target.result;
     is(foundSms.id, incomingSms.id, "found SMS id matches");
     is(foundSms.threadId, incomingSms.threadId, "found SMS thread id matches");
@@ -75,40 +75,40 @@ function verifySmsExists(incomingSms) {
     log("Could not get SMS (id: " + incomingSms.id + ") but should have.");
     ok(false,"SMS was not found");
     cleanUp();
   };
 }
 
 function deleteSms(smsMsgObj){
   log("Deleting SMS (id: " + smsMsgObj.id + ") using smsmsg obj parameter.");
-  let requestRet = manager.delete(smsMsgObj);
+  let requestRet = sms.delete(smsMsgObj);
   ok(requestRet,"smsrequest obj returned");
 
   requestRet.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     if(event.target.result){
       cleanUp();
     } else {
-      log("smsrequest returned false for manager.delete");
+      log("smsrequest returned false for sms.delete");
       ok(false,"SMS delete failed");
       cleanUp();
     }
   };
 
   requestRet.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "manager.delete request returned unexpected error: "
+    ok(false, "sms.delete request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 function cleanUp() {
-  manager.onreceived = null;
+  sms.onreceived = null;
   SpecialPowers.removePermission("sms", document);
   SpecialPowers.clearUserPref("dom.sms.enabled");
   finish();
 }
 
 // Start the test
 verifyInitialState();
--- a/dom/mobilemessage/tests/marionette/test_mark_msg_read.js
+++ b/dom/mobilemessage/tests/marionette/test_mark_msg_read.js
@@ -1,22 +1,22 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 MARIONETTE_TIMEOUT = 60000;
 
 SpecialPowers.addPermission("sms", true, document);
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
 
-let manager = window.navigator.mozMobileMessage;
+let sms = window.navigator.mozSms;
 let smsList = new Array();
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(manager, "mozMobileMessage");
+  ok(sms, "mozSms");
   simulateIncomingSms();
 }
 
 function simulateIncomingSms() {
   let text = "Incoming SMS courtesy of Firefox OS";
   let remoteNumber = "5557779999";
 
   log("Simulating incoming SMS.");
@@ -25,17 +25,17 @@ function simulateIncomingSms() {
   rcvdEmulatorCallback = false;
   runEmulatorCmd("sms send " + remoteNumber + " " + text, function(result) {
     is(result[0], "OK", "emulator callback");
     rcvdEmulatorCallback = true;
   });
 }
 
 // Callback for incoming SMS
-manager.onreceived = function onreceived(event) {
+sms.onreceived = function onreceived(event) {
   log("Received 'onreceived' sms event.");
   let incomingSms = event.message;
   log("Received SMS (id: " + incomingSms.id + ").");
   is(incomingSms.read, false, "incoming message read");
   log("SMS read attribute: " + incomingSms.read + ".");
 
   // Add newly received message id to array of msgs
   smsList.push(incomingSms.id);
@@ -49,71 +49,71 @@ manager.onreceived = function onreceived
 function sendSms() {
   let gotSmsSent = false;
   let gotRequestSuccess = false;
   let remoteNumber = "5557779999";
   let text = "Mo Mo Mo Zilla Zilla Zilla!";
 
   log("Sending an SMS.");
 
-  manager.onsent = function(event) {
-    log("Received 'onsent' event.");
+  sms.onsent = function(event) {
+    log("Received 'onsent' smsmanager event.");
     gotSmsSent = true;
     let sentSms = event.message;
     log("Sent SMS (id: " + sentSms.id + ").");
     is(sentSms.read, true, "sent sms read");
     log("SMS read attribute: " + sentSms.read + ".");
 
     // Add newly received message id to array of msgs
     smsList.push(sentSms.id);
 
     if (gotSmsSent && gotRequestSuccess) {
       test1();
     }
   };
 
-  let request = manager.send(remoteNumber, text);
+  let request = sms.send(remoteNumber, text);
 
   request.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     if(event.target.result) {
       gotRequestSuccess = true;
       if (gotSmsSent && gotRequestSuccess) {
         test1();
       }
     } else {
-      log("smsrequest returned false for manager.send");
+      log("smsrequest returned false for sms.send");
       ok(false, "SMS send failed");
       deleteMsgs();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "manager.send request returned unexpected error: "
+    ok(false, "sms.send request returned unexpected error: "
         + event.target.error.name );
     deleteMsgs();
   };
 }
 
 function markMessageAndVerify(smsId, readBool, nextFunction) {
-  let request = manager.markMessageRead(smsId, readBool);
+  let request = sms.markMessageRead(smsId, readBool);
   ok(request instanceof DOMRequest,
       "request is instanceof " + request.constructor);
 
   request.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
 
     // Success from MarkMessageRead, the result should match what we set
     is(event.target.result, readBool, "result matches what was set");
 
     // Message marked read/unread, now verify
     log("Getting SMS message (id: " + smsId + ").");
-    let requestRet = manager.getMessage(smsId);
+    let requestRet = sms.getMessage(smsId);
     ok(requestRet, "smsrequest obj returned");
 
     requestRet.onsuccess = function(event) {
       log("Received 'onsuccess' smsrequest event.");
       ok(event.target.result, "smsrequest event.target.result");
       let foundSms = event.target.result;
       is(foundSms.id, smsId, "SMS id matches");
       log("SMS read attribute: " + foundSms.read + ".");
@@ -136,17 +136,17 @@ function markMessageAndVerify(smsId, rea
       ok(false, "Could not get SMS");
       deleteMsgs();
     };
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "manager.markMessageRead request returned unexpected error: "
+    ok(false, "sms.markMessageRead request returned unexpected error: "
         + event.target.error.name );
     nextFunction();
   };
 }
 
 function test1() {
   rcvdSms = smsList[0];
   log("Test 1: Marking received SMS (id: " + rcvdSms + ") read.");
@@ -182,46 +182,46 @@ function test6() {
   log("Test 6: Marking an already unread SMS (id: " + rcvdSms + ") unread.");
   markMessageAndVerify(rcvdSms, false, deleteMsgs);
 }
 
 function deleteMsgs() {
   let smsId = smsList.shift();
 
   log("Deleting SMS (id: " + smsId + ").");
-  let request = manager.delete(smsId);
+  let request = sms.delete(smsId);
   ok(request instanceof DOMRequest,
       "request is instanceof " + request.constructor);
 
   request.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     if (event.target.result) {
       // Message deleted, continue until none are left
       if (smsList.length) {
         deleteMsgs();
       } else {
         cleanUp();
       }
     } else {
       log("SMS delete failed.");
-      ok(false, "manager.delete request returned false");
+      ok(false, "sms.delete request returned false");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "manager.delete request returned unexpected error: "
+    ok(false, "sms.delete request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 function cleanUp() {
-  manager.onreceived = null;
+  sms.onreceived = null;
   SpecialPowers.removePermission("sms", document);
   SpecialPowers.clearUserPref("dom.sms.enabled");
   finish();
 }
 
 // Start the test
 verifyInitialState();
--- a/dom/mobilemessage/tests/marionette/test_mark_msg_read_error.js
+++ b/dom/mobilemessage/tests/marionette/test_mark_msg_read_error.js
@@ -1,22 +1,22 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 MARIONETTE_TIMEOUT = 60000;
 
 SpecialPowers.addPermission("sms", true, document);
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
 
-let manager = window.navigator.mozMobileMessage;
+let sms = window.navigator.mozSms;
 let smsId;
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(manager, "mozMobileMessage");
+  ok(sms, "mozSms");
   simulateIncomingSms();
 }
 
 function simulateIncomingSms() {
   let text = "Incoming SMS courtesy of Firefox OS";
   let remoteNumber = "5557779999";
 
   log("Simulating incoming SMS.");
@@ -25,31 +25,31 @@ function simulateIncomingSms() {
   rcvdEmulatorCallback = false;
   runEmulatorCmd("sms send " + remoteNumber + " " + text, function(result) {
     is(result[0], "OK", "emulator callback");
     rcvdEmulatorCallback = true;
   });
 }
 
 // Callback for incoming SMS
-manager.onreceived = function onreceived(event) {
+sms.onreceived = function onreceived(event) {
   log("Received 'onreceived' sms event.");
   let incomingSms = event.message;
   log("Received SMS (id: " + incomingSms.id + ").");
   is(incomingSms.read, false, "incoming message read");
   smsId = incomingSms.id;
 
   // Wait for emulator to catch up before continuing
   waitFor(test1, function() {
     return(rcvdEmulatorCallback);
   });
 };
 
 function markMsgError(invalidId, readBool, nextFunction) {
-  let requestRet = manager.markMessageRead(invalidId, readBool);
+  let requestRet = sms.markMessageRead(invalidId, readBool);
   ok(requestRet, "smsrequest obj returned");
 
   requestRet.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event, but expected error.");
     ok(false, "Smsrequest should have returned error but did not");
     nextFunction();
   };
 
@@ -74,42 +74,42 @@ function test2() {
   invalidId = -1;
   log("Attempting to mark sms unread using an invalid id (id: " + invalidId
       + "), expect error.");
   markMsgError(invalidId, false, deleteMsg);
 }
 
 function deleteMsg() {
   log("Deleting SMS (id: " + smsId + ").");
-  let request = manager.delete(smsId);
+  let request = sms.delete(smsId);
   ok(request instanceof DOMRequest,
       "request is instanceof " + request.constructor);
 
   request.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     if (event.target.result) {
       // Message deleted
       cleanUp();
     } else {
       log("SMS delete failed.");
-      ok(false,"manager.delete request returned false");
+      ok(false,"sms.delete request returned false");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "manager.delete request returned unexpected error: "
+    ok(false, "sms.delete request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 function cleanUp() {
-  manager.onreceived = null;
+  sms.onreceived = null;
   SpecialPowers.removePermission("sms", document);
   SpecialPowers.clearUserPref("dom.sms.enabled");
   finish();
 }
 
 // Start the test
 verifyInitialState();
--- a/dom/mobilemessage/tests/marionette/test_massive_incoming_delete.js
+++ b/dom/mobilemessage/tests/marionette/test_massive_incoming_delete.js
@@ -4,17 +4,17 @@
 MARIONETTE_TIMEOUT = 60000;
 
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
 SpecialPowers.addPermission("sms", true, document);
 
 const SENDER = "5555552368"; // the remote number
 const RECEIVER = "15555215554"; // the emulator's number
 
-let manager = window.navigator.mozMobileMessage;
+let sms = window.navigator.mozMobileMessage;
 let MSG_TEXT = "Mozilla Firefox OS!";
 let SMS_NUMBER = 100;
 
 let SmsList = [];
 let checkDone = true;
 let emulatorReady = true;
 
 let pendingEmulatorCmdCount = 0;
@@ -63,17 +63,17 @@ let tasks = {
 };
 
 function taskNextWrapper() {
   tasks.next();
 }
 
 function verifySmsExists(incomingSms) {
   log("Getting SMS (id: " + incomingSms.id + ").");
-  let requestRet = manager.getMessage(incomingSms.id);
+  let requestRet = sms.getMessage(incomingSms.id);
   ok(requestRet, "smsrequest obj returned");
 
   requestRet.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     ok(event.target.result, "smsrequest event.target.result");
     let foundSms = event.target.result;
     is(foundSms.id, incomingSms.id, "found SMS id matches");
     is(foundSms.threadId, incomingSms.threadId, "found SMS thread id matches");
@@ -97,17 +97,17 @@ function verifySmsExists(incomingSms) {
     ok(false,"SMS was not found");
     tasks.finish();
   };
 }
 
 let verifDeletedCount = 0;
 function verifySmsDeleted(smsId) {
   log("Getting SMS (id: " + smsId + ").");
-  let requestRet = manager.getMessage(smsId);
+  let requestRet = sms.getMessage(smsId);
   ok(requestRet, "smsrequest obj returned");
 
   requestRet.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     ok(event.target.result, "smsrequest event.target.result");
     let foundSms = event.target.result;
     is(foundSms.id, smsId, "found SMS id matches");
     is(foundSms.body, MSG_TEXT, "found SMS msg text matches");
@@ -122,21 +122,21 @@ function verifySmsDeleted(smsId) {
     is(event.target.error.name, "NotFoundError", "error returned");
     log("Could not get SMS (id: " + smsId + ") as expected.");
     verifDeletedCount++;
   };
 }
 
 tasks.push(function init() {
   log("Initialize test object.");
-  ok(manager, "mozMobileMessage");
+  ok(sms, "mozSms");
 
   // Callback for incoming sms
-  manager.onreceived = function onreceived(event) {
-    log("Received 'onreceived' event.");
+  sms.onreceived = function onreceived(event) {
+    log("Received 'onreceived' smsmanager event.");
     let incomingSms = event.message;
     ok(incomingSms, "incoming sms");
     ok(incomingSms.id, "sms id");
     log("Received SMS (id: " + incomingSms.id + ").");
     ok(incomingSms.threadId, "thread id");
     is(incomingSms.body, MSG_TEXT, "msg body");
     is(incomingSms.delivery, "received", "delivery");
     is(incomingSms.deliveryStatus, "success", "deliveryStatus");
@@ -163,54 +163,54 @@ tasks.push(function sendAllSms() {
   });
 });
 
 tasks.push(function deleteAllSms() {
   log("Deleting SMS using smsmsg obj array parameter.");
   let deleteStart = Date.now();
   log("deleteStart: " + deleteStart);
   log("SmsList: " + JSON.stringify(SmsList));
-  let requestRet = manager.delete(SmsList);
+  let requestRet = sms.delete(SmsList);
   ok(requestRet,"smsrequest obj returned");
 
   requestRet.onsuccess = function(event) {
     let deleteDone = Date.now();
     log("Delete " + SMS_NUMBER + " SMS takes " + (deleteDone - deleteStart) + " ms.");
     log("Received 'onsuccess' smsrequest event.");
     if (event.target.result) {
       for (let i = 0; i < SmsList.length; i++) {
         verifySmsDeleted(SmsList[i].id);
       }
     } else {
-      log("smsrequest returned false for manager.delete");
+      log("smsrequest returned false for sms.delete");
       ok(false, "SMS delete failed");
     }
   };
 
   requestRet.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "manager.delete request returned unexpected error: "
+    ok(false, "sms.delete request returned unexpected error: "
         + event.target.error.name);
     tasks.finish();
   };
 
   waitFor(taskNextWrapper, function() {
     return verifDeletedCount === SMS_NUMBER;
   });
 });
 
 // WARNING: All tasks should be pushed before this!!!
 tasks.push(function cleanUp() {
   if (pendingEmulatorCmdCount) {
     window.setTimeout(cleanUp, 100);
     return;
   }
 
-  manager.onreceived = null;
+  sms.onreceived = null;
   SpecialPowers.removePermission("sms", document);
   SpecialPowers.setBoolPref("dom.sms.enabled", false);
   log("Finish!!!");
   finish();
 });
 
 // Start the test
 tasks.run();
--- a/dom/mobilemessage/tests/marionette/test_message_classes.js
+++ b/dom/mobilemessage/tests/marionette/test_message_classes.js
@@ -10,18 +10,18 @@ const PDU_PID_NORMAL = "00";
 const PDU_PID_ANSI_136_R_DATA = "7C";
 const PDU_PID_USIM_DATA_DOWNLOAD = "7F";
 const PDU_TIMESTAMP = "00101000000000"; // 2000/01/01
 const PDU_UDL = "01";
 const PDU_UD = "41";
 
 SpecialPowers.addPermission("sms", true, document);
 
-let manager = window.navigator.mozMobileMessage;
-ok(manager instanceof MozMobileMessageManager);
+let sms = window.navigator.mozSms;
+ok(sms instanceof MozSmsManager);
 
 let pendingEmulatorCmdCount = 0;
 function sendSmsPduToEmulator(pdu) {
   ++pendingEmulatorCmdCount;
 
   let cmd = "sms pdu " + pdu;
   runEmulatorCmd(cmd, function (result) {
     --pendingEmulatorCmdCount;
@@ -56,28 +56,28 @@ function checkMessage(message, id, threa
 function test_message_class_0() {
   let allDCSs = [
     "10", // General Group: 00xx
     "50", // Automatica Deletion Group: 01xx
     "F0"  // (no name) Group: 1111
   ];
 
   function do_test(dcsIndex) {
-    manager.addEventListener("received", function onReceived(event) {
-      manager.removeEventListener("received", onReceived);
+    sms.addEventListener("received", function onReceived(event) {
+      sms.removeEventListener("received", onReceived);
 
       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 cursor = manager.getMessages(null, false);
+      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.result.sender, message.sender, "cursor.result.sender");
 
           cursor.continue();
           return;
         }
@@ -104,18 +104,18 @@ function test_message_class_0() {
   }
 
   log("Checking Message Class 0");
   do_test(0);
 }
 
 function doTestMessageClassGeneric(allDCSs, messageClass, next) {
   function do_test(dcsIndex) {
-    manager.addEventListener("received", function onReceived(event) {
-      manager.removeEventListener("received", onReceived);
+    sms.addEventListener("received", function onReceived(event) {
+      sms.removeEventListener("received", onReceived);
 
       // Make sure we can correctly receive the message
       checkMessage(event.message, null, null, messageClass);
       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");
 
@@ -182,32 +182,32 @@ function test_message_class_2() {
         // Since we have "data download via SMS Point-to-Point" service enabled
         // but no working implementation in emulator SIM, all class 2 messages
         // bug normal ones should goto `dataDownloadViaSMSPP()` and we should
         // not receive the message in content page.
         ok(false, "SMS-PP messages shouldn't be sent to content");
       }
 
       function next() {
-        manager.removeEventListener("received", onReceived);
+        sms.removeEventListener("received", onReceived);
 
         ++pidIndex;
         if (pidIndex >= allPIDs.length) {
           ++dcsIndex;
           if (dcsIndex >= allDCSs.length) {
             window.setTimeout(test_message_class_3, 0);
           } else {
             window.setTimeout(do_test_dcs.bind(null, dcsIndex), 0);
           }
         } else {
           window.setTimeout(do_test_pid.bind(null, pidIndex), 0);
         }
       }
 
-      manager.addEventListener("received", onReceived);
+      sms.addEventListener("received", onReceived);
 
       if (pidIndex != 0) {
         // Wait for three seconds to ensure we don't receive the message.
         window.setTimeout(next, 3000);
       }
 
       let pid = allPIDs[pidIndex];
       log("    Testing PID " + pid);
--- a/dom/mobilemessage/tests/marionette/test_outgoing.js
+++ b/dom/mobilemessage/tests/marionette/test_outgoing.js
@@ -5,17 +5,17 @@ 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 manager = window.navigator.mozMobileMessage;
+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"
                 + "Which alters when it alteration finds,\n"
                 + "Or bends with the remover to remove:\n\n"
                 + "O, no! it is an ever-fix`ed mark,\n"
                 + "That looks on tempests and is never shaken;\n"
                 + "It is the star to every wand'ring bark,\n"
@@ -54,18 +54,18 @@ function doSendMessageAndCheckSuccess(re
     // Make sure we've send a message to each distinct receiver.
     for (let i = 0; i < rs.length; i++) {
       let opt = options[rs[i]];
       if (!(opt && opt.onSentCalled && opt.onRequestSuccessCalled)) {
         return;
       }
     }
 
-    manager.removeEventListener("sending", onSmsSending);
-    manager.removeEventListener("sent", onSmsSent);
+    sms.removeEventListener("sending", onSmsSending);
+    sms.removeEventListener("sent", onSmsSent);
 
     log("Done!");
     window.setTimeout(callback, 0);
   }
 
   function checkSentMessage(message, mark) {
     checkMessage(message, "sent", body);
 
@@ -99,17 +99,17 @@ function doSendMessageAndCheckSuccess(re
     ok(event.target instanceof DOMRequest,
        "event.target is instanceof " + event.target.constructor);
     event.target.removeEventListener("success", onRequestSuccess);
 
     checkSentMessage(event.target.result, "onRequestSuccessCalled");
   }
 
   function onSmsSending(event) {
-    log("onsending event received.");
+    log("SmsManager.onsending event received.");
 
     // Bug 838542: following check throws an exception and fails this case.
     // ok(event instanceof MozSmsEvent,
     //    "event is instanceof " + event.constructor)
     ok(event, "event is valid");
 
     let message = event.message;
     checkMessage(message, "sending", body);
@@ -130,30 +130,30 @@ function doSendMessageAndCheckSuccess(re
     options[receiver] = {
       saved: message,
       onSentCalled: false,
       onRequestSuccessCalled: false
     };
   }
 
   function onSmsSent(event) {
-    log("onsent event received.");
+    log("SmsManager.onsent event received.");
 
     // Bug 838542: following check throws an exception and fails this case.
     // ok(event instanceof MozSmsEvent,
     //    "event is instanceof " + event.constructor)
     ok(event, "event is valid");
 
     checkSentMessage(event.message, "onSentCalled");
   }
 
-  manager.addEventListener("sending", onSmsSending);
-  manager.addEventListener("sent", onSmsSent);
+  sms.addEventListener("sending", onSmsSending);
+  sms.addEventListener("sent", onSmsSent);
 
-  let result = manager.send(receivers, body);
+  let result = sms.send(receivers, body);
   is(Array.isArray(result), Array.isArray(receivers),
      "send() returns an array of requests if receivers is an array");
   if (Array.isArray(receivers)) {
     is(result.length, receivers.length, "returned array length");
   } else {
     result = [result];
   }
 
@@ -173,17 +173,17 @@ function testSendMessage() {
 function testSendMultipartMessage() {
   log("Testing sending message to one receiver:");
   doSendMessageAndCheckSuccess("1", LONG_BODY,
                                testSendMessageToMultipleRecipients);
 }
 
 function testSendMessageToMultipleRecipients() {
   log("Testing sending message to multiple receivers:");
-  // TODO: bug 788928 - add test cases for ondelivered event.
+  // 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");
--- a/dom/mobilemessage/tests/marionette/test_outgoing_delete.js
+++ b/dom/mobilemessage/tests/marionette/test_outgoing_delete.js
@@ -5,33 +5,33 @@ 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 manager = window.navigator.mozMobileMessage;
+let sms = window.navigator.mozSms;
 let msgText = "Mozilla Firefox OS!";
 let gotSmsOnsent = false;
 let gotReqOnsuccess = false;
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(manager, "mozMobileMessage");
+  ok(sms, "mozSms");
   sendSms();
 }
 
 function sendSms() {
   let smsId = 0;
 
   log("Sending an SMS.");
-  manager.onsent = function(event) {
-    log("Received 'onsent' event.");
+  sms.onsent = function(event) {
+    log("Received 'onsent' smsmanager event.");
     gotSmsOnsent = true;
     let sentSms = event.message;
     ok(sentSms, "outgoing sms");
     ok(sentSms.id, "sms id");
     smsId = sentSms.id;
     log("Sent SMS (id: " + smsId + ").");
     ok(sentSms.threadId, "thread id");
     is(sentSms.body, msgText, "msg body");
@@ -41,43 +41,43 @@ function sendSms() {
     is(sentSms.receiver, RECEIVER, "receiver");
     is(sentSms.sender, SENDER, "sender");
     is(sentSms.messageClass, "normal", "messageClass");
     ok(sentSms.timestamp instanceof Date, "timestamp is istanceof date");
 
     if (gotSmsOnsent && gotReqOnsuccess) { verifySmsExists(smsId); }
   };
 
-  let requestRet = manager.send(RECEIVER, msgText);
+  let requestRet = sms.send(RECEIVER, msgText);
   ok(requestRet, "smsrequest obj returned");
 
   requestRet.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     gotReqOnsuccess = true;
     if(event.target.result){
       if (gotSmsOnsent && gotReqOnsuccess) { verifySmsExists(smsId); }
     } else {
-      log("smsrequest returned false for manager.send");
+      log("smsrequest returned false for sms.send");
       ok(false,"SMS send failed");
       cleanUp();
     }
   };
 
   requestRet.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "manager.send request returned unexpected error: "
+    ok(false, "sms.send request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 function verifySmsExists(smsId) {
   log("Getting SMS (id: " + smsId + ").");
-  let requestRet = manager.getMessage(smsId);
+  let requestRet = sms.getMessage(smsId);
   ok(requestRet, "smsrequest obj returned");
 
   requestRet.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     ok(event.target.result, "smsrequest event.target.result");
     let foundSms = event.target.result;
     is(foundSms.id, smsId, "found SMS id matches");
     is(foundSms.body, msgText, "found SMS msg text matches");
@@ -97,42 +97,42 @@ function verifySmsExists(smsId) {
     log("Could not get SMS (id: " + smsId + ") but should have.");
     ok(false,"SMS was not found");
     cleanUp();
   };
 }
 
 function deleteSms(smsId){
   log("Deleting SMS (id: " + smsId + ") using sms id parameter.");
-  let requestRet = manager.delete(smsId);
+  let requestRet = sms.delete(smsId);
   ok(requestRet,"smsrequest obj returned");
 
   requestRet.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     if(event.target.result){
       verifySmsDeleted(smsId);
     } else {
-      log("smsrequest returned false for manager.delete");
+      log("smsrequest returned false for sms.delete");
       ok(false,"SMS delete failed");
       cleanUp();
     }
   };
 
   requestRet.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "manager.delete request returned unexpected error: "
+    ok(false, "sms.delete request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 function verifySmsDeleted(smsId) {
   log("Getting SMS (id: " + smsId + ").");
-  let requestRet = manager.getMessage(smsId);
+  let requestRet = sms.getMessage(smsId);
   ok(requestRet, "smsrequest obj returned");
 
   requestRet.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     ok(event.target.result, "smsrequest event.target.result");
     let foundSms = event.target.result;
     is(foundSms.id, smsId, "found SMS id matches");
     is(foundSms.body, msgText, "found SMS msg text matches");
@@ -146,17 +146,17 @@ function verifySmsDeleted(smsId) {
     ok(event.target.error, "domerror obj");
     is(event.target.error.name, "NotFoundError", "error returned");
     log("Could not get SMS (id: " + smsId + ") as expected.");
     cleanUp();
   };
 }
 
 function cleanUp() {
-  manager.onsent = null;
+  sms.onsent = null;
   SpecialPowers.removePermission("sms", document);
   SpecialPowers.clearUserPref("dom.sms.enabled");
   SpecialPowers.clearUserPref("dom.sms.requestStatusReport");
   finish();
 }
 
 // Start the test
 verifyInitialState();
--- a/dom/mobilemessage/tests/marionette/test_outgoing_max_segments.js
+++ b/dom/mobilemessage/tests/marionette/test_outgoing_max_segments.js
@@ -1,82 +1,82 @@
 /* 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.addPermission("sms", true, document);
 
-let manager = window.navigator.mozMobileMessage;
+let sms = window.navigator.mozSms;
 // https://developer.mozilla.org/en-US/docs/DOM/SmsManager
 let maxCharsPerSms = 160;
 let maxSegments = 10; // 10 message segments concatenated into 1 multipart SMS
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(manager, "mozMobileMessage");
+  ok(sms, "mozSms");
   sendSms();
 }
 
 function sendSms() {
   let destNumber = "5551234567";
   let msgText = "";
   let gotReqOnSuccess = false;
   let gotSmsOnSent = false;
   let sentSms;
 
   // Build the message text
   msgText = new Array((maxCharsPerSms * maxSegments) + 1).join('a');
   log("Sending multipart SMS (" + msgText.length + " chars total).");
 
-  manager.onsent = function(event) {
-    manager.onsent = null;
-    log("Received 'onsent' event.");
+  sms.onsent = function(event) {
+    sms.onsent = null;
+    log("Received 'onsent' smsmanager event.");
 
     gotSmsOnSent = true;
     sentSms = event.message;
     ok(sentSms, "outgoing sms");
     ok(sentSms.id, "sms id");
     log("Sent SMS (id: " + sentSms.id + ").");
     ok(sentSms.threadId, "thread id");
     is(sentSms.body.length, msgText.length, "text length");
     is(sentSms.body, msgText, "msg body");
     is(sentSms.delivery, "sent", "delivery");
 
     if (gotReqOnSuccess) { verifySmsExists(sentSms); }
   };
 
-  let requestRet = manager.send(destNumber, msgText);
+  let requestRet = sms.send(destNumber, msgText);
   ok(requestRet, "smsrequest obj returned");
 
   requestRet.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     gotReqOnSuccess = true;
     if (event.target.result) {
       if (gotSmsOnSent) { verifySmsExists(sentSms); }
     } else {
-      log("smsrequest returned false for manager.send");
+      log("smsrequest returned false for sms.send");
       ok(false, "SMS send failed");
       cleanUp();
     }
   };
 
   requestRet.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "manager.send request returned unexpected error: " +
+    ok(false, "sms.send request returned unexpected error: " +
               event.target.error.name);
     cleanUp();
   };
 }
 
 function verifySmsExists(sentSms) {
   log("Getting SMS (id: " + sentSms.id + ").");
-  let requestRet = manager.getMessage(sentSms.id);
+  let requestRet = sms.getMessage(sentSms.id);
   ok(requestRet, "smsrequest obj returned");
 
   requestRet.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     ok(event.target.result, "smsrequest event.target.result");
     let foundSms = event.target.result;
     is(foundSms.id, sentSms.id, "found SMS id matches");
     is(foundSms.threadId, sentSms.threadId, "found SMS thread id matches");
@@ -93,34 +93,34 @@ function verifySmsExists(sentSms) {
     log("Could not get SMS (id: " + sentSms.id + ") but should have.");
     ok(false, "SMS was not found");
     cleanUp();
   };
 }
 
 function deleteSms(smsMsgObj) {
   log("Deleting SMS (id: " + smsMsgObj.id + ") using smsmsg obj parameter.");
-  let requestRet = manager.delete(smsMsgObj);
+  let requestRet = sms.delete(smsMsgObj);
   ok(requestRet,"smsrequest obj returned");
 
   requestRet.onsuccess = function(event) {
     log("Received 'onsuccess' smsrequest event.");
     if (event.target.result) {
       cleanUp();
     } else {
-      log("smsrequest returned false for manager.delete");
+      log("smsrequest returned false for sms.delete");
       ok(false, "SMS delete failed");
       cleanUp();
     }
   };
 
   requestRet.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "manager.delete request returned unexpected error: " +
+    ok(false, "sms.delete request returned unexpected error: " +
               event.target.error.name);
     cleanUp();
   };
 }
 
 function cleanUp() {
   SpecialPowers.removePermission("sms", document);
   SpecialPowers.clearUserPref("dom.sms.enabled");
--- a/dom/mobilemessage/tests/marionette/test_phone_number_normalization.js
+++ b/dom/mobilemessage/tests/marionette/test_phone_number_normalization.js
@@ -51,17 +51,17 @@ let tasks = {
   }
 };
 
 function getAllMessages(callback, filter, reverse) {
   if (!filter) {
     filter = new MozSmsFilter;
   }
   let messages = [];
-  let request = manager.getMessages(filter, reverse || false);
+  let request = mozSms.getMessages(filter, reverse || false);
   request.onsuccess = function(event) {
     if (request.result) {
       messages.push(request.result);
       request.continue();
       return;
     }
 
     window.setTimeout(callback.bind(null, messages), 0);
@@ -72,51 +72,51 @@ function deleteAllMessages() {
   getAllMessages(function deleteAll(messages) {
     let message = messages.shift();
     if (!message) {
       ok(true, "all messages deleted");
       tasks.next();
       return;
     }
 
-    let request = manager.delete(message.id);
+    let request = mozSms.delete(message.id);
     request.onsuccess = deleteAll.bind(null, messages);
     request.onerror = function (event) {
       ok(false, "failed to delete all messages");
       tasks.finish();
     }
   });
 }
 
 function validate(number, normalizedNumber) {
   log("Checking ('" + number + "', '" + normalizedNumber + "')");
 
-  let sendRequest = manager.send(number, "ping");
+  let sendRequest = mozSms.send(number, "ping");
   sendRequest.onsuccess = function onSendSuccess(event) {
     let sentMessage = event.target.result;
 
-    manager.onreceived = function onreceived(event) {
+    mozSms.onreceived = function onreceived(event) {
       let receivedMessage = event.message;
       is(sentMessage.threadId, receivedMessage.threadId,
          "message threadIds are supposed to be matched");
 
       tasks.next();
     };
     sendSmsToEmulator(normalizedNumber, "pong");
   };
   sendRequest.onerror = function onSendError(event) {
     ok(false, "failed to send message.");
     tasks.finish();
   };
 }
 
-let manager = window.navigator.mozMobileMessage;
+let mozSms = window.navigator.mozSms;
 tasks.push(function () {
-  log("Checking mozMobileMessage.");
-  ok(manager instanceof MozMobileMessageManager);
+  log("Checking mozSms.");
+  ok(mozSms instanceof MozSmsManager);
   tasks.next();
 });
 
 tasks.push(deleteAllMessages);
 
 tasks.push(validate.bind(null, "+886-9-87-654-321", "+886987654321"));
 tasks.push(validate.bind(null, "+886 9 87654321", "+886987654321"));
 tasks.push(validate.bind(null, "+886(9)87654321", "+886987654321"));
--- a/dom/mobilemessage/tests/marionette/test_segment_info.js
+++ b/dom/mobilemessage/tests/marionette/test_segment_info.js
@@ -10,30 +10,30 @@ const LEN_UCS2 = 70;
 const LEN_UCS2_WITH_8BIT_REF = 67;
 const LEN_UCS2_WITH_16BIT_REF = 66;
 
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
 let currentStrict7BitEncoding = false;
 SpecialPowers.setBoolPref("dom.sms.strict7BitEncoding", currentStrict7BitEncoding);
 SpecialPowers.addPermission("sms", true, document);
 
-let manager = window.navigator.mozMobileMessage;
-ok(manager instanceof MozMobileMessageManager);
+let sms = window.navigator.mozSms;
+ok(sms instanceof MozSmsManager);
 
 function times(str, n) {
   return (new Array(n + 1)).join(str);
 }
 
 function doTest(text, strict7BitEncoding, expected) {
   if (strict7BitEncoding != currentStrict7BitEncoding) {
     currentStrict7BitEncoding = strict7BitEncoding;
     SpecialPowers.setBoolPref("dom.sms.strict7BitEncoding", currentStrict7BitEncoding);
   }
 
-  let result = manager.getSegmentInfoForText(text);
+  let result = sms.getSegmentInfoForText(text);
   ok(result, "result of GetSegmentInfoForText is valid");
   is(result.segments, expected[0], "segments");
   is(result.charsPerSegment, expected[1], "charsPerSegment");
   is(result.charsAvailableInLastSegment, expected[2], "charsAvailableInLastSegment");
 }
 
 function cleanUp() {
   SpecialPowers.removePermission("sms", document);
--- a/dom/mobilemessage/tests/marionette/test_strict_7bit_encoding.js
+++ b/dom/mobilemessage/tests/marionette/test_strict_7bit_encoding.js
@@ -122,18 +122,18 @@ const GSM_SMS_STRICT_7BIT_CHARMAP = {
 
 // Emulator will loop back the outgoing SMS if the phone number equals to its
 // control port, which is 5554 for the first emulator instance.
 const SELF = "5554";
 
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
 SpecialPowers.addPermission("sms", true, document);
 
-let manager = window.navigator.mozMobileMessage;
-ok(manager instanceof MozMobileMessageManager);
+let sms = window.navigator.mozSms;
+ok(sms instanceof MozSmsManager);
 
 let tasks = {
   // List of test fuctions. Each of them should call |tasks.next()| when
   // completed or |tasks.finish()| to jump to the last one.
   _tasks: [],
   _nextTaskIndex: 0,
 
   push: function push(func) {
@@ -173,26 +173,26 @@ function testStrict7BitEncodingHelper(se
   let count = 0;
   function done(step) {
     count += step;
     if (count >= 2) {
       window.setTimeout(tasks.next.bind(tasks), 0);
     }
   }
 
-  manager.addEventListener("received", function onReceived(event) {
+  sms.addEventListener("received", function onReceived(event) {
     event.target.removeEventListener("received", onReceived);
 
     let message = event.message;
     is(message.body, received, "received message.body");
 
     done(1);
   });
 
-  let request = manager.send(SELF, sent);
+  let request = sms.send(SELF, sent);
   request.addEventListener("success", function onRequestSuccess(event) {
     let message = event.target.result;
     is(message.body, sent, "sent message.body");
 
     done(1);
   });
   request.addEventListener("error", function onRequestError(event) {
     ok(false, "Can't send message out!!!");
--- a/dom/mobilemessage/tests/marionette/test_update_thread_record_in_delete.js
+++ b/dom/mobilemessage/tests/marionette/test_update_thread_record_in_delete.js
@@ -5,18 +5,18 @@ MARIONETTE_TIMEOUT = 60000;
 
 const FROM = "09123456789";
 const PREFIX = "msg_";
 const MSGS = 3;
 
 SpecialPowers.addPermission("sms", true, document);
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
 
-let manager = window.navigator.mozMobileMessage;
-ok(manager instanceof MozMobileMessageManager);
+let mozSms = window.navigator.mozSms;
+ok(mozSms instanceof MozSmsManager);
 
 let pendingEmulatorCmdCount = 0;
 function sendSmsToEmulator(from, text) {
   ++pendingEmulatorCmdCount;
 
   let cmd = "sms send " + from + " " + text;
   runEmulatorCmd(cmd, function (result) {
     --pendingEmulatorCmdCount;
@@ -58,31 +58,31 @@ let tasks = {
   }
 };
 
 function getAllMessages(callback, filter, reverse) {
   if (!filter) {
     filter = new MozSmsFilter;
   }
   let messages = [];
-  let cursor = manager.getMessages(filter, reverse || false);
+  let cursor = mozSms.getMessages(filter, reverse || false);
   cursor.onsuccess = function(event) {
     if (!this.done) {
       messages.push(this.result);
       this.continue();
       return;
     }
 
     window.setTimeout(callback.bind(null, messages), 0);
   }
 }
 
 function getAllThreads(callback) {
   let threads = [];
-  let cursor = manager.getThreads();
+  let cursor = mozSms.getThreads();
   cursor.onsuccess = function(event) {
     if (!this.done) {
       threads.push(this.result);
       this.continue();
       return;
     }
 
     window.setTimeout(callback.bind(null, threads), 0);
@@ -93,17 +93,17 @@ function deleteAllMessages() {
   getAllMessages(function deleteAll(messages) {
     let message = messages.shift();
     if (!message) {
       ok(true, "all messages deleted");
       tasks.next();
       return;
     }
 
-    let request = manager.delete(message.id);
+    let request = mozSms.delete(message.id);
     request.onsuccess = deleteAll.bind(null, messages);
     request.onerror = function (event) {
       ok(false, "failed to delete all messages");
       tasks.finish();
     }
   });
 }
 
@@ -120,17 +120,17 @@ tasks.push(deleteAllMessages);
 
 tasks.push(getAllThreads.bind(null, function (threads) {
   is(threads.length, 0, "Threads are cleared");
   tasks.next();
 }));
 
 let gotMessagesCount = 0;
 tasks.push(function () {
-  manager.onreceived = function () {
+  mozSms.onreceived = function () {
     ++gotMessagesCount;
   };
   tasks.next();
 });
 
 tasks.push(function () {
   for (let i = 1; i <= MSGS; i++) {
     sendSmsToEmulator(FROM, PREFIX + i);
@@ -164,17 +164,17 @@ tasks.push(getAllThreads.bind(null, func
               lastMessage.body,
               allMessages.length,
               lastMessage.timestamp);
 
   tasks.next();
 }));
 
 tasks.push(function DeleteFirstMessage() {
-  let request = manager.delete(allMessages[0].id);
+  let request = mozSms.delete(allMessages[0].id);
   request.onsuccess = function () {
     getAllThreads(function (threads) {
       is(threads.length, 1, "Should have only one thread");
 
       allMessages = allMessages.slice(1);
       let lastMessage = allMessages[allMessages.length - 1];
 
       checkThread(threads[0],
@@ -184,17 +184,17 @@ tasks.push(function DeleteFirstMessage()
                   lastMessage.timestamp);
 
       tasks.next();
     });
   };
 });
 
 tasks.push(function DeleteLastMessage() {
-  let request = manager.delete(allMessages[allMessages.length - 1].id);
+  let request = mozSms.delete(allMessages[allMessages.length - 1].id);
   request.onsuccess = function () {
     getAllThreads(function (threads) {
       is(threads.length, 1, "Should have only one thread");
 
       allMessages = allMessages.slice(0, -1);
       let lastMessage = allMessages[allMessages.length - 1];
 
       checkThread(threads[0],
@@ -217,16 +217,16 @@ tasks.push(getAllThreads.bind(null, func
 
 // WARNING: All tasks should be pushed before this!!!
 tasks.push(function cleanUp() {
   if (pendingEmulatorCmdCount) {
     window.setTimeout(cleanUp, 100);
     return;
   }
 
-  manager.onreceived = null;
+  mozSms.onreceived = null;
 
   SpecialPowers.removePermission("sms", document);
   SpecialPowers.clearUserPref("dom.sms.enabled");
   finish();
 });
 
 tasks.run();
--- a/dom/mobilemessage/tests/test_sms_basics.html
+++ b/dom/mobilemessage/tests/test_sms_basics.html
@@ -11,42 +11,42 @@
 <iframe></iframe>
 </div>
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for WebSMS **/
 
 function checkSmsDisabled() {
-  ok(!('mozMobileMessage' in frames[0].navigator), "navigator.mozMobileMessage should not exist");
-  ok(frames[0].navigator.mozMobileMessage === undefined,
-     "navigator.mozMobileMessage should return undefined");
+  ok(!('mozSms' in frames[0].navigator), "navigator.mozSms should not exist");
+  ok(frames[0].navigator.mozSms === undefined,
+     "navigator.mozSms should return undefined");
 }
 
 function checkSmsEnabled() {
   // Bug 784617: WebSms is disabled on all platforms except Android for the moment.
   if (navigator.appVersion.indexOf("Android") == -1) {
     checkSmsDisabled();
     return;
   }
 
-  ok('mozMobileMessage' in frames[0].navigator, "navigator.mozMobileMessage should exist");
-  ok(frames[0].navigator.mozMobileMessage, "navigator.mozMobileMessage returns an object");
-  ok(frames[0].navigator.mozMobileMessage instanceof MozMobileMessageManager,
-     "navigator.mozMobileMessage is an MobileMessageManager object");
+  ok('mozSms' in frames[0].navigator, "navigator.mozSms should exist");
+  ok(frames[0].navigator.mozSms, "navigator.mozSms returns an object");
+  ok(frames[0].navigator.mozSms instanceof MozSmsManager, "navigator.mozSms is an SmsManager object");
 }
 
 function checkInterface(aInterface) {
   ok(!(aInterface in window), aInterface + " should be prefixed");
   ok(("Moz" + aInterface) in window, aInterface + " should be prefixed");
 }
 
 function test() {
   var gSmsEnabled = SpecialPowers.getBoolPref("dom.sms.enabled");
 
+  checkInterface("SmsManager");
   checkInterface("SmsMessage");
   checkInterface("SmsEvent");
   checkInterface("SmsFilter");
 
   // If sms is disabled and permission is removed, sms is disabled.
   SpecialPowers.setBoolPref("dom.sms.enabled", false);
   SpecialPowers.removePermission("sms", document);
   checkSmsDisabled();
--- a/dom/permission/tests/test_sms.html
+++ b/dom/permission/tests/test_sms.html
@@ -15,18 +15,18 @@ https://bugzilla.mozilla.org/show_bug.cg
 <div id="content" style="display: none"></div>
 <pre id="test">
 <script type="application/javascript;version=1.8" src="file_framework.js"></script>
 <script type="application/javascript;version=1.8">
 var gData = [
   {
     perm: ["sms"],
     needParentPerm: true,
-    obj: "mozMobileMessage",
-    idl: "nsIDOMMozMobileMessageManager",
+    obj: "mozSms",
+    idl: "nsIDOMMozSmsManager",
     settings: [["dom.sms.enabled", true]],
   },
 ]
 </script>
 </pre>
 </body>
 </html>
 
--- a/dom/tests/mochitest/general/test_interfaces.html
+++ b/dom/tests/mochitest/general/test_interfaces.html
@@ -265,16 +265,17 @@ var interfaceNamesInGlobalScope =
     "MozNamedAttrMap",
     "MozNetworkStats",
     "MozNetworkStatsData",
     "MozNetworkStatsManager",
     "MozPowerManager",
     "MozSettingsEvent",
     "MozSmsEvent",
     "MozSmsFilter",
+    "MozSmsManager",
     "MozSmsMessage",
     "MozSmsSegmentInfo",
     "MozTimeManager",
     "MozTouchEvent",
     "MozWakeLock",
     "MozWakeLockListener",
     "MutationEvent",
     "MutationObserver",
--- a/dom/webidl/Navigator.webidl
+++ b/dom/webidl/Navigator.webidl
@@ -220,16 +220,23 @@ partial interface Navigator {
 };
 
 // nsIDOMClientInformation
 partial interface Navigator {
   [Throws]
   boolean mozIsLocallyAvailable(DOMString uri, boolean whenOffline);
 };
 
+// nsIDOMMozNavigatorSms
+interface MozSmsManager;
+partial interface Navigator {
+  [Func="Navigator::HasSmsSupport"]
+  readonly attribute MozSmsManager? mozSms;
+};
+
 // nsIDOMMozNavigatorMobileMessage
 interface MozMobileMessageManager;
 partial interface Navigator {
   [Func="Navigator::HasMobileMessageSupport"]
   readonly attribute MozMobileMessageManager? mozMobileMessage;
 };
 
 // nsIDOMMozNavigatorNetwork