Merge m-c to inbound.
authorRyan VanderMeulen <ryanvm@gmail.com>
Fri, 26 Jul 2013 14:20:01 -0400
changeset 140199 e7045ef73a3d7735eb8eccff9152791de89dc767
parent 140198 79322a7a9e09dbd483709fbc46b5604bb3aac40c (current diff)
parent 140133 5aa02ee02f4b59d3df9af31b74cd8dcbdd70e570 (diff)
child 140200 889041639eb9248ba0c0402e4f0cbe1c607b33ca
push id1945
push userryanvm@gmail.com
push dateSat, 27 Jul 2013 02:27:26 +0000
treeherderfx-team@4874fa438b1c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone25.0a1
Merge m-c to inbound.
dom/base/nsDOMClassInfo.cpp
dom/mobilemessage/interfaces/nsIDOMSmsManager.idl
dom/mobilemessage/src/SmsManager.cpp
dom/mobilemessage/src/SmsManager.h
--- a/b2g/components/TelURIParser.jsm
+++ b/b2g/components/TelURIParser.jsm
@@ -7,28 +7,28 @@
 this.EXPORTED_SYMBOLS = ["TelURIParser"];
 
 /**
  * Singleton providing functionality for parsing tel: and sms: URIs
  */
 this.TelURIParser = {
   parseURI: function(scheme, uri) {
     // https://www.ietf.org/rfc/rfc2806.txt
-    let subscriber = uri.slice((scheme + ':').length);
+    let subscriber = decodeURIComponent(uri.slice((scheme + ':').length));
 
     if (!subscriber.length) {
       return null;
     }
 
     let number = '';
     let pos = 0;
     let len = subscriber.length;
 
     // visual-separator
-    let visualSeparator = [ '-', '.', '(', ')' ];
+    let visualSeparator = [ ' ', '-', '.', '(', ')' ];
     let digits = [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' ];
     let dtmfDigits = [ '*', '#', 'A', 'B', 'C', 'D' ];
     let pauseCharacter = [ 'p', 'w' ];
 
     // global-phone-number
     if (subscriber[pos] == '+') {
       number += '+';
       for (++pos; pos < len; ++pos) {
--- a/b2g/components/test/unit/test_bug793310.js
+++ b/b2g/components/test/unit/test_bug793310.js
@@ -1,16 +1,19 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 function run_test() {
   Components.utils.import("resource:///modules/TelURIParser.jsm")
 
   // global-phone-number
-   do_check_eq(TelURIParser.parseURI('tel', 'tel:+1234'), '+1234');
+  do_check_eq(TelURIParser.parseURI('tel', 'tel:+1234'), '+1234');
+
+  // global-phone-number => white space separator
+  do_check_eq(TelURIParser.parseURI('tel', 'tel:+123 456 789'), '+123 456 789');
 
   // global-phone-number => ignored chars
   do_check_eq(TelURIParser.parseURI('tel', 'tel:+1234_123'), '+1234');
 
   // global-phone-number => visualSeparator + digits
   do_check_eq(TelURIParser.parseURI('tel', 'tel:+-.()1234567890'), '+-.()1234567890');
 
   // local-phone-number
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -1,4 +1,4 @@
 {
-    "revision": "72f1b7c657c65389c843dcd032e5bb787f4afafc", 
+    "revision": "f2454e95b24f028b6ebc1b1edb880c12f80454de", 
     "repo_path": "/integration/gaia-central"
 }
--- a/content/media/test/file_access_controls.html
+++ b/content/media/test/file_access_controls.html
@@ -144,17 +144,15 @@ function nextTest() {
     // Will cause load() to be invoked.
   } else {
     gVideo.load();
   }
   gTestNum++;
 }
 
 function done() {
-  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-  mediaTestCleanup();
   opener.done();
 }
 
 </script>
 </body>
 </html>
 
--- a/content/media/test/manifest.js
+++ b/content/media/test/manifest.js
@@ -211,17 +211,17 @@ var gInvalidTests = [
   { name:"invalid-cmap-s1c2.opus", type:"audio/ogg; codecs=opus"},
 ];
 
 // Converts a path/filename to a file:// URI which we can load from disk.
 // Optionally checks whether the file actually exists on disk at the location
 // we've specified.
 function fileUriToSrc(path, mustExist) {
   // android mochitest doesn't support file://
-  if (navigator.appVersion.indexOf("Android") != -1)
+  if (navigator.appVersion.indexOf("Android") != -1 || SpecialPowers.Services.appinfo.name == "B2G")
     return path;
 
   const Ci = SpecialPowers.Ci;
   const Cc = SpecialPowers.Cc;
   const Cr = SpecialPowers.Cr;
   var dirSvc = Cc["@mozilla.org/file/directory_service;1"].
                getService(Ci.nsIProperties);
   var f = dirSvc.get("CurWorkD", Ci.nsILocalFile);
@@ -686,30 +686,30 @@ function mediaTestCleanup() {
                                  .classes["@mozilla.org/preferences-service;1"]
                                  .getService(SpecialPowers.Ci.nsIPrefService);
   var branch = prefService.getBranch("media.");
   var oldDefault = 2;
   var oldAuto = 3;
   var oldGStreamer = undefined;
   var oldOpus = undefined;
 
-  try { oldGStreamer = branch.getBoolPref("gstreamer.enabled"); } catch(ex) { }
-  try { oldDefault   = branch.getIntPref("preload.default"); } catch(ex) { }
-  try { oldAuto      = branch.getIntPref("preload.auto"); } catch(ex) { }
-  try { oldOpus      = branch.getBoolPref("opus.enabled"); } catch(ex) { }
+  try { oldGStreamer = SpecialPowers.getBoolPref("media.gstreamer.enabled"); } catch(ex) { }
+  try { oldDefault   = SpecialPowers.getIntPref("media.preload.default"); } catch(ex) { }
+  try { oldAuto      = SpecialPowers.getIntPref("media.preload.auto"); } catch(ex) { }
+  try { oldOpus      = SpecialPowers.getBoolPref("media.opus.enabled"); } catch(ex) { }
 
-  branch.setIntPref("preload.default", 2); // preload_metadata
-  branch.setIntPref("preload.auto", 3); // preload_enough
+  SpecialPowers.setIntPref("media.preload.default", 2); // preload_metadata
+  SpecialPowers.setIntPref("media.preload.auto", 3); // preload_enough
   // test opus playback iff the pref exists
   if (oldOpus !== undefined)
-    branch.setBoolPref("opus.enabled", true);
+    SpecialPowers.setBoolPref("media.opus.enabled", true);
   if (oldGStreamer !== undefined)
-    branch.setBoolPref("gstreamer.enabled", true);
+    SpecialPowers.setBoolPref("media.gstreamer.enabled", true);
 
   window.addEventListener("unload", function() {
     if (oldGStreamer !== undefined)
-      branch.setBoolPref("gstreamer.enabled", oldGStreamer);
-    branch.setIntPref("preload.default", oldDefault);
-    branch.setIntPref("preload.auto", oldAuto);
+      SpecialPowers.setBoolPref("media.gstreamer.enabled", oldGStreamer);
+    SpecialPowers.setIntPref("media.preload.default", oldDefault);
+    SpecialPowers.setIntPref("media.preload.auto", oldAuto);
     if (oldOpus !== undefined)
-      branch.setBoolPref("opus.enabled", oldOpus);
+      SpecialPowers.setBoolPref("media.opus.enabled", oldOpus);
   }, false);
  })();
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -25,17 +25,16 @@
 #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"
@@ -136,17 +135,16 @@ 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)
@@ -199,21 +197,16 @@ 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;
@@ -1109,29 +1102,16 @@ 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);
 
@@ -1612,24 +1592,16 @@ 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,17 +4,16 @@
  * 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;
@@ -58,17 +57,16 @@ 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;
@@ -203,17 +201,16 @@ 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
@@ -252,17 +249,16 @@ 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 */,
@@ -301,17 +297,16 @@ 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,17 +213,16 @@ 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"
 
@@ -572,19 +571,16 @@ 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)
@@ -1436,20 +1432,16 @@ 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,17 +90,16 @@ 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
@@ -1700,17 +1700,16 @@ 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/contacts/fallback/ContactDB.jsm
+++ b/dom/contacts/fallback/ContactDB.jsm
@@ -101,17 +101,17 @@ this.ContactDB = function ContactDB(aGlo
 }
 
 ContactDB.prototype = {
   __proto__: IndexedDBHelper.prototype,
 
   _dispatcher: {},
 
   upgradeSchema: function upgradeSchema(aTransaction, aDb, aOldVersion, aNewVersion) {
-    function loadInitialContacts() {
+    let loadInitialContacts = function() {
       // Add default contacts
       let jsm = {};
       Cu.import("resource://gre/modules/FileUtils.jsm", jsm);
       Cu.import("resource://gre/modules/NetUtil.jsm", jsm);
       // Loading resource://app/defaults/contacts.json doesn't work because
       // contacts.json is not in the omnijar.
       // So we look for the app dir instead and go from here...
       let contactsFile = jsm.FileUtils.getFile("DefRt", ["contacts.json"], false);
@@ -150,17 +150,17 @@ ContactDB.prototype = {
         contact.id = idService.generateUUID().toString().replace('-', '', 'g')
                                                         .replace('{', '')
                                                         .replace('}', '');
         contact = this.makeImport(contact);
         this.updateRecordMetadata(contact);
         if (DEBUG) debug("import: " + JSON.stringify(contact));
         objectStore.put(contact);
       }
-    }
+    }.bind(this);
 
     if (DEBUG) debug("upgrade schema from: " + aOldVersion + " to " + aNewVersion + " called!");
     let db = aDb;
     let objectStore;
 
     let steps = [
       function upgrade0to1() {
         /**
--- a/dom/mobilemessage/interfaces/moz.build
+++ b/dom/mobilemessage/interfaces/moz.build
@@ -7,17 +7,16 @@
 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',
deleted file mode 100644
--- a/dom/mobilemessage/interfaces/nsIDOMSmsManager.idl
+++ /dev/null
@@ -1,44 +0,0 @@
-/* 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,24 +13,22 @@
 
 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()
deleted file mode 100644
--- a/dom/mobilemessage/src/SmsManager.cpp
+++ /dev/null
@@ -1,502 +0,0 @@
-/* -*- 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
deleted file mode 100644
--- a/dom/mobilemessage/src/SmsManager.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -*- 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,33 +37,31 @@ 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.mozSms != null;"))
+        self.assertTrue(receiver.execute_script("return window.navigator.mozMobileMessage != null;"))
         receiver.execute_script("""
 global.smsreceived = null;
-window.navigator.mozSms.addEventListener("received", function(e) {
+window.navigator.mozMobileMessage.addEventListener("received", function(e) {
     global.smsreceived = e.message.body;
 });
 """, new_sandbox=False)
 
         # Send the SMS from the sender.
         sender.execute_script("""
-window.navigator.mozSms.send("%d", "%s");
+window.navigator.mozMobileMessage.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,24 @@
 /* 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 sms = window.navigator.mozSms;
+let manager = window.navigator.mozMobileMessage;
+ok(manager instanceof MozMobileMessageManager,
+   "manager is instance of " + manager.constructor);
 
 // 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
-// sms.onreceived event. Also note that a single larger message (i.e. 1600
+// 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 +38,19 @@ function firstIncomingSms() {
 function secondIncomingSms() {
   simulateIncomingSms(cleanUp);
 }
 
 function simulateIncomingSms(nextFunction) {
   log("Simulating incoming multipart SMS (" + msgText.length
       + " chars total).");
 
-  sms.onreceived = function onreceived(event) {
-    log("Received 'onreceived' smsmanager event.");
-    sms.onreceived = null;
+  manager.onreceived = function onreceived(event) {
+    log("Received 'onreceived' event.");
+    manager.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,19 @@ SpecialPowers.setBoolPref("dom.sms.enabl
 SpecialPowers.addPermission("sms", true, document);
 
 function cleanUp() {
   SpecialPowers.removePermission("sms", document);
   SpecialPowers.clearUserPref("dom.sms.enabled");
   finish();
 }
 
-let sms = window.navigator.mozSms;
-ok(sms instanceof MozSmsManager);
+let manager = window.navigator.mozMobileMessage;
+ok(manager instanceof MozMobileMessageManager,
+   "manager is instance of " + manager.constructor);
 
 function randomString16() {
   return Math.random().toString(36).substr(2, 16);
 }
 
 function times(str, n) {
   return (new Array(n + 1)).join(str);
 }
@@ -28,26 +29,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) {
-  sms.addEventListener("received", function onReceived(event) {
+  manager.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 = sms.send(SELF, body);
+  let request = manager.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,33 @@
 /* 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 sms = window.navigator.mozSms;
+let manager = window.navigator.mozMobileMessage;
 let numberMsgs = 10;
 let smsList = new Array();
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(sms, "mozSms");
+  ok(manager instanceof MozMobileMessageManager,
+     "manager is instance of " + manager.constructor);
   // 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 = sms.getMessages(filter, false);
+  let cursor = manager.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 +42,51 @@ function deleteAllMsgs(nextFunction) {
         nextFunction();
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("sms.getMessages error: " + event.target.error.name);
+    log("manager.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 = sms.delete(smsId);
+  let request = manager.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,"sms.delete request returned false");
+      ok(false,"manager.delete request returned false");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "sms.delete request returned unexpected error: "
+    ok(false, "manager.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 +98,17 @@ function simulateIncomingSms() {
   rcvdEmulatorCallback = false;
   runEmulatorCmd("sms send " + remoteNumber + " " + text, function(result) {
     is(result[0], "OK", "emulator callback");
     rcvdEmulatorCallback = true;
   });
 }
 
 // Callback for incoming sms
-sms.onreceived = function onreceived(event) {
+manager.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 +132,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 = sms.getMessages(filter, false);
+  let cursor = manager.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 +155,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 sms.getMessages");
+        ok(false, "Incorrect number of messages returned by manager.getMessages");
         deleteAllMsgs(cleanUp);
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("sms.getMessages error: " + event.target.error.name);
+    log("manager.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() {
-  sms.onreceived = null;
+  manager.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,33 @@
 /* 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 sms = window.navigator.mozSms;
+let manager = window.navigator.mozMobileMessage;
 let numberMsgs = 10;
 let smsList = new Array();
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(sms, "mozSms");
+  ok(manager instanceof MozMobileMessageManager,
+     "manager is instance of " + manager.constructor);
   // 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 = sms.getMessages(filter, false);
+  let cursor = manager.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 +42,51 @@ function deleteAllMsgs(nextFunction) {
         nextFunction();
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("sms.getMessages error: " + event.target.error.name);
+    log("manager.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 = sms.delete(smsId);
+  let request = manager.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,"sms.delete request returned false");
+      ok(false,"manager.delete request returned false");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "sms.delete request returned unexpected error: "
+    ok(false, "manager.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 +98,17 @@ function simulateIncomingSms() {
   rcvdEmulatorCallback = false;
   runEmulatorCmd("sms send " + remoteNumber + " " + text, function(result) {
     is(result[0], "OK", "emulator callback");
     rcvdEmulatorCallback = true;
   });
 }
 
 // Callback for incoming sms
-sms.onreceived = function onreceived(event) {
+manager.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 +132,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 = sms.getMessages(filter, false);
+  let cursor = manager.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 +154,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("sms.getMessages error: " + event.target.error.name);
+    log("manager.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function cleanUp() {
-  sms.onreceived = null;
+  manager.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,19 @@
 MARIONETTE_TIMEOUT = 60000;
 
 const SELF = 5554;
 const NUM_THREADS = 10;
 
 SpecialPowers.addPermission("sms", true, document);
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
 
-let sms = window.navigator.mozSms;
-ok(sms instanceof MozSmsManager);
+let manager = window.navigator.mozMobileMessage;
+ok(manager instanceof MozMobileMessageManager,
+   "manager is instance of " + manager.constructor);
 
 let pendingEmulatorCmdCount = 0;
 function sendSmsToEmulator(from, text) {
   ++pendingEmulatorCmdCount;
 
   let cmd = "sms send " + from + " " + text;
   runEmulatorCmd(cmd, function (result) {
     --pendingEmulatorCmdCount;
@@ -57,17 +58,17 @@ let tasks = {
   }
 };
 
 function getAllMessages(callback, filter, reverse) {
   if (!filter) {
     filter = new MozSmsFilter;
   }
   let messages = [];
-  let request = sms.getMessages(filter, reverse || false);
+  let request = manager.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 +79,17 @@ function deleteAllMessages(next) {
   getAllMessages(function deleteAll(messages) {
     let message = messages.shift();
     if (!message) {
       ok(true, "all messages deleted");
       tasks.next();
       return;
     }
 
-    let request = sms.delete(message.id);
+    let request = manager.delete(message.id);
     request.onsuccess = deleteAll.bind(null, messages);
     request.onerror = function (event) {
       ok(false, "failed to delete all messages");
       tasks.finish();
     }
   });
 }
 
@@ -119,41 +120,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 = sms.send("+1555531555" + iter, "Nice to meet you");
+    let request = manager.send("+1555531555" + iter, "Nice to meet you");
     request.onsuccess = function onRequestSuccess(event) {
-      sms.addEventListener("received", onReceived);
+      manager.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) {
-    sms.removeEventListener("received", onReceived);
+    manager.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 = sms.markMessageRead(event.message.id, true);
+      let request = manager.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,35 @@
 /* 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 sms = window.navigator.mozSms;
+let manager = window.navigator.mozMobileMessage;
 let numberMsgs = 10;
 let smsList = new Array();
 let defaultRemoteNumber = "+15552227777";
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(sms, "mozSms");
+  ok(manager instanceof MozMobileMessageManager,
+     "manager is instance of " + manager.constructor);
   // 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 = sms.getMessages(filter, false);
+  let cursor = manager.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 +44,97 @@ function deleteAllMsgs(nextFunction) {
         nextFunction();
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("sms.getMessages error: " + event.target.error.name);
+    log("manager.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 = sms.delete(smsId);
+  let request = manager.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,"sms.delete request returned false");
+      ok(false,"manager.delete request returned false");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "sms.delete request returned unexpected error: "
+    ok(false, "manager.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.");
 
-  sms.onsent = function(event) {
-    log("Received 'onsent' smsmanager event.");
+  manager.onsent = function(event) {
+    log("Received 'onsent' event.");
     gotSmsSent = true;
     log("Sent SMS (id: " + event.message.id + ").");
     if (gotSmsSent && gotRequestSuccess) {
       simulateIncomingSms();
     }
   };
 
-  let request = sms.send(remoteNumber, text);
+  let request = manager.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 sms.send");
+      log("smsrequest returned false for manager.send");
       ok(false,"SMS send failed");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "sms.send request returned unexpected error: "
+    ok(false, "manager.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 +147,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;
   });
 }
 
-sms.onreceived = function onreceived(event) {
+manager.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 +186,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 = sms.getMessages(filter, false);
+  let cursor = manager.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 +209,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 sms.getMessages");
+        ok(false, "Incorrect number of messages returned by manager.getMessages");
         deleteAllMsgs(cleanUp);
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("sms.getMessages error: " + event.target.error.name);
+    log("manager.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() {
-  sms.onreceived = null;
+  manager.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,35 @@
 /* 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 sms = window.navigator.mozSms;
+let manager = window.navigator.mozMobileMessage;
 let numberMsgs = 10;
 let smsList = new Array();
 let defaultRemoteNumber = "+15552227777";
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(sms, "mozSms");
+  ok(manager instanceof MozMobileMessageManager,
+     "manager is instance of " + manager.constructor);
   // 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 = sms.getMessages(filter, false);
+  let cursor = manager.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 +44,52 @@ function deleteAllMsgs(nextFunction) {
         nextFunction();
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("sms.getMessages error: " + event.target.error.name);
+    log("manager.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 = sms.delete(smsId);
+  let request = manager.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,"sms.delete request returned false");
+      ok(false,"manager.delete request returned false");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "sms.delete request returned unexpected error: "
+    ok(false, "manager.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 +102,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;
   });
 }
 
-sms.onreceived = function onreceived(event) {
+manager.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 +144,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 = sms.getMessages(filter, false);
+  let cursor = manager.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 +167,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 sms.getMessages");
+        ok(false, "Incorrect number of messages returned by manager.getMessages");
         deleteAllMsgs(cleanUp);
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("sms.getMessages error: " + event.target.error.name);
+    log("manager.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() {
-  sms.onreceived = null;
+  manager.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,33 @@
 /* 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 sms = window.navigator.mozSms;
+let manager = window.navigator.mozMobileMessage;
 let numberMsgs = 10;
 let smsList = new Array();
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(sms, "mozSms");
+  ok(manager instanceof MozMobileMessageManager,
+     "manager is instance of " + manager.constructor);
   // 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 = sms.getMessages(filter, false);
+  let cursor = manager.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 +42,51 @@ function deleteAllMsgs(nextFunction) {
         nextFunction();
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("sms.getMessages error: " + event.target.error.name);
+    log("manager.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 = sms.delete(smsId);
+  let request = manager.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,"sms.delete request returned false");
+      ok(false,"manager.delete request returned false");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "sms.delete request returned unexpected error: "
+    ok(false, "manager.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 +98,17 @@ function simulateIncomingSms() {
   rcvdEmulatorCallback = false;
   runEmulatorCmd("sms send " + remoteNumber + " " + text, function(result) {
     is(result[0], "OK", "emulator callback");
     rcvdEmulatorCallback = true;
   });
 }
 
 // Callback for incoming sms
-sms.onreceived = function onreceived(event) {
+manager.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 +126,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 = sms.markMessageRead(nextSms.id, true);
+  let request = manager.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,"sms.markMessageRead request returned false");
+      ok(false,"manager.markMessageRead request returned false");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "sms.markMessageRead request returned unexpected error: "
+    ok(false, "manager.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 = sms.getMessages(filter, false);
+  let cursor = manager.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 +187,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 sms.getMessages");
+        ok(false, "Incorrect number of messages returned by manager.getMessages");
         deleteAllMsgs(cleanUp);
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("sms.getMessages error: " + event.target.error.name);
+    log("manager.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() {
-  sms.onreceived = null;
+  manager.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,33 @@
 /* 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 sms = window.navigator.mozSms;
+let manager = window.navigator.mozMobileMessage;
 let numberMsgs = 10;
 let smsList = new Array();
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(sms, "mozSms");
+  ok(manager instanceof MozMobileMessageManager,
+     "manager is instance of " + manager.constructor);
   // 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 = sms.getMessages(filter, false);
+  let cursor = manager.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 +42,51 @@ function deleteAllMsgs(nextFunction) {
         nextFunction();
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("sms.getMessages error: " + event.target.error.name);
+    log("manager.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 = sms.delete(smsId);
+  let request = manager.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,"sms.delete request returned false");
+      ok(false,"manager.delete request returned false");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "sms.delete request returned unexpected error: "
+    ok(false, "manager.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 +98,17 @@ function simulateIncomingSms() {
   rcvdEmulatorCallback = false;
   runEmulatorCmd("sms send " + remoteNumber + " " + text, function(result) {
     is(result[0], "OK", "emulator callback");
     rcvdEmulatorCallback = true;
   });
 }
 
 // Callback for incoming sms
-sms.onreceived = function onreceived(event) {
+manager.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 +128,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.");
 
-  sms.onsent = function(event) {
-    log("Received 'onsent' smsmanager event.");
+  manager.onsent = function(event) {
+    log("Received 'onsent' 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 = sms.send(remoteNumber, text);
+  let request = manager.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 sms.send");
+      log("smsrequest returned false for manager.send");
       ok(false,"SMS send failed");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "sms.send request returned unexpected error: "
+    ok(false, "manager.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 = sms.getMessages(filter, false);
+  let cursor = manager.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 +199,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 sms.getMessages");
+        ok(false, "Incorrect number of messages returned by manager.getMessages");
         deleteAllMsgs(cleanUp);
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("sms.getMessages error: " + event.target.error.name);
+    log("manager.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() {
-  sms.onreceived = null;
+  manager.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,33 @@
 /* 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 sms = window.navigator.mozSms;
+let manager = window.navigator.mozMobileMessage;
 let numberMsgs = 10;
 let smsList = new Array();
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(sms, "mozSms");
+  ok(manager instanceof MozMobileMessageManager,
+     "manager is instance of " + manager.constructor);
   // 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 = sms.getMessages(filter, false);
+  let cursor = manager.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 +42,99 @@ function deleteAllMsgs(nextFunction) {
         nextFunction();
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("sms.getMessages error: " + event.target.error.name);
+    log("manager.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 = sms.delete(smsId);
+  let request = manager.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,"sms.delete request returned false");
+      ok(false,"manager.delete request returned false");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "sms.delete request returned unexpected error: "
+    ok(false, "manager.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) + ".");
 
-  sms.onsent = function(event) {
-    log("Received 'onsent' smsmanager event.");
+  manager.onsent = function(event) {
+    log("Received 'onsent' 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 = sms.send(remoteNumber, text);
+  let request = manager.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 sms.send");
+      log("smsrequest returned false for manager.send");
       ok(false,"SMS send failed");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "sms.send request returned unexpected error: "
+    ok(false, "manager.send request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 function nextRep() {
   if (smsList.length < (numberMsgs - 1)) {
     sendSms();
@@ -153,17 +154,17 @@ function simulateIncomingSms() {
   rcvdEmulatorCallback = false;
   runEmulatorCmd("sms send " + remoteNumber + " " + text, function(result) {
     is(result[0], "OK", "emulator callback");
     rcvdEmulatorCallback = true;
   });
 }
 
 // Callback for incoming sms
-sms.onreceived = function onreceived(event) {
+manager.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 +173,17 @@ sms.onreceived = function onreceived(eve
 function getMsgs() {
   var filter = new MozSmsFilter();
   let foundSmsList = new Array();
 
   // Set filter for sent messages
   filter.delivery = "sent";
 
   log("Getting the sent SMS messages.");
-  let cursor = sms.getMessages(filter, false);
+  let cursor = manager.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 +196,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 sms.getMessages");
+        ok(false, "Incorrect number of messages returned by manager.getMessages");
         deleteAllMsgs(cleanUp);
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("sms.getMessages error: " + event.target.error.name);
+    log("manager.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() {
-  sms.onreceived = null;
+  manager.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,33 @@
 /* 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 sms = window.navigator.mozSms;
+let manager = window.navigator.mozMobileMessage;
 let numberMsgs = 10;
 let smsList = new Array();
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(sms, "mozSms");
+  ok(manager instanceof MozMobileMessageManager,
+     "manager is instance of " + manager.constructor);
   // 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 = sms.getMessages(filter, false);
+  let cursor = manager.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 +42,51 @@ function deleteAllMsgs(nextFunction) {
         nextFunction();
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("sms.getMessages error: " + event.target.error.name);
+    log("manager.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 = sms.delete(smsId);
+  let request = manager.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,"sms.delete request returned false");
+      ok(false,"manager.delete request returned false");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "sms.delete request returned unexpected error: "
+    ok(false, "manager.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 +98,17 @@ function simulateIncomingSms() {
   rcvdEmulatorCallback = false;
   runEmulatorCmd("sms send " + remoteNumber + " " + text, function(result) {
     is(result[0], "OK", "emulator callback");
     rcvdEmulatorCallback = true;
   });
 }
 
 // Callback for incoming sms
-sms.onreceived = function onreceived(event) {
+manager.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 +123,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 = sms.markMessageRead(smsList[0].id, true);
+  let request = manager.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,"sms.markMessageRead request returned false");
+      ok(false,"manager.markMessageRead request returned false");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "sms.markMessageRead request returned unexpected error: "
+    ok(false, "manager.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 = sms.getMessages(filter, false);
+  let cursor = manager.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 +181,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 sms.getMessages");
+        ok(false, "Incorrect number of messages returned by manager.getMessages");
         deleteAllMsgs(cleanUp);
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("sms.getMessages error: " + event.target.error.name);
+    log("manager.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() {
-  sms.onreceived = null;
+  manager.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,40 @@ MARIONETTE_TIMEOUT = 60000;
 
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
 SpecialPowers.setBoolPref("dom.sms.requestStatusReport", true);
 SpecialPowers.addPermission("sms", true, document);
 
 const REMOTE = "5559997777"; // the remote number
 const EMULATOR = "15555215554"; // the emulator's number
 
-let sms = window.navigator.mozSms;
+let manager = window.navigator.mozMobileMessage;
 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(sms, "mozSms");
+  ok(manager instanceof MozMobileMessageManager,
+     "manager is instance of " + manager.constructor);
   simulateIncomingSms();  
 }
 
 function simulateIncomingSms() {
   log("Simulating incoming SMS.");
 
-  sms.onreceived = function onreceived(event) {
-    log("Received 'onreceived' smsmanager event.");
+  manager.onreceived = function onreceived(event) {
+    log("Received 'onreceived' 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 +55,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.");
-  sms.onsent = function(event) {
-    log("Received 'onsent' smsmanager event.");
+  manager.onsent = function(event) {
+    log("Received 'onsent' 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 +78,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 = sms.send(REMOTE, outText);
+  let requestRet = manager.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 sms.send");
+      log("smsrequest returned false for manager.send");
       ok(false,"SMS send failed");
       cleanUp();
     }
   };
 
   requestRet.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "sms.send request returned unexpected error: "
+    ok(false, "manager.send request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 function getReceivedSms() {
   log("Getting the received SMS message (id: " + inSmsId + ").");
 
-  let requestRet = sms.getMessage(inSmsId);
+  let requestRet = manager.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 +139,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 = sms.getMessage(outSmsId);
+  let requestRet = manager.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 +173,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 = sms.delete(inSmsId);
+  let requestRet = manager.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 = sms.delete(outSmsId);
+      let nextReqRet = manager.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 sms.delete");
+          log("smsrequest returned false for manager.delete");
           ok(false,"SMS delete failed");
         }
       };
     } else {
-      log("smsrequest returned false for sms.delete");
+      log("smsrequest returned false for manager.delete");
       ok(false,"SMS delete failed");
     }
   };
 
   requestRet.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "sms.delete request returned unexpected error: "
+    ok(false, "manager.delete request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 function cleanUp() {
-  sms.onreceived = null;
+  manager.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,34 @@
 /* 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 sms = window.navigator.mozSms;
+let manager = window.navigator.mozMobileMessage;
 let myNumber = "15555215554";
 let inText = "Incoming SMS message. Mozilla Firefox OS!";
 let remoteNumber = "5559997777";
 let inSmsId = 0;
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(sms, "mozSms");
+  ok(manager instanceof MozMobileMessageManager,
+     "manager is instance of " + manager.constructor);
   simulateIncomingSms();  
 }
 
 function simulateIncomingSms() {
   log("Simulating incoming SMS.");
 
-  sms.onreceived = function onreceived(event) {
-    log("Received 'onreceived' smsmanager event.");
+  manager.onreceived = function onreceived(event) {
+    log("Received 'onreceived' 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 +37,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 = sms.getMessage(msgIdNoExist);
+  let requestRet = manager.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 +61,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 = sms.getMessage(invalidId);
+  let requestRet = manager.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 +85,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 = sms.delete(inSmsId);
+  let requestRet = manager.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, "sms.delete request returned unexpected error: "
+    ok(false, "manager.delete request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 function cleanUp() {
-  sms.onreceived = null;
+  manager.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,37 @@
 /* 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 sms = window.navigator.mozSms;
+let manager = window.navigator.mozMobileMessage;
 let numberMsgs = 10;
 let smsList = new Array();
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(sms, "mozSms");
+  ok(manager instanceof MozMobileMessageManager,
+     "manager is instance of " + manager.constructor);
   // 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 = sms.getMessages(smsFilter, false);
+  let cursor = manager.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 +46,51 @@ function deleteAllMsgs(nextFunction) {
         nextFunction();
       }
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("sms.getMessages error: " + event.target.error.name);
+    log("manager.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 = sms.delete(smsId);
+  let request = manager.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,"sms.delete request returned false");
+      ok(false,"manager.delete request returned false");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "sms.delete request returned unexpected error: "
+    ok(false, "manager.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 +102,17 @@ function simulateIncomingSms() {
   rcvdEmulatorCallback = false;
   runEmulatorCmd("sms send " + remoteNumber + " " + text, function(result) {
     is(result[0], "OK", "emulator callback");
     rcvdEmulatorCallback = true;
   });
 }
 
 // Callback for incoming sms
-sms.onreceived = function onreceived(event) {
+manager.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 +138,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 = sms.getMessages(smsFilter, reverse);
+  let cursor = manager.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 +161,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 sms.getMessages");
+        ok(false, "Incorrect number of messages returned by manager.getMessages");
       }
       verifyFoundMsgs(foundSmsList, reverse);
     }
   };
 
   cursor.onerror = function(event) {
     log("Received 'onerror' event.");
     ok(event.target.error, "domerror obj");
-    log("sms.getMessages error: " + event.target.error.name);
+    log("manager.getMessages error: " + event.target.error.name);
     ok(false,"Could not get SMS messages");
     cleanUp();
   };
 }
 
 function verifyFoundMsgs(foundSmsList, reverse) {
   if (reverse) {
     smsList.reverse();
@@ -211,16 +212,16 @@ function verifyFoundMsgs(foundSmsList, r
     getMsgs(true);
   } else {
     // Finished, delete all messages
     deleteAllMsgs(cleanUp);
   };
 }
 
 function cleanUp() {
-  sms.onreceived = null;
+  manager.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,19 @@
 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 sms = window.navigator.mozSms;
-ok(sms instanceof MozSmsManager, "mozSmsManager");
+let manager = window.navigator.mozMobileMessage;
+ok(manager instanceof MozMobileMessageManager,
+   "manager is instance of " + manager.constructor);
 
 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 +44,31 @@ let tasks = {
   run: function run() {
     this.next();
   }
 };
 
 function addTest(text, segments, charsPerSegment, charsAvailableInLastSegment) {
   tasks.push(function () {
     log("Testing '" + text + "' ...");
-    let info = sms.getSegmentInfoForText(text);
+    let info = manager.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 = sms.getSegmentInfoForText(text);
+      let info = manager.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,19 @@
 /* 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 sms = window.navigator.mozSms;
-ok(sms instanceof MozSmsManager);
+let manager = window.navigator.mozMobileMessage;
+ok(manager instanceof MozMobileMessageManager,
+   "manager is instance of " + manager.constructor);
 
 let pendingEmulatorCmdCount = 0;
 function sendSmsToEmulator(from, text, callback) {
   ++pendingEmulatorCmdCount;
 
   let cmd = "sms send " + from + " " + text;
   runEmulatorCmd(cmd, function (result) {
     --pendingEmulatorCmdCount;
@@ -54,17 +55,17 @@ let tasks = {
   }
 };
 
 function getAllMessages(callback, filter, reverse) {
   if (!filter) {
     filter = new MozSmsFilter;
   }
   let messages = [];
-  let request = sms.getMessages(filter, reverse || false);
+  let request = manager.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 +76,50 @@ function deleteAllMessages() {
   getAllMessages(function deleteAll(messages) {
     let message = messages.shift();
     if (!message) {
       ok(true, "all messages deleted");
       tasks.next();
       return;
     }
 
-    let request = sms.delete(message.id);
+    let request = manager.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) {
-  sms.onsent = function () {
-    sms.onsent = null;
+  manager.onsent = function () {
+    manager.onsent = null;
     tasks.next();
   };
-  let request = sms.send(to, body);
+  let request = manager.send(to, body);
   request.onerror = tasks.finish.bind(tasks);
 }
 
 function receiveMessage(from, body) {
-  sms.onreceived = function () {
-    sms.onreceived = null;
+  manager.onreceived = function () {
+    manager.onreceived = null;
     tasks.next();
   };
   sendSmsToEmulator(from, body, function (success) {
     if (!success) {
       tasks.finish();
     }
   });
 }
 
 function getAllThreads(callback) {
   let threads = [];
 
-  let cursor = sms.getThreads();
+  let cursor = manager.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,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 sms = window.navigator.mozSms;
+let manager = window.navigator.mozMobileMessage;
+ok(manager instanceof MozMobileMessageManager,
+   "manager is instance of " + manager.constructor);
+
 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;
 });
 
-sms.onreceived = function onreceived(event) {
+manager.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,31 @@
 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 sms = window.navigator.mozSms;
+let manager = window.navigator.mozMobileMessage;
 let msgText = "Mozilla Firefox OS!";
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(sms, "mozSms");
+  ok(manager instanceof MozMobileMessageManager,
+     "manager is instance of " + manager.constructor);
   simulateIncomingSms();  
 }
 
 function simulateIncomingSms() {
   log("Simulating incoming SMS.");
 
-  sms.onreceived = function onreceived(event) {
-    log("Received 'onreceived' smsmanager event.");
+  manager.onreceived = function onreceived(event) {
+    log("Received 'onreceived' 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 +42,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 = sms.getMessage(incomingSms.id);
+  let requestRet = manager.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 +74,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 = sms.delete(smsMsgObj);
+  let requestRet = manager.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 sms.delete");
+      log("smsrequest returned false for manager.delete");
       ok(false,"SMS delete failed");
       cleanUp();
     }
   };
 
   requestRet.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "sms.delete request returned unexpected error: "
+    ok(false, "manager.delete request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 function verifySmsDeleted(smsId) {
   log("Getting SMS (id: " + smsId + ").");
-  let requestRet = sms.getMessage(smsId);
+  let requestRet = manager.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 +123,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() {
-  sms.onreceived = null;
+  manager.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,42 @@
 /* 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 sms = window.navigator.mozSms;
+let manager = window.navigator.mozMobileMessage;
 // 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(sms, "mozSms");
+  ok(manager instanceof MozMobileMessageManager,
+     "manager is instance of " + manager.constructor);
   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).");
 
-  sms.onreceived = function onreceived(event) {
-    sms.onreceived = null;
-    log("Received 'onreceived' smsmanager event.");
+  manager.onreceived = function onreceived(event) {
+    manager.onreceived = null;
+    log("Received 'onreceived' 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 +50,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 = sms.getMessage(incomingSms.id);
+  let requestRet = manager.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 +76,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 = sms.delete(smsMsgObj);
+  let requestRet = manager.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 sms.delete");
+      log("smsrequest returned false for manager.delete");
       ok(false, "SMS delete failed");
       cleanUp();
     }
   };
 
   requestRet.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "sms.delete request returned unexpected error: " +
+    ok(false, "manager.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,37 @@
 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 sms = window.navigator.mozSms;
+let manager = window.navigator.mozMobileMessage;
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(sms, "mozSms");
+  ok(manager instanceof MozMobileMessageManager,
+     "manager is instance of " + manager.constructor);
   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 ';
   }
 
-  sms.onreceived = function onreceived(event) {
-    log("Received 'onreceived' smsmanager event.");
+  manager.onreceived = function onreceived(event) {
+    log("Received 'onreceived' 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 +46,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 = sms.getMessage(incomingSms.id);
+  let requestRet = manager.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 +76,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 = sms.delete(smsMsgObj);
+  let requestRet = manager.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 sms.delete");
+      log("smsrequest returned false for manager.delete");
       ok(false,"SMS delete failed");
       cleanUp();
     }
   };
 
   requestRet.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "sms.delete request returned unexpected error: "
+    ok(false, "manager.delete request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 function cleanUp() {
-  sms.onreceived = null;
+  manager.onreceived = null;
   SpecialPowers.removePermission("sms", document);
   SpecialPowers.clearUserPref("dom.sms.enabled");
   finish();
 }
 
 // Start the test
 verifyInitialState();
--- a/dom/mobilemessage/tests/marionette/test_invalid_address.js
+++ b/dom/mobilemessage/tests/marionette/test_invalid_address.js
@@ -36,24 +36,24 @@ let tasks = {
     this._tasks[this._tasks.length - 1]();
   },
 
   run: function run() {
     this.next();
   }
 };
 
-let mozMobileMessage;
+let manager;
 
 function getAllMessages(callback, filter, reverse) {
   if (!filter) {
     filter = new MozSmsFilter;
   }
   let messages = [];
-  let request = mozMobileMessage.getMessages(filter, reverse || false);
+  let request = manager.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);
@@ -64,45 +64,45 @@ function deleteAllMessages() {
   getAllMessages(function deleteAll(messages) {
     let message = messages.shift();
     if (!message) {
       ok(true, "all messages deleted");
       tasks.next();
       return;
     }
 
-    let request = mozMobileMessage.delete(message.id);
+    let request = manager.delete(message.id);
     request.onsuccess = deleteAll.bind(null, messages);
     request.onerror = function (event) {
       ok(false, "failed to delete all messages");
       tasks.finish();
     }
   });
 }
 
 function testInvalidAddressForSMS(aInvalidAddr)  {
-  log("mozMobileMessage.send(...) should get 'InvalidAddressError' error " +
+  log("manager.send(...) should get 'InvalidAddressError' error " +
       "when attempting to send SMS to: " + aInvalidAddr);
 
-  let request = mozMobileMessage.send(aInvalidAddr, "Test");
+  let request = manager.send(aInvalidAddr, "Test");
 
   request.onerror = function(event) {
     log("Received 'onerror' DOMRequest event.");
     let error = event.target.error;
     ok(error instanceof DOMError, "should be a valid DOMError object");
     ok(error.name === "InvalidAddressError", "should be 'InvalidAddressError'");
     tasks.next();
   };
 }
 
 function testInvalidAddressForMMS(aInvalidAddrs)  {
-  log("mozMobileMessage.sendMMS(...) should get 'InvalidAddressError' error " +
+  log("manager.sendMMS(...) should get 'InvalidAddressError' error " +
       "when attempting to send MMS to: " + aInvalidAddrs);
 
-  let request = mozMobileMessage.sendMMS({
+  let request = manager.sendMMS({
     subject: "Test",
     receivers: aInvalidAddrs,
     attachments: [],
   });
 
   request.onerror = function(event) {
     log("Received 'onerror' DOMRequest event.");
     let error = event.target.error;
@@ -110,18 +110,19 @@ function testInvalidAddressForMMS(aInval
     ok(error.name === "InvalidAddressError", "should be 'InvalidAddressError'");
     tasks.next();
   };
 }
 
 tasks.push(function () {
   log("Verifying initial state.");
 
-  mozMobileMessage = window.navigator.mozMobileMessage;
-  ok(mozMobileMessage instanceof MozMobileMessageManager);
+  manager = window.navigator.mozMobileMessage;
+  ok(manager instanceof MozMobileMessageManager,
+     "manager is instance of " + manager.constructor);
 
   tasks.next();
 });
 
 // Test sending SMS to invalid addresses.
 tasks.push(testInvalidAddressForSMS.bind(this, "&%&"));
 tasks.push(testInvalidAddressForSMS.bind(this, ""));
 
--- a/dom/mobilemessage/tests/marionette/test_mark_msg_read.js
+++ b/dom/mobilemessage/tests/marionette/test_mark_msg_read.js
@@ -1,22 +1,23 @@
 /* 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 sms = window.navigator.mozSms;
+let manager = window.navigator.mozMobileMessage;
 let smsList = new Array();
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(sms, "mozSms");
+  ok(manager instanceof MozMobileMessageManager,
+     "manager is instance of " + manager.constructor);
   simulateIncomingSms();
 }
 
 function simulateIncomingSms() {
   let text = "Incoming SMS courtesy of Firefox OS";
   let remoteNumber = "5557779999";
 
   log("Simulating incoming SMS.");
@@ -25,17 +26,17 @@ function simulateIncomingSms() {
   rcvdEmulatorCallback = false;
   runEmulatorCmd("sms send " + remoteNumber + " " + text, function(result) {
     is(result[0], "OK", "emulator callback");
     rcvdEmulatorCallback = true;
   });
 }
 
 // Callback for incoming SMS
-sms.onreceived = function onreceived(event) {
+manager.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 +50,71 @@ sms.onreceived = function onreceived(eve
 function sendSms() {
   let gotSmsSent = false;
   let gotRequestSuccess = false;
   let remoteNumber = "5557779999";
   let text = "Mo Mo Mo Zilla Zilla Zilla!";
 
   log("Sending an SMS.");
 
-  sms.onsent = function(event) {
-    log("Received 'onsent' smsmanager event.");
+  manager.onsent = function(event) {
+    log("Received 'onsent' 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 = sms.send(remoteNumber, text);
+  let request = manager.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 sms.send");
+      log("smsrequest returned false for manager.send");
       ok(false, "SMS send failed");
       deleteMsgs();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "sms.send request returned unexpected error: "
+    ok(false, "manager.send request returned unexpected error: "
         + event.target.error.name );
     deleteMsgs();
   };
 }
 
 function markMessageAndVerify(smsId, readBool, nextFunction) {
-  let request = sms.markMessageRead(smsId, readBool);
+  let request = manager.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 = sms.getMessage(smsId);
+    let requestRet = manager.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 +137,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, "sms.markMessageRead request returned unexpected error: "
+    ok(false, "manager.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 +183,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 = sms.delete(smsId);
+  let request = manager.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, "sms.delete request returned false");
+      ok(false, "manager.delete request returned false");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "sms.delete request returned unexpected error: "
+    ok(false, "manager.delete request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 function cleanUp() {
-  sms.onreceived = null;
+  manager.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,23 @@
 /* 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 sms = window.navigator.mozSms;
+let manager = window.navigator.mozMobileMessage;
 let smsId;
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(sms, "mozSms");
+  ok(manager instanceof MozMobileMessageManager,
+     "manager is instance of " + manager.constructor);
   simulateIncomingSms();
 }
 
 function simulateIncomingSms() {
   let text = "Incoming SMS courtesy of Firefox OS";
   let remoteNumber = "5557779999";
 
   log("Simulating incoming SMS.");
@@ -25,31 +26,31 @@ function simulateIncomingSms() {
   rcvdEmulatorCallback = false;
   runEmulatorCmd("sms send " + remoteNumber + " " + text, function(result) {
     is(result[0], "OK", "emulator callback");
     rcvdEmulatorCallback = true;
   });
 }
 
 // Callback for incoming SMS
-sms.onreceived = function onreceived(event) {
+manager.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 = sms.markMessageRead(invalidId, readBool);
+  let requestRet = manager.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 +75,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 = sms.delete(smsId);
+  let request = manager.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,"sms.delete request returned false");
+      ok(false,"manager.delete request returned false");
       cleanUp();
     }
   };
 
   request.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "sms.delete request returned unexpected error: "
+    ok(false, "manager.delete request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 function cleanUp() {
-  sms.onreceived = null;
+  manager.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 sms = window.navigator.mozMobileMessage;
+let manager = 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 = sms.getMessage(incomingSms.id);
+  let requestRet = manager.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 = sms.getMessage(smsId);
+  let requestRet = manager.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,22 @@ 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(sms, "mozSms");
+  ok(manager instanceof MozMobileMessageManager,
+     "manager is instance of " + manager.constructor);
 
   // Callback for incoming sms
-  sms.onreceived = function onreceived(event) {
-    log("Received 'onreceived' smsmanager event.");
+  manager.onreceived = function onreceived(event) {
+    log("Received 'onreceived' 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 +164,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 = sms.delete(SmsList);
+  let requestRet = manager.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 sms.delete");
+      log("smsrequest returned false for manager.delete");
       ok(false, "SMS delete failed");
     }
   };
 
   requestRet.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "sms.delete request returned unexpected error: "
+    ok(false, "manager.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;
   }
 
-  sms.onreceived = null;
+  manager.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,19 @@ 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 sms = window.navigator.mozSms;
-ok(sms instanceof MozSmsManager);
+let manager = window.navigator.mozMobileMessage;
+ok(manager instanceof MozMobileMessageManager,
+   "manager is instance of " + manager.constructor);
 
 let pendingEmulatorCmdCount = 0;
 function sendSmsPduToEmulator(pdu) {
   ++pendingEmulatorCmdCount;
 
   let cmd = "sms pdu " + pdu;
   runEmulatorCmd(cmd, function (result) {
     --pendingEmulatorCmdCount;
@@ -56,28 +57,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) {
-    sms.addEventListener("received", function onReceived(event) {
-      sms.removeEventListener("received", onReceived);
+    manager.addEventListener("received", function onReceived(event) {
+      manager.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 = sms.getMessages(null, false);
+      let cursor = manager.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 +105,18 @@ function test_message_class_0() {
   }
 
   log("Checking Message Class 0");
   do_test(0);
 }
 
 function doTestMessageClassGeneric(allDCSs, messageClass, next) {
   function do_test(dcsIndex) {
-    sms.addEventListener("received", function onReceived(event) {
-      sms.removeEventListener("received", onReceived);
+    manager.addEventListener("received", function onReceived(event) {
+      manager.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 +183,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() {
-        sms.removeEventListener("received", onReceived);
+        manager.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);
         }
       }
 
-      sms.addEventListener("received", onReceived);
+      manager.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_mmsmessage_attachments.js
+++ b/dom/mobilemessage/tests/marionette/test_mmsmessage_attachments.js
@@ -36,24 +36,24 @@ let tasks = {
     this._tasks[this._tasks.length - 1]();
   },
 
   run: function run() {
     this.next();
   }
 };
 
-let mozMobileMessage;
+let manager;
 
 function getAllMessages(callback, filter, reverse) {
   if (!filter) {
     filter = new MozSmsFilter;
   }
   let messages = [];
-  let request = mozMobileMessage.getMessages(filter, reverse || false);
+  let request = manager.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);
@@ -64,50 +64,51 @@ function deleteAllMessages() {
   getAllMessages(function deleteAll(messages) {
     let message = messages.shift();
     if (!message) {
       ok(true, "all messages deleted");
       tasks.next();
       return;
     }
 
-    let request = mozMobileMessage.delete(message.id);
+    let request = manager.delete(message.id);
     request.onsuccess = deleteAll.bind(null, messages);
     request.onerror = function (event) {
       ok(false, "failed to delete all messages");
       tasks.finish();
     }
   });
 }
 
 tasks.push(function () {
   log("Verifying initial state.");
 
-  mozMobileMessage = window.navigator.mozMobileMessage;
-  ok(mozMobileMessage instanceof MozMobileMessageManager);
+  manager = window.navigator.mozMobileMessage;
+  ok(manager instanceof MozMobileMessageManager,
+     "manager is instance of " + manager.constructor);
 
   tasks.next();
 });
 
 tasks.push(function () {
   log("MmsMessage.attachments should be an empty array.");
 
-  mozMobileMessage.onfailed = function (event) {
-    mozMobileMessage.onfailed = null;
+  manager.onfailed = function (event) {
+    manager.onfailed = null;
 
     let message = event.message;
     ok(Array.isArray(message.attachments) && message.attachments.length === 0,
        "message.attachments should be an empty array.");
 
     tasks.next();
   };
 
   // Have a long long subject causes the send fails, so we don't need
   // networking here.
-  mozMobileMessage.sendMMS({
+  manager.sendMMS({
     subject: new Array(MMS_MAX_LENGTH_SUBJECT + 2).join("a"),
     receivers: ["1", "2"],
     attachments: [],
   });
 });
 
 tasks.push(deleteAllMessages);
 
--- a/dom/mobilemessage/tests/marionette/test_outgoing.js
+++ b/dom/mobilemessage/tests/marionette/test_outgoing.js
@@ -5,17 +5,20 @@ MARIONETTE_TIMEOUT = 60000;
 
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
 SpecialPowers.setBoolPref("dom.sms.strict7BitEncoding", false);
 SpecialPowers.setBoolPref("dom.sms.requestStatusReport", true);
 SpecialPowers.addPermission("sms", true, document);
 
 const SENDER = "15555215554"; // the emulator's number
 
-let sms = window.navigator.mozSms;
+let manager = window.navigator.mozMobileMessage;
+ok(manager instanceof MozMobileMessageManager,
+   "manager is instance of " + manager.constructor);
+
 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 +57,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;
       }
     }
 
-    sms.removeEventListener("sending", onSmsSending);
-    sms.removeEventListener("sent", onSmsSent);
+    manager.removeEventListener("sending", onSmsSending);
+    manager.removeEventListener("sent", onSmsSent);
 
     log("Done!");
     window.setTimeout(callback, 0);
   }
 
   function checkSentMessage(message, mark) {
     checkMessage(message, "sent", body);
 
@@ -99,17 +102,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("SmsManager.onsending event received.");
+    log("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 +133,30 @@ function doSendMessageAndCheckSuccess(re
     options[receiver] = {
       saved: message,
       onSentCalled: false,
       onRequestSuccessCalled: false
     };
   }
 
   function onSmsSent(event) {
-    log("SmsManager.onsent event received.");
+    log("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");
   }
 
-  sms.addEventListener("sending", onSmsSending);
-  sms.addEventListener("sent", onSmsSent);
+  manager.addEventListener("sending", onSmsSending);
+  manager.addEventListener("sent", onSmsSent);
 
-  let result = sms.send(receivers, body);
+  let result = manager.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 +176,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 nsIDOMSmsManager.ondelivered event
+  // TODO: bug 788928 - add test cases for 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,34 @@ MARIONETTE_TIMEOUT = 60000;
 
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
 SpecialPowers.setBoolPref("dom.sms.requestStatusReport", true);
 SpecialPowers.addPermission("sms", true, document);
 
 const SENDER = "15555215554"; // the emulator's number
 const RECEIVER = "5551117777"; // the destination number
 
-let sms = window.navigator.mozSms;
+let manager = window.navigator.mozMobileMessage;
 let msgText = "Mozilla Firefox OS!";
 let gotSmsOnsent = false;
 let gotReqOnsuccess = false;
 
 function verifyInitialState() {
   log("Verifying initial state.");
-  ok(sms, "mozSms");
+  ok(manager instanceof MozMobileMessageManager,
+     "manager is instance of " + manager.constructor);
   sendSms();
 }
 
 function sendSms() {
   let smsId = 0;
 
   log("Sending an SMS.");
-  sms.onsent = function(event) {
-    log("Received 'onsent' smsmanager event.");
+  manager.onsent = function(event) {
+    log("Received 'onsent' 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 +42,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 = sms.send(RECEIVER, msgText);
+  let requestRet = manager.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 sms.send");
+      log("smsrequest returned false for manager.send");
       ok(false,"SMS send failed");
       cleanUp();
     }
   };
 
   requestRet.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "sms.send request returned unexpected error: "
+    ok(false, "manager.send request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 function verifySmsExists(smsId) {
   log("Getting SMS (id: " + smsId + ").");
-  let requestRet = sms.getMessage(smsId);
+  let requestRet = manager.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 +98,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 = sms.delete(smsId);
+  let requestRet = manager.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 sms.delete");
+      log("smsrequest returned false for manager.delete");
       ok(false,"SMS delete failed");
       cleanUp();
     }
   };
 
   requestRet.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "sms.delete request returned unexpected error: "
+    ok(false, "manager.delete request returned unexpected error: "
         + event.target.error.name );
     cleanUp();
   };
 }
 
 function verifySmsDeleted(smsId) {
   log("Getting SMS (id: " + smsId + ").");
-  let requestRet = sms.getMessage(smsId);
+  let requestRet = manager.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 +147,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() {
-  sms.onsent = null;
+  manager.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,83 @@
 /* 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 sms = window.navigator.mozSms;
+let manager = window.navigator.mozMobileMessage;
 // 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(sms, "mozSms");
+  ok(manager instanceof MozMobileMessageManager,
+     "manager is instance of " + manager.constructor);
   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).");
 
-  sms.onsent = function(event) {
-    sms.onsent = null;
-    log("Received 'onsent' smsmanager event.");
+  manager.onsent = function(event) {
+    manager.onsent = null;
+    log("Received 'onsent' 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 = sms.send(destNumber, msgText);
+  let requestRet = manager.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 sms.send");
+      log("smsrequest returned false for manager.send");
       ok(false, "SMS send failed");
       cleanUp();
     }
   };
 
   requestRet.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "sms.send request returned unexpected error: " +
+    ok(false, "manager.send request returned unexpected error: " +
               event.target.error.name);
     cleanUp();
   };
 }
 
 function verifySmsExists(sentSms) {
   log("Getting SMS (id: " + sentSms.id + ").");
-  let requestRet = sms.getMessage(sentSms.id);
+  let requestRet = manager.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 +94,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 = sms.delete(smsMsgObj);
+  let requestRet = manager.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 sms.delete");
+      log("smsrequest returned false for manager.delete");
       ok(false, "SMS delete failed");
       cleanUp();
     }
   };
 
   requestRet.onerror = function(event) {
     log("Received 'onerror' smsrequest event.");
     ok(event.target.error, "domerror obj");
-    ok(false, "sms.delete request returned unexpected error: " +
+    ok(false, "manager.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 = mozSms.getMessages(filter, reverse || false);
+  let request = manager.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,52 @@ function deleteAllMessages() {
   getAllMessages(function deleteAll(messages) {
     let message = messages.shift();
     if (!message) {
       ok(true, "all messages deleted");
       tasks.next();
       return;
     }
 
-    let request = mozSms.delete(message.id);
+    let request = manager.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 = mozSms.send(number, "ping");
+  let sendRequest = manager.send(number, "ping");
   sendRequest.onsuccess = function onSendSuccess(event) {
     let sentMessage = event.target.result;
 
-    mozSms.onreceived = function onreceived(event) {
+    manager.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 mozSms = window.navigator.mozSms;
+let manager = window.navigator.mozMobileMessage;
 tasks.push(function () {
-  log("Checking mozSms.");
-  ok(mozSms instanceof MozSmsManager);
+  log("Verifying initial state.");
+  ok(manager instanceof MozMobileMessageManager,
+     "manager is instance of " + manager.constructor);
   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,31 @@ 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 sms = window.navigator.mozSms;
-ok(sms instanceof MozSmsManager);
+let manager = window.navigator.mozMobileMessage;
+ok(manager instanceof MozMobileMessageManager,
+   "manager is instance of " + manager.constructor);
 
 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 = sms.getSegmentInfoForText(text);
+  let result = manager.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,19 @@ 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 sms = window.navigator.mozSms;
-ok(sms instanceof MozSmsManager);
+let manager = window.navigator.mozMobileMessage;
+ok(manager instanceof MozMobileMessageManager,
+   "manager is instance of " + manager.constructor);
 
 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 +174,26 @@ function testStrict7BitEncodingHelper(se
   let count = 0;
   function done(step) {
     count += step;
     if (count >= 2) {
       window.setTimeout(tasks.next.bind(tasks), 0);
     }
   }
 
-  sms.addEventListener("received", function onReceived(event) {
+  manager.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 = sms.send(SELF, sent);
+  let request = manager.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,19 @@ MARIONETTE_TIMEOUT = 60000;
 
 const FROM = "09123456789";
 const PREFIX = "msg_";
 const MSGS = 3;
 
 SpecialPowers.addPermission("sms", true, document);
 SpecialPowers.setBoolPref("dom.sms.enabled", true);
 
-let mozSms = window.navigator.mozSms;
-ok(mozSms instanceof MozSmsManager);
+let manager = window.navigator.mozMobileMessage;
+ok(manager instanceof MozMobileMessageManager,
+   "manager is instance of " + manager.constructor);
 
 let pendingEmulatorCmdCount = 0;
 function sendSmsToEmulator(from, text) {
   ++pendingEmulatorCmdCount;
 
   let cmd = "sms send " + from + " " + text;
   runEmulatorCmd(cmd, function (result) {
     --pendingEmulatorCmdCount;
@@ -58,31 +59,31 @@ let tasks = {
   }
 };
 
 function getAllMessages(callback, filter, reverse) {
   if (!filter) {
     filter = new MozSmsFilter;
   }
   let messages = [];
-  let cursor = mozSms.getMessages(filter, reverse || false);
+  let cursor = manager.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 = mozSms.getThreads();
+  let cursor = manager.getThreads();
   cursor.onsuccess = function(event) {
     if (!this.done) {
       threads.push(this.result);
       this.continue();
       return;
     }
 
     window.setTimeout(callback.bind(null, threads), 0);
@@ -93,17 +94,17 @@ function deleteAllMessages() {
   getAllMessages(function deleteAll(messages) {
     let message = messages.shift();
     if (!message) {
       ok(true, "all messages deleted");
       tasks.next();
       return;
     }
 
-    let request = mozSms.delete(message.id);
+    let request = manager.delete(message.id);
     request.onsuccess = deleteAll.bind(null, messages);
     request.onerror = function (event) {
       ok(false, "failed to delete all messages");
       tasks.finish();
     }
   });
 }
 
@@ -120,17 +121,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 () {
-  mozSms.onreceived = function () {
+  manager.onreceived = function () {
     ++gotMessagesCount;
   };
   tasks.next();
 });
 
 tasks.push(function () {
   for (let i = 1; i <= MSGS; i++) {
     sendSmsToEmulator(FROM, PREFIX + i);
@@ -164,17 +165,17 @@ tasks.push(getAllThreads.bind(null, func
               lastMessage.body,
               allMessages.length,
               lastMessage.timestamp);
 
   tasks.next();
 }));
 
 tasks.push(function DeleteFirstMessage() {
-  let request = mozSms.delete(allMessages[0].id);
+  let request = manager.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 +185,17 @@ tasks.push(function DeleteFirstMessage()
                   lastMessage.timestamp);
 
       tasks.next();
     });
   };
 });
 
 tasks.push(function DeleteLastMessage() {
-  let request = mozSms.delete(allMessages[allMessages.length - 1].id);
+  let request = manager.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 +218,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;
   }
 
-  mozSms.onreceived = null;
+  manager.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(!('mozSms' in frames[0].navigator), "navigator.mozSms should not exist");
-  ok(frames[0].navigator.mozSms === undefined,
-     "navigator.mozSms should return undefined");
+  ok(!('mozMobileMessage' in frames[0].navigator), "navigator.mozMobileMessage should not exist");
+  ok(frames[0].navigator.mozMobileMessage === undefined,
+     "navigator.mozMobileMessage 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('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");
+  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");
 }
 
 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: "mozSms",
-    idl: "nsIDOMMozSmsManager",
+    obj: "mozMobileMessage",
+    idl: "nsIDOMMozMobileMessageManager",
     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,17 +265,16 @@ 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,23 +220,16 @@ 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
--- a/testing/mochitest/b2g.json
+++ b/testing/mochitest/b2g.json
@@ -4,17 +4,81 @@
     "content": "",
     "docshell": "",
     "dom": "",
     "layout": ""
   },
 "excludetests": {
     "content/xbl/":"",
     "content/xul":"",
-    "content/media/":"",
+
+    "content/media/test/test_bug448534.html": "",
+    "content/media/test/test_bug495300.html":"",
+    "content/media/test/test_bug495300.html":"",
+    "content/media/test/test_bug463162.xhtml":"",
+    "content/media/test/test_bug495145.html": "timed out",
+    "content/media/test/test_bug686942.html": "timed out",
+    "content/media/test/test_bug686137.html": "TIMED_OUT",
+    "content/media/test/test_can_play_type.html":"timed out",
+    "content/media/test/test_chaining.html": "timed out",
+    "content/media/test/test_contentDuration1.html": "TIMED_OUT",
+    "content/media/test/test_contentDuration2.html": "TIMED_OUT",
+    "content/media/test/test_contentDuration3.html": "TIMED_OUT",
+    "content/media/test/test_contentDuration4.html": "TIMED_OUT",
+    "content/media/test/test_contentDuration5.html": "TIMED_OUT",
+    "content/media/test/test_contentDuration6.html": "TIMED_OUT",
+    "content/media/test/test_contentDuration7.html": "timed out",
+    "content/media/test/test_decoder_disable.html":"timed out",
+    "content/media/test/test_error_on_404.html": "timed out",
+    "content/media/test/test_fragment_noplay.html": "timed out",
+    "content/media/test/test_fragment_play.html": "",
+    "content/media/test/test_load.html": "Timed out after gizmo.mp4",
+    "content/media/test/test_load_candidates.html": "timed out",
+    "content/media/test/test_load_same_resource.html": "",
+    "content/media/test/test_media_selection.html": "",
+    "content/media/test/test_metadata.html": "",
+    "content/media/test/test_mozHasAudio.html": "",
+    "content/media/test/test_playback_rate_playpause.html": "",
+    "content/media/test/test_reactivate.html": "timed out in small-shot.mp3",
+    "content/media/test/test_referer.html":"",
+    "content/media/test/test_replay_metadata.html": "",
+    "content/media/test/test_seekable1.html": "",
+    "content/media/test/test_seek_out_of_range.html": "",
+    "content/media/test/test_seekLies.html": "",
+    "content/media/test/test_wave_data_s16.html": "",
+    "content/media/test/test_source.html": "",
+    "content/media/test/test_source_media.html": "",
+    "content/media/test/test_wave_data_u8.html": "",
+
+    "content/media/mediasource/test/test_MediaSource.html": " ReferenceError: MediaSource is not defined",
+    "content/media/test/test_bug654550.html": "timed out",
+    "content/media/test/test_delay_load.html": "6 failures",
+    "content/media/test/test_info_leak.html": "2 failures",
+    "content/media/test/test_play_events.html": "Last event should be canplaythrough for gizmo.mp4 - got playing, expected canplaythrough",
+    "content/media/test/test_play_events_2.html": "Last event should be canplaythrough for gizmo.mp4 - got playing, expected canplaythrough",
+    "content/media/test/test_playback.html": "Test timed out",
+    "content/media/test/test_play_events.html": "Last event should be canplaythrough for gizmo.mp4 - got playing, expected canplaythrough",
+    "content/media/test/test_play_events_2.html": "Last event should be canplaythrough for gizmo.mp4 - got playing, expected canplaythrough",
+    "content/media/test/test_playback.html": "Test timed out",
+    "content/media/test/test_streams_gc.html": "Value being assigned to HTMLMediaElement.currentTime is not a finite floating-point value",
+    "content/media/webaudio/test/test_audioBufferSourceNodeNeutered.html": "Test timed out",
+    "content/media/webaudio/test/test_audioBufferSourceNodeNeutered.html": " Test timed out",
+    "content/media/webspeech/recognition/test/test_nested_eventloop.html": "NS_ERROR_NOT_AVAILABLE: [nsIDOMWindow.showModalDialog]",
+    "content/media/webspeech/synth/ipc/test/test_ipc.html": "comp.classes['@mozilla.org/special-powers-observer;1'] is undefined",
+    "content/media/webspeech/synth/test/test_speech_queue.html": "Test timed out",
+    "content/media/webspeech/synth/test/test_speech_simple.html": "Test timed out",
+    "content/media/test/test_framebuffer.html": "timed out",
+    "content/media/test/test_seekable2.html": "timed out",
+    "content/media/test/test_seekable3.html": "timed out",
+    "content/media/webspeech/recognition/test/test_recognition_service_error.html": "timed out",
+    "content/media/test/test_can_play_type_mpeg.html":"7 failures out of 27",
+    "content/media/test/test_unseekable.html":"",
+    "content/media/webaudio/test/test_audioBufferSourceNodeOffset.html":"",
+    "content/media/test/test_can_play_type_ogg.html":"",
+    "content/media/test/test_can_play_type_no_dash.html":"",
 
     "dom/imptests/editing/selecttest/test_addRange.html": "oom?, bug 775227",
     "dom/imptests/webapps/DOMCore/tests/approved/test_Range-insertNode.html":"oom?, bug 775227",
     "dom/imptests/webapps/DOMCore/tests/approved/test_Range-cloneContents.html":"",
     "dom/imptests/webapps/DOMCore/tests/approved/test_Range-compareBoundaryPoints.html":"times out, bug 862196",
     "dom/imptests/webapps/DOMCore/tests/approved/test_Range-deleteContents.html":"",
     "dom/imptests/webapps/DOMCore/tests/approved/test_Range-extractContents.html":"",
     "dom/imptests/webapps/DOMCore/tests/approved/test_Range-set.html":"",