merge b2g-inbound to mozilla-central a=merge
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 25 Jun 2014 15:38:40 +0200
changeset 211489 da1dbcff949386725515380a4f8e1818adabfd30
parent 211460 b7c5acd34f7bb331ee0d5c2379b2f4215c39803d (current diff)
parent 211488 198eea812ee4ff2ba03977e5a75907d765a40d08 (diff)
child 211499 56ebaa70ca72a266df2faca874255901582d89ba
child 211541 21331c695f14f9f4834a924e47442dd08f785dc1
child 211576 9d38560231602d8007e4669043ca2d92a6d45def
push id3857
push userraliiev@mozilla.com
push dateTue, 02 Sep 2014 16:39:23 +0000
treeherdermozilla-beta@5638b907b505 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
merge b2g-inbound to mozilla-central a=merge
dom/bindings/Bindings.conf
dom/mobilemessage/interfaces/nsIDOMMobileMessageManager.idl
dom/mobilemessage/tests/marionette/test_filter_date_notfound.js
dom/mobilemessage/tests/marionette/test_incoming_multipart.js
dom/tests/mochitest/general/test_interfaces.html
dom/webidl/MobileMessageManager.webidl
dom/webidl/moz.build
layout/tools/reftest/reftest.js
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -14,23 +14,23 @@
   <!--original fetch url was git://github.com/apitrace/-->
   <remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
   <default remote="caf" revision="refs/tags/android-4.0.4_r2.1" sync-j="4"/>
   <!-- Gonk specific things and forks -->
   <project name="platform_build" path="build" remote="b2g" revision="2a165bebfa19b11b697837409f9550dd2917c46c">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
-  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="57da30f405ba37a5d4844f32bb292271b81faee2"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="1bcd355855626640b2532f2ccb1f814711f7a6ad"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
   <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="3326b51017252e09ccdd715dec6c5e12a7d1ecfe"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="c510babaf88dfa2cfe2c202afb2649ee124569af"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="b5e21ed930860a0d43728b556b09e8dedd27fdeb"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="6f0e303999894aa657d3863dbaf00e4aa002b3ed"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
   <project name="platform/bionic" path="bionic" revision="c72b8f6359de7ed17c11ddc9dfdde3f615d188a9"/>
   <project name="platform/bootable/recovery" path="bootable/recovery" revision="425f8b5fadf5889834c5acd27d23c9e0b2129c28"/>
   <project name="device/common" path="device/common" revision="42b808b7e93d0619286ae8e59110b176b7732389"/>
   <project name="device/sample" path="device/sample" revision="237bd668d0f114d801a8d6455ef5e02cc3577587"/>
   <project name="platform_external_apriori" path="external/apriori" remote="b2g" revision="11816ad0406744f963537b23d68ed9c2afb412bd"/>
   <project name="platform/external/bluetooth/bluez" path="external/bluetooth/bluez" revision="52a1a862a8bac319652b8f82d9541ba40bfa45ce"/>
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -12,20 +12,20 @@
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="cc67f31dc638c0b7edba3cf7e3d87cadf0ed52bf">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="57da30f405ba37a5d4844f32bb292271b81faee2"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="1bcd355855626640b2532f2ccb1f814711f7a6ad"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="c510babaf88dfa2cfe2c202afb2649ee124569af"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="b5e21ed930860a0d43728b556b09e8dedd27fdeb"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="6f0e303999894aa657d3863dbaf00e4aa002b3ed"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.1" path="prebuilts/clang/linux-x86/3.1" revision="5c45f43419d5582949284eee9cef0c43d866e03b"/>
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.2" path="prebuilts/clang/linux-x86/3.2" revision="3748b4168e7bd8d46457d4b6786003bc6a5223ce"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="9025e50b9d29b3cabbbb21e1dd94d0d13121a17e"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="b89fda71fcd0fa0cf969310e75be3ea33e048b44"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" revision="2e7d5348f35575870b3c7e567a9a9f6d66f8d6c5"/>
@@ -123,14 +123,14 @@
   <project name="platform/system/security" path="system/security" revision="f48ff68fedbcdc12b570b7699745abb6e7574907"/>
   <project name="platform/system/vold" path="system/vold" revision="8de05d4a52b5a91e7336e6baa4592f945a6ddbea"/>
   <default remote="caf" revision="refs/tags/android-4.3_r2.1" sync-j="4"/>
   <!-- Emulator specific things -->
   <project name="android-development" path="development" remote="b2g" revision="dab55669da8f48b6e57df95d5af9f16b4a87b0b1"/>
   <project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="3a9a17613cc685aa232432566ad6cc607eab4ec1"/>
   <project name="device_generic_goldfish" path="device/generic/goldfish" remote="b2g" revision="0e31f35a2a77301e91baa8a237aa9e9fa4076084"/>
   <project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="7d33aaf740bbf6c7c6e9c34a92b371eda311b66b"/>
-  <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="346c7694b156a3933f3d87cbc077c657e2ce571f"/>
+  <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="bfbb47844a20625d9bb6c9212fa554d7808bd58e"/>
   <project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="0e56e450367cd802241b27164a2979188242b95f"/>
   <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="832f4acaf481a19031e479a40b03d9ce5370ddee"/>
   <project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="d0aa65b140a45016975ed0ecf35f280dd336e1d3"/>
   <project name="android-sdk" path="sdk" remote="b2g" revision="8b1365af38c9a653df97349ee53a3f5d64fd590a"/>
 </manifest>
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -10,25 +10,25 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="276ce45e78b09c4a4ee643646f691d22804754c1">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="57da30f405ba37a5d4844f32bb292271b81faee2"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="1bcd355855626640b2532f2ccb1f814711f7a6ad"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="c510babaf88dfa2cfe2c202afb2649ee124569af"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="b5e21ed930860a0d43728b556b09e8dedd27fdeb"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="6f0e303999894aa657d3863dbaf00e4aa002b3ed"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="f92a936f2aa97526d4593386754bdbf02db07a12"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="6e47ff2790f5656b5b074407829ceecf3e6188c4"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" revision="1950e4760fa14688b83cdbb5acaa1af9f82ef434"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" revision="ac6eb97a37035c09fb5ede0852f0881e9aadf9ad"/>
   <project groups="linux,x86" name="platform/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" path="prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" revision="737f591c5f95477148d26602c7be56cbea0cdeb9"/>
   <project groups="linux,x86" name="platform/prebuilts/python/linux-x86/2.7.5" path="prebuilts/python/linux-x86/2.7.5" revision="51da9b1981be481b92a59a826d4d78dc73d0989a"/>
   <project name="device/common" path="device/common" revision="798a3664597e6041985feab9aef42e98d458bc3d"/>
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -14,23 +14,23 @@
   <!--original fetch url was git://github.com/apitrace/-->
   <remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
   <default remote="caf" revision="refs/tags/android-4.0.4_r2.1" sync-j="4"/>
   <!-- Gonk specific things and forks -->
   <project name="platform_build" path="build" remote="b2g" revision="2a165bebfa19b11b697837409f9550dd2917c46c">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
-  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="57da30f405ba37a5d4844f32bb292271b81faee2"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="1bcd355855626640b2532f2ccb1f814711f7a6ad"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
   <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="3326b51017252e09ccdd715dec6c5e12a7d1ecfe"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="c510babaf88dfa2cfe2c202afb2649ee124569af"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="b5e21ed930860a0d43728b556b09e8dedd27fdeb"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="6f0e303999894aa657d3863dbaf00e4aa002b3ed"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
   <project name="platform/bionic" path="bionic" revision="c72b8f6359de7ed17c11ddc9dfdde3f615d188a9"/>
   <project name="platform/bootable/recovery" path="bootable/recovery" revision="425f8b5fadf5889834c5acd27d23c9e0b2129c28"/>
   <project name="device/common" path="device/common" revision="42b808b7e93d0619286ae8e59110b176b7732389"/>
   <project name="device/sample" path="device/sample" revision="237bd668d0f114d801a8d6455ef5e02cc3577587"/>
   <project name="platform_external_apriori" path="external/apriori" remote="b2g" revision="11816ad0406744f963537b23d68ed9c2afb412bd"/>
   <project name="platform/external/bluetooth/bluez" path="external/bluetooth/bluez" revision="52a1a862a8bac319652b8f82d9541ba40bfa45ce"/>
--- a/b2g/config/flame/sources.xml
+++ b/b2g/config/flame/sources.xml
@@ -12,20 +12,20 @@
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="cc67f31dc638c0b7edba3cf7e3d87cadf0ed52bf">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="57da30f405ba37a5d4844f32bb292271b81faee2"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="1bcd355855626640b2532f2ccb1f814711f7a6ad"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="c510babaf88dfa2cfe2c202afb2649ee124569af"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="b5e21ed930860a0d43728b556b09e8dedd27fdeb"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="6f0e303999894aa657d3863dbaf00e4aa002b3ed"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.1" path="prebuilts/clang/linux-x86/3.1" revision="e95b4ce22c825da44d14299e1190ea39a5260bde"/>
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.2" path="prebuilts/clang/linux-x86/3.2" revision="471afab478649078ad7c75ec6b252481a59e19b8"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" revision="8b880805d454664b3eed11d0f053cdeafa1ff06e"/>
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -1,9 +1,9 @@
 {
     "git": {
         "git_revision": "", 
         "remote": "", 
         "branch": ""
     }, 
-    "revision": "4073b397d7b5d37ae81ced569e4af7c734defe68", 
+    "revision": "d2f6eae6c726c9e470bbd8f980e9d5c816cf49f2", 
     "repo_path": "/integration/gaia-central"
 }
--- a/b2g/config/hamachi/sources.xml
+++ b/b2g/config/hamachi/sources.xml
@@ -12,22 +12,22 @@
   <!--original fetch url was git://github.com/apitrace/-->
   <remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
   <default remote="caf" revision="b2g/ics_strawberry" sync-j="4"/>
   <!-- Gonk specific things and forks -->
   <project name="platform_build" path="build" remote="b2g" revision="2a165bebfa19b11b697837409f9550dd2917c46c">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
-  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="57da30f405ba37a5d4844f32bb292271b81faee2"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="1bcd355855626640b2532f2ccb1f814711f7a6ad"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="c510babaf88dfa2cfe2c202afb2649ee124569af"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="b5e21ed930860a0d43728b556b09e8dedd27fdeb"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="6f0e303999894aa657d3863dbaf00e4aa002b3ed"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
   <project name="platform/bionic" path="bionic" revision="d2eb6c7b6e1bc7643c17df2d9d9bcb1704d0b9ab"/>
   <project name="platform/bootable/recovery" path="bootable/recovery" revision="746bc48f34f5060f90801925dcdd964030c1ab6d"/>
   <project name="platform/development" path="development" revision="2460485184bc8535440bb63876d4e63ec1b4770c"/>
   <project name="device/common" path="device/common" revision="0dcc1e03659db33b77392529466f9eb685cdd3c7"/>
   <project name="device/sample" path="device/sample" revision="68b1cb978a20806176123b959cb05d4fa8adaea4"/>
   <project name="platform_external_apriori" path="external/apriori" remote="b2g" revision="11816ad0406744f963537b23d68ed9c2afb412bd"/>
--- a/b2g/config/helix/sources.xml
+++ b/b2g/config/helix/sources.xml
@@ -10,17 +10,17 @@
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <default remote="caf" revision="b2g/ics_strawberry" sync-j="4"/>
   <!-- Gonk specific things and forks -->
   <project name="platform_build" path="build" remote="b2g" revision="2a165bebfa19b11b697837409f9550dd2917c46c">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
-  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="57da30f405ba37a5d4844f32bb292271b81faee2"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="1bcd355855626640b2532f2ccb1f814711f7a6ad"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="c510babaf88dfa2cfe2c202afb2649ee124569af"/>
   <project name="gonk-patches" path="patches" remote="b2g" revision="223a2421006e8f5da33f516f6891c87cae86b0f6"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
   <project name="platform/bionic" path="bionic" revision="d2eb6c7b6e1bc7643c17df2d9d9bcb1704d0b9ab"/>
--- a/b2g/config/nexus-4/sources.xml
+++ b/b2g/config/nexus-4/sources.xml
@@ -12,20 +12,20 @@
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="cc67f31dc638c0b7edba3cf7e3d87cadf0ed52bf">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="57da30f405ba37a5d4844f32bb292271b81faee2"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="1bcd355855626640b2532f2ccb1f814711f7a6ad"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="c510babaf88dfa2cfe2c202afb2649ee124569af"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="b5e21ed930860a0d43728b556b09e8dedd27fdeb"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="6f0e303999894aa657d3863dbaf00e4aa002b3ed"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.1" path="prebuilts/clang/linux-x86/3.1" revision="5c45f43419d5582949284eee9cef0c43d866e03b"/>
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.2" path="prebuilts/clang/linux-x86/3.2" revision="3748b4168e7bd8d46457d4b6786003bc6a5223ce"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="9025e50b9d29b3cabbbb21e1dd94d0d13121a17e"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="b89fda71fcd0fa0cf969310e75be3ea33e048b44"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" revision="2e7d5348f35575870b3c7e567a9a9f6d66f8d6c5"/>
--- a/b2g/config/wasabi/sources.xml
+++ b/b2g/config/wasabi/sources.xml
@@ -12,22 +12,22 @@
   <!--original fetch url was git://github.com/apitrace/-->
   <remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
   <default remote="caf" revision="ics_chocolate_rb4.2" sync-j="4"/>
   <!-- Gonk specific things and forks -->
   <project name="platform_build" path="build" remote="b2g" revision="2a165bebfa19b11b697837409f9550dd2917c46c">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
-  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="57da30f405ba37a5d4844f32bb292271b81faee2"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="1bcd355855626640b2532f2ccb1f814711f7a6ad"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="c510babaf88dfa2cfe2c202afb2649ee124569af"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="b5e21ed930860a0d43728b556b09e8dedd27fdeb"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="6f0e303999894aa657d3863dbaf00e4aa002b3ed"/>
   <project name="gonk-patches" path="patches" remote="b2g" revision="223a2421006e8f5da33f516f6891c87cae86b0f6"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
   <project name="platform/bionic" path="bionic" revision="cd5dfce80bc3f0139a56b58aca633202ccaee7f8"/>
   <project name="platform/bootable/recovery" path="bootable/recovery" revision="e0a9ac010df3afaa47ba107192c05ac8b5516435"/>
   <project name="platform/development" path="development" revision="a384622f5fcb1d2bebb9102591ff7ae91fe8ed2d"/>
   <project name="device/common" path="device/common" revision="7c65ea240157763b8ded6154a17d3c033167afb7"/>
   <project name="device/sample" path="device/sample" revision="c328f3d4409db801628861baa8d279fb8855892f"/>
--- a/content/html/content/reftests/toblob-todataurl/reftest.list
+++ b/content/html/content/reftests/toblob-todataurl/reftest.list
@@ -1,16 +1,16 @@
-fuzzy-if(Android,105,482) random-if(B2G&&browserIsRemote) == toblob-quality-0.html quality-0-ref.html
-fuzzy-if(Android,38,2024) random-if(B2G&&browserIsRemote) == toblob-quality-25.html quality-25-ref.html
-fuzzy-if(Android,29,2336) random-if(B2G&&browserIsRemote) == toblob-quality-50.html quality-50-ref.html
-fuzzy-if(Android,23,3533) random-if(B2G&&browserIsRemote) == toblob-quality-75.html quality-75-ref.html
-fuzzy-if(Android,16,4199) random-if(B2G&&browserIsRemote) == toblob-quality-92.html quality-92-ref.html
-fuzzy-if(Android,8,2461) random-if(B2G&&browserIsRemote) == toblob-quality-100.html quality-100-ref.html
-fuzzy-if(Android,16,4199) random-if(B2G&&browserIsRemote) == toblob-quality-undefined.html quality-92-ref.html
-fuzzy-if(Android,16,4199) random-if(B2G&&browserIsRemote) == toblob-quality-default.html quality-92-ref.html
+fuzzy-if(Android,105,482) == toblob-quality-0.html quality-0-ref.html
+fuzzy-if(Android,38,2024) == toblob-quality-25.html quality-25-ref.html
+fuzzy-if(Android,29,2336) == toblob-quality-50.html quality-50-ref.html
+fuzzy-if(Android,23,3533) == toblob-quality-75.html quality-75-ref.html
+fuzzy-if(Android,16,4199) == toblob-quality-92.html quality-92-ref.html
+fuzzy-if(Android,8,2461) == toblob-quality-100.html quality-100-ref.html
+fuzzy-if(Android,16,4199) == toblob-quality-undefined.html quality-92-ref.html
+fuzzy-if(Android,16,4199) == toblob-quality-default.html quality-92-ref.html
 fuzzy-if(Android,105,482) == todataurl-quality-0.html quality-0-ref.html
 fuzzy-if(Android,38,2024) == todataurl-quality-25.html quality-25-ref.html
 fuzzy-if(Android,29,2336) == todataurl-quality-50.html quality-50-ref.html
 fuzzy-if(Android,23,3533) == todataurl-quality-75.html quality-75-ref.html
 fuzzy-if(Android,16,4199) == todataurl-quality-92.html quality-92-ref.html
 fuzzy-if(Android,8,2461) == todataurl-quality-100.html quality-100-ref.html
 fuzzy-if(Android,16,4199) == todataurl-quality-undefined.html quality-92-ref.html
 fuzzy-if(Android,16,4199) == todataurl-quality-default.html quality-92-ref.html
\ No newline at end of file
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -1555,26 +1555,26 @@ Navigator::RequestWakeLock(const nsAStri
   if (!pmService) {
     aRv.Throw(NS_ERROR_UNEXPECTED);
     return nullptr;
   }
 
   return pmService->NewWakeLock(aTopic, mWindow, aRv);
 }
 
-nsIDOMMozMobileMessageManager*
+MobileMessageManager*
 Navigator::GetMozMobileMessage()
 {
   if (!mMobileMessageManager) {
     // Check that our window has not gone away
     NS_ENSURE_TRUE(mWindow, nullptr);
     NS_ENSURE_TRUE(mWindow->GetDocShell(), nullptr);
 
-    mMobileMessageManager = new MobileMessageManager();
-    mMobileMessageManager->Init(mWindow);
+    mMobileMessageManager = new MobileMessageManager(mWindow);
+    mMobileMessageManager->Init();
   }
 
   return mMobileMessageManager;
 }
 
 Telephony*
 Navigator::GetMozTelephony(ErrorResult& aRv)
 {
--- a/dom/base/Navigator.h
+++ b/dom/base/Navigator.h
@@ -17,17 +17,16 @@
 #include "nsHashKeys.h"
 #include "nsInterfaceHashtable.h"
 #include "nsString.h"
 #include "nsTArray.h"
 
 class nsPluginArray;
 class nsMimeTypeArray;
 class nsPIDOMWindow;
-class nsIDOMMozMobileMessageManager;
 class nsIDOMNavigatorSystemMessages;
 class nsDOMCameraManager;
 class nsDOMDeviceStorage;
 class nsIDOMBlob;
 class nsIPrincipal;
 
 namespace mozilla {
 namespace dom {
@@ -201,17 +200,17 @@ public:
   nsDOMDeviceStorage* GetDeviceStorage(const nsAString& aType,
                                        ErrorResult& aRv);
   void GetDeviceStorages(const nsAString& aType,
                          nsTArray<nsRefPtr<nsDOMDeviceStorage> >& aStores,
                          ErrorResult& aRv);
   DesktopNotificationCenter* GetMozNotification(ErrorResult& aRv);
   bool MozIsLocallyAvailable(const nsAString& aURI, bool aWhenOffline,
                              ErrorResult& aRv);
-  nsIDOMMozMobileMessageManager* GetMozMobileMessage();
+  MobileMessageManager* GetMozMobileMessage();
   Telephony* GetMozTelephony(ErrorResult& aRv);
   network::Connection* GetConnection(ErrorResult& aRv);
   nsDOMCameraManager* GetMozCameras(ErrorResult& aRv);
   void MozSetMessageHandler(const nsAString& aType,
                             systemMessageCallback* aCallback,
                             ErrorResult& aRv);
   bool MozHasPendingMessage(const nsAString& aType, ErrorResult& aRv);
 #ifdef MOZ_B2G
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -126,17 +126,16 @@
 #include "nsIEventListenerService.h"
 #include "nsIMessageManager.h"
 
 #include "mozilla/dom/TouchEvent.h"
 
 #include "nsWrapperCacheInlines.h"
 #include "mozilla/dom/HTMLCollectionBinding.h"
 
-#include "nsIDOMMobileMessageManager.h"
 #include "nsIDOMMozSmsMessage.h"
 #include "nsIDOMMozMmsMessage.h"
 #include "nsIDOMSmsFilter.h"
 #include "nsIDOMSmsSegmentInfo.h"
 #include "nsIDOMMozMobileMessageThread.h"
 
 #ifdef MOZ_B2G_FM
 #include "FMRadio.h"
@@ -369,19 +368,16 @@ static nsDOMClassInfoData sClassInfoData
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(File, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
   NS_DEFINE_CLASSINFO_DATA(ModalContentWindow, nsWindowSH,
                            DEFAULT_SCRIPTABLE_FLAGS |
                            WINDOW_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)
 
   NS_DEFINE_CLASSINFO_DATA(MozSmsFilter, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
@@ -971,20 +967,16 @@ nsDOMClassInfo::Init()
   DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(ModalContentWindow, nsIDOMWindow)
     DOM_CLASSINFO_WINDOW_MAP_ENTRIES
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMModalContentWindow)
 #ifdef MOZ_WEBSPEECH
     DOM_CLASSINFO_MAP_ENTRY(nsISpeechSynthesisGetter)
 #endif
   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
 
   DOM_CLASSINFO_MAP_BEGIN(MozMmsMessage, nsIDOMMozMmsMessage)
      DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozMmsMessage)
   DOM_CLASSINFO_MAP_END
 
--- a/dom/base/nsDOMClassInfoClasses.h
+++ b/dom/base/nsDOMClassInfoClasses.h
@@ -53,17 +53,16 @@ DOMCI_CLASS(XPathNSResolver)
 DOMCI_CLASS(Storage)
 
 DOMCI_CLASS(Blob)
 DOMCI_CLASS(File)
 
 // DOM modal content window class, almost identical to Window
 DOMCI_CLASS(ModalContentWindow)
 
-DOMCI_CLASS(MozMobileMessageManager)
 DOMCI_CLASS(MozSmsMessage)
 DOMCI_CLASS(MozMmsMessage)
 DOMCI_CLASS(MozSmsFilter)
 DOMCI_CLASS(MozSmsSegmentInfo)
 DOMCI_CLASS(MozMobileMessageThread)
 
 // @font-face in CSS
 DOMCI_CLASS(CSSFontFaceRule)
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -842,16 +842,20 @@ DOMInterfaces = {
     'nativeType': 'mozilla::dom::MobileConnectionArray',
     'resultNotAddRefed': [ 'item' ]
 },
 
 'MozMobileConnectionInfo': {
     'nativeType': 'mozilla::dom::MobileConnectionInfo',
 },
 
+'MozMobileMessageManager': {
+    'nativeType': 'mozilla::dom::MobileMessageManager',
+},
+
 'MozMobileNetworkInfo': {
     'nativeType': 'mozilla::dom::MobileNetworkInfo',
 },
 
 'MozNamedAttrMap': {
     'nativeType': 'nsDOMAttributeMap',
 },
 
@@ -1964,21 +1968,23 @@ addExternalIface('imgINotificationObserv
 addExternalIface('imgIRequest', nativeType='imgIRequest', notflattened=True)
 addExternalIface('MenuBuilder', nativeType='nsIMenuBuilder', notflattened=True)
 addExternalIface('MozBoxObject', nativeType='nsIBoxObject')
 addExternalIface('MozControllers', nativeType='nsIControllers')
 addExternalIface('MozFrameLoader', nativeType='nsIFrameLoader', notflattened=True)
 addExternalIface('MozFrameRequestCallback', nativeType='nsIFrameRequestCallback',
                  notflattened=True)
 addExternalIface('MozIccInfo', headerFile='nsIDOMIccInfo.h')
-addExternalIface('MozMobileMessageManager', headerFile='nsIDOMMobileMessageManager.h')
+addExternalIface('MozMmsMessage')
 addExternalIface('MozObserver', nativeType='nsIObserver', notflattened=True)
 addExternalIface('MozRDFCompositeDataSource', nativeType='nsIRDFCompositeDataSource',
                  notflattened=True)
 addExternalIface('MozRDFResource', nativeType='nsIRDFResource', notflattened=True)
+addExternalIface('MozSmsFilter', headerFile='nsIDOMSmsFilter.h')
+addExternalIface('MozSmsMessage')
 addExternalIface('MozTreeBoxObject', nativeType='nsITreeBoxObject',
                  notflattened=True)
 addExternalIface('MozTreeColumn', nativeType='nsITreeColumn',
                  headerFile='nsITreeColumns.h')
 addExternalIface('MozVoicemailStatus')
 addExternalIface('MozWakeLockListener', headerFile='nsIDOMWakeLockListener.h')
 addExternalIface('MozXULTemplateBuilder', nativeType='nsIXULTemplateBuilder')
 addExternalIface('nsIBrowserDOMWindow', nativeType='nsIBrowserDOMWindow',
--- a/dom/mobileconnection/src/MobileConnection.cpp
+++ b/dom/mobileconnection/src/MobileConnection.cpp
@@ -599,17 +599,23 @@ MobileConnection::SetCallForwardingOptio
     return nullptr;
   }
 
   if (!mProvider) {
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
 
-  AutoSafeJSContext cx;
+  AutoJSAPI jsapi;
+  if (!NS_WARN_IF(jsapi.InitUsingWin(GetOwner()))) {
+    aRv.Throw(NS_ERROR_FAILURE);
+    return nullptr;
+  }
+
+  JSContext *cx = jsapi.cx();
   JS::Rooted<JS::Value> options(cx);
   if (!ToJSValue(cx, aOptions, &options)) {
     aRv.Throw(NS_ERROR_TYPE_ERR);
     return nullptr;
   }
 
   nsCOMPtr<nsIDOMDOMRequest> request;
   nsresult rv = mProvider->SetCallForwarding(mClientId, GetOwner(), options,
@@ -630,17 +636,23 @@ MobileConnection::GetCallBarringOption(c
     return nullptr;
   }
 
   if (!mProvider) {
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
 
-  AutoSafeJSContext cx;
+  AutoJSAPI jsapi;
+  if (!NS_WARN_IF(jsapi.InitUsingWin(GetOwner()))) {
+    aRv.Throw(NS_ERROR_FAILURE);
+    return nullptr;
+  }
+
+  JSContext *cx = jsapi.cx();
   JS::Rooted<JS::Value> options(cx);
   if (!ToJSValue(cx, aOptions, &options)) {
     aRv.Throw(NS_ERROR_TYPE_ERR);
     return nullptr;
   }
 
   nsCOMPtr<nsIDOMDOMRequest> request;
   nsresult rv = mProvider->GetCallBarring(mClientId, GetOwner(), options,
@@ -661,17 +673,23 @@ MobileConnection::SetCallBarringOption(c
     return nullptr;
   }
 
   if (!mProvider) {
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
 
-  AutoSafeJSContext cx;
+  AutoJSAPI jsapi;
+  if (!NS_WARN_IF(jsapi.InitUsingWin(GetOwner()))) {
+    aRv.Throw(NS_ERROR_FAILURE);
+    return nullptr;
+  }
+
+  JSContext *cx = jsapi.cx();
   JS::Rooted<JS::Value> options(cx);
   if (!ToJSValue(cx, aOptions, &options)) {
     aRv.Throw(NS_ERROR_TYPE_ERR);
     return nullptr;
   }
 
   nsCOMPtr<nsIDOMDOMRequest> request;
   nsresult rv = mProvider->SetCallBarring(mClientId, GetOwner(), options,
@@ -692,17 +710,23 @@ MobileConnection::ChangeCallBarringPassw
     return nullptr;
   }
 
   if (!mProvider) {
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
 
-  AutoSafeJSContext cx;
+  AutoJSAPI jsapi;
+  if (!NS_WARN_IF(jsapi.InitUsingWin(GetOwner()))) {
+    aRv.Throw(NS_ERROR_FAILURE);
+    return nullptr;
+  }
+
+  JSContext *cx = jsapi.cx();
   JS::Rooted<JS::Value> options(cx);
   if (!ToJSValue(cx, aOptions, &options)) {
     aRv.Throw(NS_ERROR_TYPE_ERR);
     return nullptr;
   }
 
   nsCOMPtr<nsIDOMDOMRequest> request;
   nsresult rv = mProvider->ChangeCallBarringPassword(mClientId,
--- a/dom/mobilemessage/interfaces/moz.build
+++ b/dom/mobilemessage/interfaces/moz.build
@@ -1,16 +1,15 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 XPIDL_SOURCES += [
-    'nsIDOMMobileMessageManager.idl',
     'nsIDOMMozMmsMessage.idl',
     'nsIDOMMozMobileMessageThread.idl',
     'nsIDOMMozSmsMessage.idl',
     'nsIDOMSmsFilter.idl',
     'nsIDOMSmsSegmentInfo.idl',
     'nsIMmsService.idl',
     'nsIMobileMessageCallback.idl',
     'nsIMobileMessageCursorCallback.idl',
deleted file mode 100644
--- a/dom/mobilemessage/interfaces/nsIDOMMobileMessageManager.idl
+++ /dev/null
@@ -1,81 +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 nsIDOMEventListener;
-interface nsIDOMMozSmsFilter;
-interface nsIDOMMozSmsSegmentInfo;
-interface nsIDOMDOMCursor;
-interface nsIDOMDOMRequest;
-interface nsIDOMBlob;
-
-[scriptable, builtinclass, uuid(8ec8247d-3f5f-41af-9c72-9dc857e3be81)]
-interface nsIDOMMozMobileMessageManager : nsIDOMEventTarget
-{
-  nsIDOMDOMRequest getSegmentInfoForText(in DOMString text);
-
-
-  /**
-   * Function to send SMS.
-   *
-   * @param number
-   *        Either a DOMString (only one number) or an array of numbers.
-   * @param message
-   *        The text message to be sent.
-   * @param sendParameters
-   *        An SmsSendParameters object.
-   * @param return
-   *        A DOMRequest object indicating the sending result if one number
-   *        has been passed; an array of DOMRequest objects otherwise.
-   */
-  [implicit_jscontext, optional_argc]
-  jsval send(in jsval number, in DOMString message,
-             [optional] in jsval sendParameters);
-
-  /**
-   * Function to send MMS.
-   *
-   * @param parameters
-   *        An MmsParameters object.
-   * @param sendParameters
-   *        An MmsSendParameters object.
-   * @param return
-   *        A DOMRequest object indicating the sending result.
-   */
-  [implicit_jscontext, optional_argc]
-  nsIDOMDOMRequest sendMMS(in jsval parameters,
-                           [optional] in jsval sendParameters);
-
-  [binaryname(GetMessageMoz)]
-  nsIDOMDOMRequest getMessage(in long id);
-
-  // The parameter can be either a message id or a nsIDOMMoz{Mms,Sms}Message.
-  [implicit_jscontext]
-  nsIDOMDOMRequest delete(in jsval param);
-
-  // Iterates through nsIDOMMoz{Mms,Sms}Message.
-  nsIDOMDOMCursor getMessages(in nsIDOMMozSmsFilter filter, in boolean reverse);
-
-  nsIDOMDOMRequest markMessageRead(in long id, in boolean value,
-                                   [optional] in boolean aSendReadReport);
-
-  // Iterates through nsIDOMMozMobileMessageThread.
-  nsIDOMDOMCursor getThreads();
-
-  nsIDOMDOMRequest retrieveMMS(in long id);
-
-  [optional_argc]
-  nsIDOMDOMRequest getSmscAddress([optional] in unsigned long serviceId);
-
-  [implicit_jscontext] attribute jsval onreceived;
-  [implicit_jscontext] attribute jsval onretrieving;
-  [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;
-  [implicit_jscontext] attribute jsval onreadsuccess;
-  [implicit_jscontext] attribute jsval onreaderror;
-};
--- a/dom/mobilemessage/src/MmsMessage.h
+++ b/dom/mobilemessage/src/MmsMessage.h
@@ -5,16 +5,17 @@
 
 #ifndef mozilla_dom_mobilemessage_MmsMessage_h
 #define mozilla_dom_mobilemessage_MmsMessage_h
 
 #include "nsIDOMMozMmsMessage.h"
 #include "nsString.h"
 #include "mozilla/dom/mobilemessage/Types.h"
 #include "mozilla/dom/MozMmsMessageBinding.h"
+#include "mozilla/dom/MozMobileMessageManagerBinding.h"
 #include "mozilla/Attributes.h"
 
 namespace mozilla {
 namespace dom {
 
 namespace mobilemessage {
 class MmsMessageData;
 } // namespace mobilemessage
--- a/dom/mobilemessage/src/MobileMessageManager.cpp
+++ b/dom/mobilemessage/src/MobileMessageManager.cpp
@@ -1,82 +1,66 @@
 /* -*- 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 "MobileMessageManager.h"
-#include "nsIDOMClassInfo.h"
-#include "nsISmsService.h"
-#include "nsIMmsService.h"
-#include "nsIObserverService.h"
+
+#include "DOMCursor.h"
+#include "DOMRequest.h"
+#include "MobileMessageCallback.h"
+#include "MobileMessageCursorCallback.h"
+#include "mozilla/dom/mobilemessage/Constants.h" // For kSms*ObserverTopic
+#include "mozilla/dom/MozMmsEvent.h"
+#include "mozilla/dom/MozMobileMessageManagerBinding.h"
+#include "mozilla/dom/MozSmsEvent.h"
+#include "mozilla/dom/ToJSValue.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Services.h"
-#include "mozilla/dom/mobilemessage/Constants.h" // For MessageType
-#include "mozilla/dom/MobileMessageManagerBinding.h"
-#include "mozilla/dom/MozMmsEvent.h"
-#include "mozilla/dom/MozMmsMessageBinding.h"
-#include "mozilla/dom/MozSmsEvent.h"
+#include "nsIDOMMozMmsMessage.h"
 #include "nsIDOMMozSmsMessage.h"
-#include "nsIDOMMozMmsMessage.h"
-#include "nsJSUtils.h"
-#include "nsContentUtils.h"
-#include "nsCxPusher.h"
+#include "nsIMmsService.h"
+#include "nsIMobileMessageCallback.h"
 #include "nsIMobileMessageDatabaseService.h"
-#include "nsIXPConnect.h"
-#include "nsIPermissionManager.h"
-#include "GeneratedEvents.h"
-#include "DOMRequest.h"
-#include "nsIMobileMessageCallback.h"
-#include "MobileMessageCallback.h"
-#include "MobileMessageCursorCallback.h"
-#include "DOMCursor.h"
+#include "nsIObserverService.h"
+#include "nsISmsService.h"
+#include "nsServiceManagerUtils.h" // For do_GetService()
+#include "SmsFilter.h"
 
 #define RECEIVED_EVENT_NAME         NS_LITERAL_STRING("received")
 #define RETRIEVING_EVENT_NAME       NS_LITERAL_STRING("retrieving")
 #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")
 #define READ_SUCCESS_EVENT_NAME     NS_LITERAL_STRING("readsuccess")
 #define READ_ERROR_EVENT_NAME       NS_LITERAL_STRING("readerror")
 
 using namespace mozilla::dom::mobilemessage;
 
-DOMCI_DATA(MozMobileMessageManager, mozilla::dom::MobileMessageManager)
-
 namespace mozilla {
 namespace dom {
 
 NS_INTERFACE_MAP_BEGIN(MobileMessageManager)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMMozMobileMessageManager)
   NS_INTERFACE_MAP_ENTRY(nsIObserver)
-  NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MozMobileMessageManager)
 NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
 
 NS_IMPL_ADDREF_INHERITED(MobileMessageManager, DOMEventTargetHelper)
 NS_IMPL_RELEASE_INHERITED(MobileMessageManager, DOMEventTargetHelper)
 
-NS_IMPL_EVENT_HANDLER(MobileMessageManager, received)
-NS_IMPL_EVENT_HANDLER(MobileMessageManager, retrieving)
-NS_IMPL_EVENT_HANDLER(MobileMessageManager, sending)
-NS_IMPL_EVENT_HANDLER(MobileMessageManager, sent)
-NS_IMPL_EVENT_HANDLER(MobileMessageManager, failed)
-NS_IMPL_EVENT_HANDLER(MobileMessageManager, deliverysuccess)
-NS_IMPL_EVENT_HANDLER(MobileMessageManager, deliveryerror)
-NS_IMPL_EVENT_HANDLER(MobileMessageManager, readsuccess)
-NS_IMPL_EVENT_HANDLER(MobileMessageManager, readerror)
+MobileMessageManager::MobileMessageManager(nsPIDOMWindow *aWindow)
+  : DOMEventTargetHelper(aWindow)
+{
+}
 
 void
-MobileMessageManager::Init(nsPIDOMWindow *aWindow)
+MobileMessageManager::Init()
 {
-  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, kSmsRetrievingObserverTopic, false);
@@ -104,376 +88,402 @@ MobileMessageManager::Shutdown()
   obs->RemoveObserver(this, kSmsSentObserverTopic);
   obs->RemoveObserver(this, kSmsFailedObserverTopic);
   obs->RemoveObserver(this, kSmsDeliverySuccessObserverTopic);
   obs->RemoveObserver(this, kSmsDeliveryErrorObserverTopic);
   obs->RemoveObserver(this, kSmsReadSuccessObserverTopic);
   obs->RemoveObserver(this, kSmsReadErrorObserverTopic);
 }
 
-NS_IMETHODIMP
+JSObject*
+MobileMessageManager::WrapObject(JSContext* aCx)
+{
+  return MozMobileMessageManagerBinding::Wrap(aCx, this);
+}
+
+already_AddRefed<DOMRequest>
 MobileMessageManager::GetSegmentInfoForText(const nsAString& aText,
-                                            nsIDOMDOMRequest** aRequest)
+                                            ErrorResult& aRv)
 {
   nsCOMPtr<nsISmsService> smsService = do_GetService(SMS_SERVICE_CONTRACTID);
-  NS_ENSURE_TRUE(smsService, NS_ERROR_FAILURE);
+  if (!smsService) {
+    aRv.Throw(NS_ERROR_FAILURE);
+    return nullptr;
+  }
 
   nsRefPtr<DOMRequest> request = new DOMRequest(GetOwner());
   nsCOMPtr<nsIMobileMessageCallback> msgCallback =
     new MobileMessageCallback(request);
   nsresult rv = smsService->GetSegmentInfoForText(aText, msgCallback);
-  NS_ENSURE_SUCCESS(rv, rv);
+  if (NS_FAILED(rv)) {
+    aRv.Throw(rv);
+    return nullptr;
+  }
 
-  request.forget(aRequest);
-  return NS_OK;
+  return request.forget();
 }
 
-nsresult
-MobileMessageManager::Send(JSContext* aCx, JS::Handle<JSObject*> aGlobal,
+already_AddRefed<DOMRequest>
+MobileMessageManager::Send(nsISmsService* aSmsService,
                            uint32_t aServiceId,
-                           JS::Handle<JSString*> aNumber,
-                           const nsAString& aMessage,
-                           JS::MutableHandle<JS::Value> aRequest)
+                           const nsAString& aNumber,
+                           const nsAString& aText,
+                           ErrorResult& aRv)
 {
-  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);
 
   // By default, we don't send silent messages via MobileMessageManager.
-  nsresult rv = smsService->Send(aServiceId, number, aMessage,
-                                 false, msgCallback);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  js::AssertSameCompartment(aCx, aGlobal);
-  rv = nsContentUtils::WrapNative(aCx,
-                                  static_cast<nsIDOMDOMRequest*>(request.get()),
-                                  aRequest);
+  nsresult rv = aSmsService->Send(aServiceId, aNumber, aText,
+                                  false, msgCallback);
   if (NS_FAILED(rv)) {
-    NS_ERROR("Failed to create the js value!");
-    return rv;
+    aRv.Throw(rv);
+    return nullptr;
   }
 
-  return NS_OK;
+  return request.forget();
 }
 
-NS_IMETHODIMP
-MobileMessageManager::Send(JS::Handle<JS::Value> aNumber,
-                           const nsAString& aMessage,
-                           JS::Handle<JS::Value> aSendParams,
-                           JSContext* aCx,
-                           uint8_t aArgc,
-                           JS::MutableHandle<JS::Value> aReturn)
+already_AddRefed<DOMRequest>
+MobileMessageManager::Send(const nsAString& aNumber,
+                           const nsAString& aText,
+                           const SmsSendParameters& aSendParams,
+                           ErrorResult& aRv)
 {
-  if (!aNumber.isString() && !JS_IsArrayObject(aCx, aNumber)) {
-    return NS_ERROR_INVALID_ARG;
+  nsCOMPtr<nsISmsService> smsService = do_GetService(SMS_SERVICE_CONTRACTID);
+  if (!smsService) {
+    aRv.Throw(NS_ERROR_FAILURE);
+    return nullptr;
   }
 
-  nsresult rv;
-  nsIScriptContext* sc = GetContextForEventHandlers(&rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-  NS_ENSURE_STATE(sc);
-
-  JS::Rooted<JSObject*> global(aCx, JS::CurrentGlobalOrNull(aCx));
-
-  mozilla::Maybe<JSAutoCompartment> ac;
-  if (!global) {
-    global = sc->GetWindowProxy();
-    ac.construct(aCx, global);
-  }
-
-  nsCOMPtr<nsISmsService> smsService = do_GetService(SMS_SERVICE_CONTRACTID);
-  NS_ENSURE_TRUE(smsService, NS_ERROR_FAILURE);
-
   // Use the default one unless |aSendParams.serviceId| is available.
   uint32_t serviceId;
-  rv = smsService->GetSmsDefaultServiceId(&serviceId);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  if (aArgc == 1) {
-    JS::Rooted<JS::Value> param(aCx, aSendParams);
-    RootedDictionary<SmsSendParameters> sendParams(aCx);
-    if (!sendParams.Init(aCx, param)) {
-      return NS_ERROR_TYPE_ERR;
-    }
-    if (sendParams.mServiceId.WasPassed()) {
-      serviceId = sendParams.mServiceId.Value();
+  if (aSendParams.mServiceId.WasPassed()) {
+    serviceId = aSendParams.mServiceId.Value();
+  } else {
+    nsresult rv = smsService->GetSmsDefaultServiceId(&serviceId);
+    if (NS_FAILED(rv)) {
+      aRv.Throw(rv);
+      return nullptr;
     }
   }
 
-  if (aNumber.isString()) {
-    JS::Rooted<JSString*> str(aCx, aNumber.toString());
-    return Send(aCx, global, serviceId, str, aMessage, aReturn);
-  }
-
-  // Must be an array then.
-  JS::Rooted<JSObject*> numbers(aCx, &aNumber.toObject());
-
-  uint32_t size;
-  if (!JS_GetArrayLength(aCx, numbers, &size)) {
-    return NS_ERROR_FAILURE;
-  }
-
-  JS::AutoValueVector requests(aCx);
-  if (!requests.resize(size)) {
-    return NS_ERROR_FAILURE;
-  }
-
-  JS::Rooted<JS::Value> number(aCx);
-  JS::Rooted<JSString*> str(aCx);
-  for (uint32_t i = 0; i < size; ++i) {
-    if (!JS_GetElement(aCx, numbers, i, &number)) {
-      return NS_ERROR_INVALID_ARG;
-    }
-
-    str = JS::ToString(aCx, number);
-    if (!str) {
-      return NS_ERROR_FAILURE;
-    }
-
-    nsresult rv = Send(aCx, global, serviceId, str, aMessage, requests[i]);
-    NS_ENSURE_SUCCESS(rv, rv);
-  }
-
-  JS::Rooted<JSObject*> obj(aCx);
-  obj = JS_NewArrayObject(aCx, requests);
-  if (!obj) {
-    return NS_ERROR_FAILURE;
-  }
-
-  aReturn.setObject(*obj);
-  return NS_OK;
+  return Send(smsService, serviceId, aNumber, aText, aRv);
 }
 
-NS_IMETHODIMP
-MobileMessageManager::SendMMS(JS::Handle<JS::Value> aParams,
-                              JS::Handle<JS::Value> aSendParams,
-                              JSContext* aCx,
-                              uint8_t aArgc,
-                              nsIDOMDOMRequest** aRequest)
+void
+MobileMessageManager::Send(const Sequence<nsString>& aNumbers,
+                           const nsAString& aText,
+                           const SmsSendParameters& aSendParams,
+                           nsTArray<nsRefPtr<DOMRequest>>& aReturn,
+                           ErrorResult& aRv)
 {
-  nsCOMPtr<nsIMmsService> mmsService = do_GetService(MMS_SERVICE_CONTRACTID);
-  NS_ENSURE_TRUE(mmsService, NS_ERROR_FAILURE);
+  nsCOMPtr<nsISmsService> smsService = do_GetService(SMS_SERVICE_CONTRACTID);
+  if (!smsService) {
+    aRv.Throw(NS_ERROR_FAILURE);
+    return;
+  }
 
   // Use the default one unless |aSendParams.serviceId| is available.
   uint32_t serviceId;
-  nsresult rv = mmsService->GetMmsDefaultServiceId(&serviceId);
-  NS_ENSURE_SUCCESS(rv, rv);
+  if (aSendParams.mServiceId.WasPassed()) {
+    serviceId = aSendParams.mServiceId.Value();
+  } else {
+    nsresult rv = smsService->GetSmsDefaultServiceId(&serviceId);
+    if (NS_FAILED(rv)) {
+      aRv.Throw(rv);
+      return;
+    }
+  }
+
+  const uint32_t size = aNumbers.Length();
+  for (uint32_t i = 0; i < size; ++i) {
+    nsRefPtr<DOMRequest> request = Send(smsService, serviceId, aNumbers[i], aText, aRv);
+    if (aRv.Failed()) {
+      return;
+    }
+    aReturn.AppendElement(request);
+  }
+}
 
-  if (aArgc == 1) {
-    JS::Rooted<JS::Value> param(aCx, aSendParams);
-    RootedDictionary<MmsSendParameters> sendParams(aCx);
-    if (!sendParams.Init(aCx, param)) {
-      return NS_ERROR_TYPE_ERR;
+already_AddRefed<DOMRequest>
+MobileMessageManager::SendMMS(const MmsParameters& aParams,
+                              const MmsSendParameters& aSendParams,
+                              ErrorResult& aRv)
+{
+  nsCOMPtr<nsIMmsService> mmsService = do_GetService(MMS_SERVICE_CONTRACTID);
+  if (!mmsService) {
+    aRv.Throw(NS_ERROR_FAILURE);
+    return nullptr;
+  }
+
+  // Use the default one unless |aSendParams.serviceId| is available.
+  uint32_t serviceId;
+  nsresult rv;
+  if (aSendParams.mServiceId.WasPassed()) {
+    serviceId = aSendParams.mServiceId.Value();
+  } else {
+    rv = mmsService->GetMmsDefaultServiceId(&serviceId);
+    if (NS_FAILED(rv)) {
+      aRv.Throw(rv);
+      return nullptr;
     }
-    if (sendParams.mServiceId.WasPassed()) {
-      serviceId = sendParams.mServiceId.Value();
-    }
+  }
+
+  AutoJSAPI jsapi;
+  if (!NS_WARN_IF(jsapi.InitUsingWin(GetOwner()))) {
+    aRv.Throw(NS_ERROR_FAILURE);
+    return nullptr;
+  }
+
+  JSContext *cx = jsapi.cx();
+  JS::Rooted<JS::Value> val(cx);
+  if (!ToJSValue(cx, aParams, &val)) {
+    aRv.Throw(NS_ERROR_TYPE_ERR);
+    return nullptr;
   }
 
   nsRefPtr<DOMRequest> request = new DOMRequest(GetOwner());
   nsCOMPtr<nsIMobileMessageCallback> msgCallback = new MobileMessageCallback(request);
-  rv = mmsService->Send(serviceId, aParams, msgCallback);
-  NS_ENSURE_SUCCESS(rv, rv);
+  rv = mmsService->Send(serviceId, val, msgCallback);
+  if (NS_FAILED(rv)) {
+    aRv.Throw(rv);
+    return nullptr;
+  }
 
-  request.forget(aRequest);
-  return NS_OK;
+  return request.forget();
 }
 
-NS_IMETHODIMP
-MobileMessageManager::GetMessageMoz(int32_t aId, nsIDOMDOMRequest** aRequest)
+already_AddRefed<DOMRequest>
+MobileMessageManager::GetMessage(int32_t aId,
+                                 ErrorResult& aRv)
 {
-  nsCOMPtr<nsIMobileMessageDatabaseService> mobileMessageDBService =
+  nsCOMPtr<nsIMobileMessageDatabaseService> dbService =
     do_GetService(MOBILE_MESSAGE_DATABASE_SERVICE_CONTRACTID);
-  NS_ENSURE_TRUE(mobileMessageDBService, NS_ERROR_FAILURE);
+  if (!dbService) {
+    aRv.Throw(NS_ERROR_FAILURE);
+    return nullptr;
+  }
 
   nsRefPtr<DOMRequest> request = new DOMRequest(GetOwner());
   nsCOMPtr<nsIMobileMessageCallback> msgCallback = new MobileMessageCallback(request);
-  nsresult rv = mobileMessageDBService->GetMessageMoz(aId, msgCallback);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  request.forget(aRequest);
-  return NS_OK;
-}
-
-nsresult
-MobileMessageManager::GetMessageId(JSContext* aCx,
-                                   const JS::Value& aMessage, int32_t* aId)
-{
-  nsCOMPtr<nsIDOMMozSmsMessage> smsMessage =
-    do_QueryInterface(nsContentUtils::XPConnect()->GetNativeOfWrapper(aCx, &aMessage.toObject()));
-  if (smsMessage) {
-    return smsMessage->GetId(aId);
-  }
-
-  nsCOMPtr<nsIDOMMozMmsMessage> mmsMessage =
-    do_QueryInterface(nsContentUtils::XPConnect()->GetNativeOfWrapper(aCx, &aMessage.toObject()));
-  if (mmsMessage) {
-    return mmsMessage->GetId(aId);
-  }
-
-  return NS_ERROR_INVALID_ARG;
-}
-
-NS_IMETHODIMP
-MobileMessageManager::Delete(JS::Handle<JS::Value> aParam, JSContext* aCx,
-                             nsIDOMDOMRequest** aRequest)
-{
-  // We expect Int32, SmsMessage, MmsMessage, Int32[], SmsMessage[], MmsMessage[]
-  if (!aParam.isObject() && !aParam.isInt32()) {
-    return NS_ERROR_INVALID_ARG;
+  nsresult rv = dbService->GetMessageMoz(aId, msgCallback);
+  if (NS_FAILED(rv)) {
+    aRv.Throw(rv);
+    return nullptr;
   }
 
-  nsresult rv = NS_OK;
-  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(aCx, aParam)) {
-    // Single SmsMessage/MmsMessage object
-    rv = GetMessageId(aCx, aParam, &id);
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    size = 1;
-    idArray = &id;
-  } else {
-    // Int32[], SmsMessage[], or MmsMessage[]
-    JS::Rooted<JSObject*> ids(aCx, &aParam.toObject());
+  return request.forget();
+}
 
-    MOZ_ALWAYS_TRUE(JS_GetArrayLength(aCx, ids, &size));
-    nsAutoArrayPtr<int32_t> idAutoArray(new int32_t[size]);
-
-    JS::Rooted<JS::Value> idJsValue(aCx);
-    for (uint32_t i = 0; i < size; i++) {
-      if (!JS_GetElement(aCx, ids, i, &idJsValue)) {
-        return NS_ERROR_INVALID_ARG;
-      }
-
-      if (idJsValue.isInt32()) {
-        idAutoArray[i] = idJsValue.toInt32();
-      } else if (idJsValue.isObject()) {
-        rv = GetMessageId(aCx, idJsValue, &id);
-        NS_ENSURE_SUCCESS(rv, rv);
-
-        idAutoArray[i] = id;
-      }
-    }
-
-    idArray = idAutoArray.forget();
-  }
-
+already_AddRefed<DOMRequest>
+MobileMessageManager::Delete(int32_t* aIdArray,
+                             uint32_t aSize,
+                             ErrorResult& aRv)
+{
   nsCOMPtr<nsIMobileMessageDatabaseService> dbService =
     do_GetService(MOBILE_MESSAGE_DATABASE_SERVICE_CONTRACTID);
-  NS_ENSURE_TRUE(dbService, NS_ERROR_FAILURE);
+  if (!dbService) {
+    aRv.Throw(NS_ERROR_FAILURE);
+    return nullptr;
+  }
 
   nsRefPtr<DOMRequest> request = new DOMRequest(GetOwner());
   nsCOMPtr<nsIMobileMessageCallback> msgCallback =
     new MobileMessageCallback(request);
 
-  rv = dbService->DeleteMessage(idArray, size, msgCallback);
-  NS_ENSURE_SUCCESS(rv, rv);
+  nsresult rv = dbService->DeleteMessage(aIdArray, aSize, msgCallback);
+  if (NS_FAILED(rv)) {
+    aRv.Throw(rv);
+    return nullptr;
+  }
+
+  return request.forget();
+}
 
-  request.forget(aRequest);
-  return NS_OK;
+already_AddRefed<DOMRequest>
+MobileMessageManager::Delete(int32_t aId,
+                             ErrorResult& aRv)
+{
+  return Delete(&aId, 1, aRv);
+}
+
+already_AddRefed<DOMRequest>
+MobileMessageManager::Delete(nsIDOMMozSmsMessage* aMessage,
+                             ErrorResult& aRv)
+{
+  int32_t id;
+
+  DebugOnly<nsresult> rv = aMessage->GetId(&id);
+  MOZ_ASSERT(NS_SUCCEEDED(rv));
+
+  return Delete(id, aRv);
 }
 
-NS_IMETHODIMP
+already_AddRefed<DOMRequest>
+MobileMessageManager::Delete(nsIDOMMozMmsMessage* aMessage,
+                             ErrorResult& aRv)
+{
+  int32_t id;
+
+  DebugOnly<nsresult> rv = aMessage->GetId(&id);
+  MOZ_ASSERT(NS_SUCCEEDED(rv));
+
+  return Delete(id, aRv);
+}
+
+already_AddRefed<DOMRequest>
+MobileMessageManager::Delete(const Sequence<OwningLongOrMozSmsMessageOrMozMmsMessage>& aParams,
+                             ErrorResult& aRv)
+{
+  const uint32_t size = aParams.Length();
+  FallibleTArray<int32_t> idArray;
+  if (!idArray.SetLength(size)) {
+    aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
+    return nullptr;
+  }
+
+  DebugOnly<nsresult> rv;
+  for (uint32_t i = 0; i < size; i++) {
+    const OwningLongOrMozSmsMessageOrMozMmsMessage& element = aParams[i];
+    int32_t &id = idArray[i];
+
+    if (element.IsLong()) {
+      id = element.GetAsLong();
+    } else if (element.IsMozMmsMessage()) {
+      rv = element.GetAsMozMmsMessage()->GetId(&id);
+      MOZ_ASSERT(NS_SUCCEEDED(rv));
+    } else /*if (element.IsMozSmsMessage())*/ {
+      rv = element.GetAsMozSmsMessage()->GetId(&id);
+      MOZ_ASSERT(NS_SUCCEEDED(rv));
+    }
+  }
+
+  return Delete(idArray.Elements(), size, aRv);
+}
+
+already_AddRefed<DOMCursor>
 MobileMessageManager::GetMessages(nsIDOMMozSmsFilter* aFilter,
                                   bool aReverse,
-                                  nsIDOMDOMCursor** aCursor)
+                                  ErrorResult& aRv)
 {
   nsCOMPtr<nsIMobileMessageDatabaseService> dbService =
     do_GetService(MOBILE_MESSAGE_DATABASE_SERVICE_CONTRACTID);
-  NS_ENSURE_TRUE(dbService, NS_ERROR_FAILURE);
+  if (!dbService) {
+    aRv.Throw(NS_ERROR_FAILURE);
+    return nullptr;
+  }
 
   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);
+  if (NS_FAILED(rv)) {
+    aRv.Throw(rv);
+    return nullptr;
+  }
 
   cursorCallback->mDOMCursor = new DOMCursor(GetOwner(), continueCallback);
-  NS_ADDREF(*aCursor = cursorCallback->mDOMCursor);
 
-  return NS_OK;
+  nsRefPtr<DOMCursor> cursor = cursorCallback->mDOMCursor;
+  return cursor.forget();
 }
 
-NS_IMETHODIMP
-MobileMessageManager::MarkMessageRead(int32_t aId, bool aValue,
+already_AddRefed<DOMRequest>
+MobileMessageManager::MarkMessageRead(int32_t aId,
+                                      bool aValue,
                                       bool aSendReadReport,
-                                      nsIDOMDOMRequest** aRequest)
+                                      ErrorResult& aRv)
 {
-  nsCOMPtr<nsIMobileMessageDatabaseService> mobileMessageDBService =
+  nsCOMPtr<nsIMobileMessageDatabaseService> dbService =
     do_GetService(MOBILE_MESSAGE_DATABASE_SERVICE_CONTRACTID);
-  NS_ENSURE_TRUE(mobileMessageDBService, NS_ERROR_FAILURE);
+  if (!dbService) {
+    aRv.Throw(NS_ERROR_FAILURE);
+    return nullptr;
+  }
 
   nsRefPtr<DOMRequest> request = new DOMRequest(GetOwner());
   nsCOMPtr<nsIMobileMessageCallback> msgCallback = new MobileMessageCallback(request);
-  nsresult rv = mobileMessageDBService->MarkMessageRead(aId, aValue,
-                                                        aSendReadReport,
-                                                        msgCallback);
-  NS_ENSURE_SUCCESS(rv, rv);
+  nsresult rv = dbService->MarkMessageRead(aId, aValue, aSendReadReport,
+                                           msgCallback);
+  if (NS_FAILED(rv)) {
+    aRv.Throw(rv);
+    return nullptr;
+  }
 
-  request.forget(aRequest);
-  return NS_OK;
+  return request.forget();
 }
 
-NS_IMETHODIMP
-MobileMessageManager::GetThreads(nsIDOMDOMCursor** aCursor)
+already_AddRefed<DOMCursor>
+MobileMessageManager::GetThreads(ErrorResult& aRv)
 {
   nsCOMPtr<nsIMobileMessageDatabaseService> dbService =
     do_GetService(MOBILE_MESSAGE_DATABASE_SERVICE_CONTRACTID);
-  NS_ENSURE_TRUE(dbService, NS_ERROR_FAILURE);
+  if (!dbService) {
+    aRv.Throw(NS_ERROR_FAILURE);
+    return nullptr;
+  }
 
   nsRefPtr<MobileMessageCursorCallback> cursorCallback =
     new MobileMessageCursorCallback();
 
   nsCOMPtr<nsICursorContinueCallback> continueCallback;
   nsresult rv = dbService->CreateThreadCursor(cursorCallback,
                                               getter_AddRefs(continueCallback));
-  NS_ENSURE_SUCCESS(rv, rv);
+  if (NS_FAILED(rv)) {
+    aRv.Throw(rv);
+    return nullptr;
+  }
 
   cursorCallback->mDOMCursor = new DOMCursor(GetOwner(), continueCallback);
-  NS_ADDREF(*aCursor = cursorCallback->mDOMCursor);
 
-  return NS_OK;
+  nsRefPtr<DOMCursor> cursor = cursorCallback->mDOMCursor;
+  return cursor.forget();
 }
 
-NS_IMETHODIMP
-MobileMessageManager::RetrieveMMS(int32_t id,
-                                  nsIDOMDOMRequest** aRequest)
+already_AddRefed<DOMRequest>
+MobileMessageManager::RetrieveMMS(int32_t aId,
+                                  ErrorResult& aRv)
 {
-    nsCOMPtr<nsIMmsService> mmsService = do_GetService(MMS_SERVICE_CONTRACTID);
-    NS_ENSURE_TRUE(mmsService, NS_ERROR_FAILURE);
+  nsCOMPtr<nsIMmsService> mmsService = do_GetService(MMS_SERVICE_CONTRACTID);
+  if (!mmsService) {
+    aRv.Throw(NS_ERROR_FAILURE);
+    return nullptr;
+  }
+
+  nsRefPtr<DOMRequest> request = new DOMRequest(GetOwner());
+  nsCOMPtr<nsIMobileMessageCallback> msgCallback = new MobileMessageCallback(request);
 
-    nsRefPtr<DOMRequest> request = new DOMRequest(GetOwner());
-    nsCOMPtr<nsIMobileMessageCallback> msgCallback = new MobileMessageCallback(request);
+  nsresult rv = mmsService->Retrieve(aId, msgCallback);
+  if (NS_FAILED(rv)) {
+    aRv.Throw(rv);
+    return nullptr;
+  }
+
+  return request.forget();
+}
 
-    nsresult rv = mmsService->Retrieve(id, msgCallback);
-    NS_ENSURE_SUCCESS(rv, rv);
+already_AddRefed<DOMRequest>
+MobileMessageManager::RetrieveMMS(nsIDOMMozMmsMessage* aMessage,
+                                  ErrorResult& aRv)
+{
+  int32_t id;
 
-    request.forget(aRequest);
-    return NS_OK;
+  DebugOnly<nsresult> rv = aMessage->GetId(&id);
+  MOZ_ASSERT(NS_SUCCEEDED(rv));
+
+  return RetrieveMMS(id, aRv);
 }
 
 nsresult
 MobileMessageManager::DispatchTrustedSmsEventToSelf(const char* aTopic,
                                                     const nsAString& aEventName,
                                                     nsISupports* aMsg)
 {
   nsCOMPtr<nsIDOMMozSmsMessage> sms = do_QueryInterface(aMsg);
@@ -546,32 +556,44 @@ MobileMessageManager::Observe(nsISupport
 
   if (!strcmp(aTopic, kSmsReadErrorObserverTopic)) {
     return DispatchTrustedSmsEventToSelf(aTopic, READ_ERROR_EVENT_NAME, aSubject);
   }
 
   return NS_OK;
 }
 
-NS_IMETHODIMP
-MobileMessageManager::GetSmscAddress(uint32_t aServiceId, uint8_t aArgc,
-                                     nsIDOMDOMRequest** aRequest)
+already_AddRefed<DOMRequest>
+MobileMessageManager::GetSmscAddress(const Optional<uint32_t>& aServiceId,
+                                     ErrorResult& aRv)
 {
   nsCOMPtr<nsISmsService> smsService = do_GetService(SMS_SERVICE_CONTRACTID);
-  NS_ENSURE_TRUE(smsService, NS_ERROR_FAILURE);
+  if (!smsService) {
+    aRv.Throw(NS_ERROR_FAILURE);
+    return nullptr;
+  }
 
+  // Use the default one unless |aSendParams.serviceId| is available.
+  uint32_t serviceId;
   nsresult rv;
-  if (aArgc != 1) {
-    rv = smsService->GetSmsDefaultServiceId(&aServiceId);
-    NS_ENSURE_SUCCESS(rv, rv);
+  if (aServiceId.WasPassed()) {
+    serviceId = aServiceId.Value();
+  } else {
+    rv = smsService->GetSmsDefaultServiceId(&serviceId);
+    if (NS_FAILED(rv)) {
+      aRv.Throw(rv);
+      return nullptr;
+    }
   }
 
   nsRefPtr<DOMRequest> request = new DOMRequest(GetOwner());
   nsCOMPtr<nsIMobileMessageCallback> msgCallback = new MobileMessageCallback(request);
-  rv = smsService->GetSmscAddress(aServiceId, msgCallback);
-  NS_ENSURE_SUCCESS(rv, rv);
+  rv = smsService->GetSmscAddress(serviceId, msgCallback);
+  if (NS_FAILED(rv)) {
+    aRv.Throw(rv);
+    return nullptr;
+  }
 
-  request.forget(aRequest);
-  return NS_OK;
+  return request.forget();
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/mobilemessage/src/MobileMessageManager.h
+++ b/dom/mobilemessage/src/MobileMessageManager.h
@@ -1,57 +1,161 @@
 /* -*- 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_MobileMessageManager_h
 #define mozilla_dom_mobilemessage_MobileMessageManager_h
 
+#include "mozilla/Attributes.h"
+#include "mozilla/dom/UnionTypes.h"
 #include "mozilla/DOMEventTargetHelper.h"
-#include "nsIDOMMobileMessageManager.h"
 #include "nsIObserver.h"
 
+class nsISmsService;
 class nsIDOMMozSmsMessage;
 class nsIDOMMozMmsMessage;
+class nsIDOMMozSmsFilter;
 
 namespace mozilla {
 namespace dom {
 
-class MobileMessageManager : public DOMEventTargetHelper
-                           , public nsIDOMMozMobileMessageManager
-                           , public nsIObserver
+class DOMRequest;
+class DOMCursor;
+struct MmsParameters;
+struct MmsSendParameters;
+struct SmsSendParameters;
+
+class MobileMessageManager MOZ_FINAL : public DOMEventTargetHelper
+                                     , public nsIObserver
 {
 public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIOBSERVER
-  NS_DECL_NSIDOMMOZMOBILEMESSAGEMANAGER
 
   NS_REALLY_FORWARD_NSIDOMEVENTTARGET(DOMEventTargetHelper)
 
-  void Init(nsPIDOMWindow *aWindow);
+  MobileMessageManager(nsPIDOMWindow* aWindow);
+
+  void Init();
   void Shutdown();
 
+  nsPIDOMWindow*
+  GetParentObject() const { return GetOwner(); }
+
+  // WrapperCache
+  virtual JSObject*
+  WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+
+  // WebIDL Interface
+  already_AddRefed<DOMRequest>
+  GetSegmentInfoForText(const nsAString& aText,
+                        ErrorResult& aRv);
+
+  already_AddRefed<DOMRequest>
+  Send(const nsAString& aNumber,
+       const nsAString& aText,
+       const SmsSendParameters& aSendParams,
+       ErrorResult& aRv);
+
+  void
+  Send(const Sequence<nsString>& aNumbers,
+       const nsAString& aText,
+       const SmsSendParameters& aSendParams,
+       nsTArray<nsRefPtr<DOMRequest>>& aReturn,
+       ErrorResult& aRv);
+
+  already_AddRefed<DOMRequest>
+  SendMMS(const MmsParameters& aParameters,
+          const MmsSendParameters& aSendParams,
+          ErrorResult& aRv);
+
+  already_AddRefed<DOMRequest>
+  GetMessage(int32_t aId,
+             ErrorResult& aRv);
+
+  already_AddRefed<DOMRequest>
+  Delete(int32_t aId,
+         ErrorResult& aRv);
+
+  already_AddRefed<DOMRequest>
+  Delete(nsIDOMMozSmsMessage* aMessage,
+         ErrorResult& aRv);
+
+  already_AddRefed<DOMRequest>
+  Delete(nsIDOMMozMmsMessage* aMessage,
+         ErrorResult& aRv);
+
+  already_AddRefed<DOMRequest>
+  Delete(const Sequence<OwningLongOrMozSmsMessageOrMozMmsMessage>& aParams,
+         ErrorResult& aRv);
+
+  already_AddRefed<DOMCursor>
+  GetMessages(nsIDOMMozSmsFilter* aFilter,
+              bool aReverse,
+              ErrorResult& aRv);
+
+  already_AddRefed<DOMRequest>
+  MarkMessageRead(int32_t aId,
+                  bool aRead,
+                  bool aSendReadReport,
+                  ErrorResult& aRv);
+
+  already_AddRefed<DOMCursor>
+  GetThreads(ErrorResult& aRv);
+
+  already_AddRefed<DOMRequest>
+  RetrieveMMS(int32_t aId,
+              ErrorResult& aRv);
+
+  already_AddRefed<DOMRequest>
+  RetrieveMMS(nsIDOMMozMmsMessage* aMessage,
+              ErrorResult& aRv);
+
+  already_AddRefed<DOMRequest>
+  GetSmscAddress(const Optional<uint32_t>& aServiceId,
+                 ErrorResult& aRv);
+
+  IMPL_EVENT_HANDLER(received)
+  IMPL_EVENT_HANDLER(retrieving)
+  IMPL_EVENT_HANDLER(sending)
+  IMPL_EVENT_HANDLER(sent)
+  IMPL_EVENT_HANDLER(failed)
+  IMPL_EVENT_HANDLER(deliverysuccess)
+  IMPL_EVENT_HANDLER(deliveryerror)
+  IMPL_EVENT_HANDLER(readsuccess)
+  IMPL_EVENT_HANDLER(readerror)
+
 private:
   /**
    * Internal Send() method used to send one message.
    */
-  nsresult Send(JSContext* aCx, JS::Handle<JSObject*> aGlobal,
-                uint32_t aServiceId,
-                JS::Handle<JSString*> aNumber,
-                const nsAString& aMessage,
-                JS::MutableHandle<JS::Value> aRequest);
+  already_AddRefed<DOMRequest>
+  Send(nsISmsService* aSmsService,
+       uint32_t aServiceId,
+       const nsAString& aNumber,
+       const nsAString& aText,
+       ErrorResult& aRv);
 
-  nsresult DispatchTrustedSmsEventToSelf(const char* aTopic,
-                                         const nsAString& aEventName,
-                                         nsISupports* aMsg);
+  already_AddRefed<DOMRequest>
+  Delete(int32_t* aIdArray,
+         uint32_t aSize,
+         ErrorResult& aRv);
+
+  nsresult
+  DispatchTrustedSmsEventToSelf(const char* aTopic,
+                                const nsAString& aEventName,
+                                nsISupports* aMsg);
 
   /**
    * Helper to get message ID from SMS/MMS Message object
    */
-  nsresult GetMessageId(JSContext* aCx, const JS::Value& aMessage,
-                        int32_t* aId);
+  nsresult
+  GetMessageId(JSContext* aCx,
+               const JS::Value& aMessage,
+               int32_t* aId);
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_mobilemessage_MobileMessageManager_h
--- a/dom/mobilemessage/src/ipc/SmsIPCService.cpp
+++ b/dom/mobilemessage/src/ipc/SmsIPCService.cpp
@@ -7,18 +7,17 @@
 #include "SmsIPCService.h"
 #include "nsXULAppAPI.h"
 #include "mozilla/dom/mobilemessage/SmsChild.h"
 #include "SmsMessage.h"
 #include "SmsFilter.h"
 #include "SmsSegmentInfo.h"
 #include "nsJSUtils.h"
 #include "nsCxPusher.h"
-#include "mozilla/dom/MobileMessageManagerBinding.h"
-#include "mozilla/dom/MozMmsMessageBinding.h"
+#include "mozilla/dom/MozMobileMessageManagerBinding.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/Preferences.h"
 #include "nsString.h"
 
 using namespace mozilla::dom;
 using namespace mozilla::dom::mobilemessage;
 
 namespace {
--- a/dom/mobilemessage/tests/marionette/head.js
+++ b/dom/mobilemessage/tests/marionette/head.js
@@ -1,16 +1,39 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 const {Cc: Cc, Ci: Ci, Cr: Cr, Cu: Cu} = SpecialPowers;
 
 let Promise = Cu.import("resource://gre/modules/Promise.jsm").Promise;
 
 /**
+ * Push a list of preference settings. Never reject.
+ *
+ * Fulfill params: (none)
+ *
+ * @param aPrefs
+ *        An JS object.  For example:
+ *
+ *          {'set': [['foo.bar', 2], ['magic.pref', 'baz']],
+ *           'clear': [['clear.this'], ['also.this']] };
+ *
+ * @return A deferred promise.
+ */
+function pushPrefEnv(aPrefs) {
+  let deferred = Promise.defer();
+
+  SpecialPowers.pushPrefEnv(aPrefs, function() {
+    deferred.resolve();
+  });
+
+  return deferred.promise;
+}
+
+/**
  * Push required permissions and test if |navigator.mozMobileMessage| exists.
  * Resolve if it does, reject otherwise.
  *
  * Fulfill params:
  *   manager -- an reference to navigator.mozMobileMessage.
  *
  * Reject params: (none)
  *
@@ -49,26 +72,34 @@ function ensureMobileMessage() {
  * Wait for one named MobileMessageManager event.
  *
  * Resolve if that named event occurs.  Never reject.
  *
  * Fulfill params: the DOMEvent passed.
  *
  * @param aEventName
  *        A string event name.
+ * @param aMatchFunc [optional]
+ *        An additional callback function to match the interested event
+ *        before removing the listener and going to resolve the promise.
  *
  * @return A deferred promise.
  */
-function waitForManagerEvent(aEventName) {
+function waitForManagerEvent(aEventName, aMatchFunc) {
   let deferred = Promise.defer();
 
   manager.addEventListener(aEventName, function onevent(aEvent) {
-    manager.removeEventListener(aEventName, onevent);
+    if (aMatchFunc && !aMatchFunc(aEvent)) {
+      ok(true, "MobileMessageManager event '" + aEventName + "' got" +
+               " but is not interested.");
+      return;
+    }
 
     ok(true, "MobileMessageManager event '" + aEventName + "' got.");
+    manager.removeEventListener(aEventName, onevent);
     deferred.resolve(aEvent);
   });
 
   return deferred.promise;
 }
 
 /**
  * Wrap DOMRequest onsuccess/onerror events to Promise resolve/reject.
@@ -180,16 +211,34 @@ function sendMmsWithFailure(aMmsParamete
           (aEvent) => { return aEvent.target.error; }));
 
   return Promise.all(promises)
     .then((aResults) => { return { message: aResults[0],
                                    error: aResults[1] }; });
 }
 
 /**
+ * Retrieve message by message id.
+ *
+ * Fulfill params: MozSmsMessage
+ * Reject params:
+ *   event -- a DOMEvent
+ *
+ * @param aId
+ *        A numeric message id.
+ *
+ * @return A deferred promise.
+ */
+function getMessage(aId) {
+  let request = manager.getMessage(aId);
+  return wrapDomRequestAsPromise(request)
+    .then((aEvent) => { return aEvent.target.result; });
+}
+
+/**
  * Retrieve messages from database.
  *
  * Fulfill params:
  *   messages -- an array of {Sms,Mms}Message instances.
  *
  * Reject params:
  *   event -- a DOMEvent
  *
@@ -391,24 +440,49 @@ function runEmulatorCmdSafe(aCommand) {
  * Send simple text SMS to emulator.
  *
  * Fulfill params:
  *   result -- an array of emulator response lines.
  *
  * Reject params:
  *   result -- an array of emulator response lines.
  *
+ * @param aFrom
+ *        A string-typed from address.
+ * @param aText
+ *        A string-typed message body.
+ *
  * @return A deferred promise.
  */
 function sendTextSmsToEmulator(aFrom, aText) {
   let command = "sms send " + aFrom + " " + aText;
   return runEmulatorCmdSafe(command);
 }
 
 /**
+ * Send simple text SMS to emulator and wait for a received event.
+ *
+ * Fulfill params: MozSmsMessage
+ * Reject params: (none)
+ *
+ * @param aFrom
+ *        A string-typed from address.
+ * @param aText
+ *        A string-typed message body.
+ *
+ * @return A deferred promise.
+ */
+function sendTextSmsToEmulatorAndWait(aFrom, aText) {
+  let promises = [];
+  promises.push(waitForManagerEvent("received"));
+  promises.push(sendTextSmsToEmulator(aFrom, aText));
+  return Promise.all(promises).then(aResults => aResults[0].message);
+}
+
+/**
  * Send raw SMS TPDU to emulator.
  *
  * @param: aPdu
  *         A hex string representing the whole SMS T-PDU.
  *
  * Fulfill params:
  *   result -- an array of emulator response lines.
  *
@@ -460,25 +534,44 @@ function messagesToIds(aMessages) {
   let ids = [];
   for (let message of aMessages) {
     ids.push(message.id);
   }
   return ids;
 }
 
 /**
+ * Convenient function to compare two SMS messages.
+ */
+function compareSmsMessage(aFrom, aTo) {
+  const FIELDS = ["id", "threadId", "iccId", "body", "delivery",
+                  "deliveryStatus", "read", "receiver", "sender",
+                  "messageClass", "timestamp", "deliveryTimestamp",
+                  "sentTimestamp"];
+
+  for (let field of FIELDS) {
+    is(aFrom[field], aTo[field], "message." + field);
+  }
+}
+
+/**
  * Flush permission settings and call |finish()|.
  */
 function cleanUp() {
+  ok(true, ":: CLEANING UP ::");
+
   waitFor(function() {
     SpecialPowers.flushPermissions(function() {
-      // Use ok here so that we have at least one test run.
       ok(true, "permissions flushed");
 
-      finish();
+      SpecialPowers.flushPrefEnv(function() {
+        ok(true, "preferences flushed");
+
+        finish();
+      })
     });
   }, function() {
     return pendingEmulatorCmdCount === 0;
   });
 }
 
 /**
  * Basic test routine helper for mobile message tests.
--- a/dom/mobilemessage/tests/marionette/manifest.ini
+++ b/dom/mobilemessage/tests/marionette/manifest.ini
@@ -7,20 +7,18 @@ qemu = true
 [test_incoming.js]
 [test_outgoing.js]
 [test_emulator_loopback.js]
 [test_message_classes.js]
 [test_incoming_delete.js]
 [test_outgoing_delete.js]
 [test_getmessage.js]
 [test_getmessage_notfound.js]
-[test_incoming_multipart.js]
 [test_getmessages.js]
 [test_filter_date.js]
-[test_filter_date_notfound.js]
 [test_filter_number.js]
 [test_filter_received.js]
 [test_filter_sent.js]
 [test_filter_read.js]
 [test_filter_unread.js]
 [test_filter_mixed.js]
 [test_segment_info.js]
 [test_mark_msg_read.js]
--- a/dom/mobilemessage/tests/marionette/test_emulator_loopback.js
+++ b/dom/mobilemessage/tests/marionette/test_emulator_loopback.js
@@ -1,60 +1,39 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 MARIONETTE_TIMEOUT = 60000;
+MARIONETTE_HEAD_JS = 'head.js';
 
 const SELF = "5554";
 
-SpecialPowers.setBoolPref("dom.sms.enabled", true);
-SpecialPowers.addPermission("sms", true, document);
-
-function cleanUp() {
-  SpecialPowers.removePermission("sms", document);
-  SpecialPowers.clearUserPref("dom.sms.enabled");
-  finish();
-}
-
-let manager = window.navigator.mozMobileMessage;
-ok(manager instanceof MozMobileMessageManager,
-   "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);
 }
 
-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 test(aBody) {
+  let promises = [];
+
+  promises.push(waitForManagerEvent('received')
+    .then(function(aEvent) {
+      let message = aEvent.message;
+      is(message.body, aBody, "message.body");
+    }));
+
+  promises.push(sendSmsWithSuccess(SELF, aBody));
+
+  return Promise.all(promises);
 }
 
-function doTest(body, callback) {
-  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 = manager.send(SELF, body);
-  request.onerror = function onerror() {
-    ok(false, "failed to send message '" + body + "' to '" + SELF + "'");
-  };
-}
-
-repeat(doTest, [
+const TEST_DATA = [
   // Random alphanumeric string of 16 characters.
   randomString16(),
   // Long long text message for multipart messages.
   times(randomString16(), 100),
 
   // UCS2 string for the first sentence of "The Cooing", Classic of Poetry.
   "\u95dc\u95dc\u96ce\u9ce9\uff0c\u5728\u6cb3\u4e4b\u6d32\u3002",
   // Long long UCS2 text message for multipart messages.
@@ -70,9 +49,23 @@ repeat(doTest, [
   + "hec d whdvdj. Wh d'h\u00f4tel DVD. IMAX eusjw ii ce",
 
   // Android Emulator specific problems:
   // 1) wrong default 7Bit alphabet character for "Ň"(U+0147).
   "\u0147",
   // 2) problem in decoding strings encoded with GSM 7Bit Alphabets and
   // containing characters on extension tables.
   "\u20ac****",
-], cleanUp);
+];
+
+startTestBase(function testCaseMain() {
+  return ensureMobileMessage()
+    .then(function() {
+      let promise = Promise.resolve();
+
+      for (let i = 0; i < TEST_DATA.length; i++) {
+        let text = TEST_DATA[i];
+        promise = promise.then(() => test(text));
+      }
+
+      return promise;
+    });
+});
--- a/dom/mobilemessage/tests/marionette/test_filter_date.js
+++ b/dom/mobilemessage/tests/marionette/test_filter_date.js
@@ -1,194 +1,119 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 MARIONETTE_TIMEOUT = 60000;
-
-SpecialPowers.addPermission("sms", true, document);
-SpecialPowers.setBoolPref("dom.sms.enabled", true);
-
-let manager = window.navigator.mozMobileMessage;
-let numberMsgs = 10;
-let smsList = new Array();
-
-function verifyInitialState() {
-  log("Verifying initial state.");
-  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 = 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
-      cursor.continue();
-    } else {
-      // No (more) messages found
-      if (msgList.length) {
-        log("Found " + msgList.length + " SMS messages to delete.");
-        deleteMsgs(msgList, nextFunction);
-      } else {
-        log("No SMS messages found.");
-        nextFunction();
-      }
-    }
-  };
+MARIONETTE_HEAD_JS = 'head.js';
 
-  cursor.onerror = function(event) {
-    log("Received 'onerror' event.");
-    ok(event.target.error, "domerror obj");
-    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 = 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,"manager.delete request returned false");
-      cleanUp();
-    }
-  };
-
-  request.onerror = function(event) {
-    log("Received 'onerror' smsrequest event.");
-    ok(event.target.error, "domerror obj");
-    ok(false, "manager.delete request returned unexpected error: "
-        + event.target.error.name );
-    cleanUp();
-  };
-}
+const NUMBER_OF_MESSAGES = 10;
+const REMOTE = "5552229797";
 
 function simulateIncomingSms() {
-  let text = "Incoming SMS number " + (smsList.length + 1);
-  let remoteNumber = "5552229797";
-
-  log("Simulating incoming SMS number " + (smsList.length + 1) + " of "
-      + numberMsgs + ".");
+  let promise = Promise.resolve();
+  let messages = [];
 
-  // 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;
-  });
+  for (let i = 0; i < NUMBER_OF_MESSAGES; i++) {
+    let text = "Incoming SMS number " + i;
+    promise = promise.then(() => sendTextSmsToEmulatorAndWait(REMOTE, text))
+      .then(function(aMessage) {
+        messages.push(aMessage);
+        return messages;
+      });
+  }
+
+  return promise;
 }
 
-// Callback for incoming sms
-manager.onreceived = function onreceived(event) {
-  log("Received 'onreceived' sms event.");
-  let incomingSms = event.message;
-  log("Received SMS (id: " + incomingSms.id + ").");
-
-  smsList.push(incomingSms);
+function test(aStartDate, aEndDate, aExpectedMessages) {
+  let filter = new MozSmsFilter();
+  if (aStartDate) {
+    filter.startDate = aStartDate;
+  }
+  if (aEndDate) {
+    filter.endDate = aEndDate;
+  }
 
-  // Wait for emulator to catch up before continuing
-  waitFor(nextRep,function() {
-    return(rcvdEmulatorCallback);
-  });
-};
+  return getMessages(filter, false)
+    .then(function(aFoundMessages) {
+      log("  Found " + aFoundMessages.length + " messages, expected " +
+          aExpectedMessages.length);
+      is(aFoundMessages.length, aExpectedMessages.length, "aFoundMessages.length");
+    });
+}
 
-function nextRep() {
-  if (smsList.length < numberMsgs) {
-    simulateIncomingSms();
-  } else {
-    // Now test the filter
-    getMsgs();
-  }
+function reduceMessages(aMessages, aCompare) {
+  return aMessages.reduce(function(results, message) {
+    if (aCompare(message.timestamp)) {
+      results.push(message);
+    }
+    return results;
+  }, []);
 }
 
-function getMsgs() {
-  var filter = new MozSmsFilter();
-  let foundSmsList = new Array();
+startTestCommon(function testCaseMain() {
+  let startTime, endTime;
+  let allMessages;
+
+  return simulateIncomingSms()
+    .then((aMessages) => {
+      allMessages = aMessages;
+      startTime = aMessages[0].timestamp;
+      endTime = aMessages[NUMBER_OF_MESSAGES - 1].timestamp;
+      log("startTime: " + startTime + ", endTime: " + endTime);
+    })
 
-  // 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;
+    // Should return all messages.
+    //
+    .then(() => log("Testing [startTime, )"))
+    .then(() => test(new Date(startTime), null, allMessages))
+    .then(() => log("Testing (, endTime]"))
+    .then(() => test(null, new Date(endTime), allMessages))
+    .then(() => log("Testing [startTime, endTime]"))
+    .then(() => test(new Date(startTime), new Date(endTime), allMessages))
 
-  log("Getting SMS messages with dates between " + yesterday + " and "
-      + tomorrow +".");
-  let cursor = manager.getMessages(filter, false);
-  ok(cursor instanceof DOMCursor,
-      "cursor is instanceof " + cursor.constructor);
-
-  cursor.onsuccess = function(event) {
-    log("Received 'onsuccess' event.");
+    // Should return only messages with timestamp <= startTime.
+    //
+    .then(() => log("Testing [, startTime)"))
+    .then(() => test(null, new Date(startTime),
+                     reduceMessages(allMessages,
+                                    (function(a, b) {
+                                      return b <= a;
+                                    }).bind(null, startTime))))
 
-    if (cursor.result) {
-      // Another message found
-      log("Got SMS (id: " + cursor.result.id + ").");
-      // Store found message
-      foundSmsList.push(cursor.result);
-      // Now get next message in the list
-      cursor.continue();
-    } else {
-      // No more messages; ensure correct number found
-      if (foundSmsList.length == smsList.length) {
-        log("SMS getMessages returned " + foundSmsList.length +
-            " messages as expected.");
-        verifyFoundMsgs(foundSmsList);
-      } else {
-        log("SMS getMessages returned " + foundSmsList.length +
-            " messages, but expected " + smsList.length + ".");
-        ok(false, "Incorrect number of messages returned by manager.getMessages");
-        deleteAllMsgs(cleanUp);
-      }
-    }
-  };
+    // Should return only messages with timestamp <= startTime + 1.
+    //
+    .then(() => log("Testing [, startTime + 1)"))
+    .then(() => test(null, new Date(startTime + 1),
+                     reduceMessages(allMessages,
+                                    (function(a, b) {
+                                      return b <= a;
+                                    }).bind(null, startTime + 1))))
+
+    // Should return only messages with timestamp >= endTime.
+    //
+    .then(() => log("Testing [endTime, )"))
+    .then(() => test(new Date(endTime), null,
+                     reduceMessages(allMessages,
+                                    (function(a, b) {
+                                      return b >= a;
+                                    }).bind(null, endTime))))
 
-  cursor.onerror = function(event) {
-    log("Received 'onerror' event.");
-    ok(event.target.error, "domerror obj");
-    log("manager.getMessages error: " + event.target.error.name);
-    ok(false,"Could not get SMS messages");
-    cleanUp();
-  };
-}
+    // Should return only messages with timestamp >= endTime - 1.
+    //
+    .then(() => log("Testing [endTime - 1, )"))
+    .then(() => test(new Date(endTime - 1), null,
+                     reduceMessages(allMessages,
+                                    (function(a, b) {
+                                      return b >= a;
+                                    }).bind(null, endTime - 1))))
 
-function verifyFoundMsgs(foundSmsList) {
-  for (var x = 0; x < foundSmsList.length; x++) {
-    is(foundSmsList[x].id, smsList[x].id, "id");
-    is(foundSmsList[x].timestamp, smsList[x].timestamp, "timestmap");
-  }
-  deleteAllMsgs(cleanUp);
-}
-
-function cleanUp() {
-  manager.onreceived = null;
-  SpecialPowers.removePermission("sms", document);
-  SpecialPowers.clearUserPref("dom.sms.enabled");
-  finish();
-}
-
-// Start the test
-verifyInitialState();
+    // Should return none.
+    //
+    .then(() => log("Testing [endTime + 1, )"))
+    .then(() => test(new Date(endTime + 1), null, []))
+    .then(() => log("Testing [endTime + 1, endTime + 86400000]"))
+    .then(() => test(new Date(endTime + 1), new Date(endTime + 86400000), []))
+    .then(() => log("Testing (, startTime - 1]"))
+    .then(() => test(null, new Date(startTime - 1), []))
+    .then(() => log("Testing [startTime - 86400000, startTime - 1]"))
+    .then(() => test(new Date(startTime - 86400000), new Date(startTime - 1), []));
+});
deleted file mode 100644
--- a/dom/mobilemessage/tests/marionette/test_filter_date_notfound.js
+++ /dev/null
@@ -1,176 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-MARIONETTE_TIMEOUT = 60000;
-
-SpecialPowers.addPermission("sms", true, document);
-SpecialPowers.setBoolPref("dom.sms.enabled", true);
-
-let manager = window.navigator.mozMobileMessage;
-let numberMsgs = 10;
-let smsList = new Array();
-
-function verifyInitialState() {
-  log("Verifying initial state.");
-  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 = 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
-      cursor.continue();
-    } else {
-      // No (more) messages found
-      if (msgList.length) {
-        log("Found " + msgList.length + " SMS messages to delete.");
-        deleteMsgs(msgList, nextFunction);
-      } else {
-        log("No SMS messages found.");
-        nextFunction();
-      }
-    }
-  };
-
-  cursor.onerror = function(event) {
-    log("Received 'onerror' event.");
-    ok(event.target.error, "domerror obj");
-    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 = 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,"manager.delete request returned false");
-      cleanUp();
-    }
-  };
-
-  request.onerror = function(event) {
-    log("Received 'onerror' smsrequest event.");
-    ok(event.target.error, "domerror obj");
-    ok(false, "manager.delete request returned unexpected error: "
-        + event.target.error.name );
-    cleanUp();
-  };
-}
-
-function simulateIncomingSms() {
-  let text = "Incoming SMS number " + (smsList.length + 1);
-  let remoteNumber = "5552229797";
-
-  log("Simulating incoming SMS number " + (smsList.length + 1) + " of "
-      + numberMsgs + ".");
-
-  // 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;
-  });
-}
-
-// Callback for incoming sms
-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() {
-    return(rcvdEmulatorCallback);
-  });
-};
-
-function nextRep() {
-  if (smsList.length < numberMsgs) {
-    simulateIncomingSms();
-  } else {
-    // Now test the filter
-    getMsgs();
-  }
-}
-
-function getMsgs() {
-  var filter = new MozSmsFilter();
-  let foundSmsList = new Array();
-
-  // Set filter for start date 2 days ago and end date yesterday (so 0 found)
-  let yesterday = new Date(Date.now() - 86400000); // 24 hours = 86400000 ms
-  let twoDaysAgo = new Date(Date.now() - 172800000);
-  filter.startDate = twoDaysAgo;
-  filter.endDate = yesterday;
-
-  log("Getting SMS messages with dates between " + twoDaysAgo + " and "
-      + yesterday +".");
-  let cursor = manager.getMessages(filter, false);
-  ok(cursor instanceof DOMCursor,
-      "cursor is instanceof " + cursor.constructor);
-
-  cursor.onsuccess = function(event) {
-    log("Received 'onsuccess' event.");
-
-    if (cursor.result) {
-      // Another message found
-      log("Got SMS (id: " + cursor.result.id + ").");
-      log("SMS getMessages returned a message but should not have.");
-      ok(false, "SMS date filter did not work");
-    } else {
-      // No messages found as expected
-      log("SMS getMessages returned zero messages as expected.");
-    }
-    deleteAllMsgs(cleanUp);
-  };
-
-  cursor.onerror = function(event) {
-    log("Received 'onerror' event.");
-    ok(event.target.error, "domerror obj");
-    log("manager.getMessages error: " + event.target.error.name);
-    ok(false,"Could not get SMS messages");
-    cleanUp();
-  };
-}
-
-function cleanUp() {
-  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
@@ -1,228 +1,31 @@
 /* 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.setBoolPref("dom.sms.requestStatusReport", true);
-SpecialPowers.addPermission("sms", true, document);
+MARIONETTE_HEAD_JS = 'head.js';
 
 const REMOTE = "5559997777"; // the remote number
 const EMULATOR = "15555215554"; // the emulator's number
 
-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 inSmsSentTimeStamp;
-let outSmsTimeStamp;
-let outSmsSentTimeStamp;
-
-function verifyInitialState() {
-  log("Verifying initial state.");
-  ok(manager instanceof MozMobileMessageManager,
-     "manager is instance of " + manager.constructor);
-  simulateIncomingSms();  
-}
-
-function simulateIncomingSms() {
-  log("Simulating incoming SMS.");
-
-  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");
-    is(incomingSms.delivery, "received", "delivery");
-    is(incomingSms.deliveryStatus, "success", "deliveryStatus");
-    is(incomingSms.read, false, "read");
-    is(incomingSms.receiver, EMULATOR, "receiver");
-    is(incomingSms.sender, REMOTE, "sender");
-    is(incomingSms.messageClass, "normal", "messageClass");
-    inSmsTimeStamp = incomingSms.timestamp;
-    inSmsSentTimeStamp = incomingSms.sentTimestamp;
-    sendSms();
-  };
-  // Simulate incoming sms sent from remoteNumber to our emulator
-  runEmulatorCmd("sms send " + REMOTE + " " + inText, function(result) {
-    is(result[0], "OK", "emulator output");
-  });
-}
+const IN_TEXT = "Incoming SMS message. Mozilla Firefox OS!";
+const OUT_TEXT = "Outgoing SMS message. Mozilla Firefox OS!";
 
-function sendSms() {
-  log("Sending an SMS.");
-  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;
-    is(sentSms.body, outText, "msg body");
-    is(sentSms.delivery, "sent", "delivery");
-    is(sentSms.deliveryStatus, "pending", "deliveryStatus");
-    is(sentSms.read, true, "read");
-    is(sentSms.receiver, REMOTE, "receiver");
-    is(sentSms.sender, EMULATOR, "sender");
-    is(sentSms.messageClass, "normal", "messageClass");
-    outSmsTimeStamp = sentSms.timestamp;
-    outSmsSentTimeStamp = sentSms.sentTimestamp;
-    is(sentSms.deliveryTimestamp, 0, "deliveryTimestamp is 0");
-
-    if (gotSmsOnsent && gotReqOnsuccess) { getReceivedSms(); }
-  };
+startTestBase(function testCaseMain() {
+  let incomingSms, outgoingSms;
 
-  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 manager.send");
-      ok(false,"SMS send failed");
-      cleanUp();
-    }
-  };
+  return ensureMobileMessage()
 
-  requestRet.onerror = function(event) {
-    log("Received 'onerror' smsrequest event.");
-    ok(event.target.error, "domerror obj");
-    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 = manager.getMessage(inSmsId);
-  ok(requestRet, "smsrequest obj returned");
+    .then(() => sendTextSmsToEmulatorAndWait(REMOTE, IN_TEXT))
+    .then((aMessage) => { incomingSms = aMessage; })
 
-  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 + ").");
-    is(foundSms.threadId, inThreadId, "thread id matches");
-    is(foundSms.body, inText, "SMS msg text matches");
-    is(foundSms.delivery, "received", "delivery");
-    is(foundSms.deliveryStatus, "success", "deliveryStatus");
-    is(foundSms.read, false, "read");
-    is(foundSms.receiver, EMULATOR, "receiver");
-    is(foundSms.sender, REMOTE, "sender");
-    is(foundSms.messageClass, "normal", "messageClass");
-    is(foundSms.timestamp, inSmsTimeStamp, "timestamp matches");
-    is(foundSms.sentTimestamp, inSmsSentTimeStamp, "sentTimestamp matches");
-    getSentSms();
-  };
+    .then(() => sendSmsWithSuccess(REMOTE, OUT_TEXT))
+    .then((aMessage) => { outgoingSms = aMessage; })
 
-  requestRet.onerror = function(event) {
-    log("Received 'onerror' smsrequest event.");
-    ok(event.target.error, "domerror obj");
-    is(event.target.error.name, "NotFoundError", "error returned");
-    log("Could not get SMS (id: " + inSmsId + ") but should have.");
-    ok(false,"Could not get received SMS");
-    cleanUp();
-  };
-}
-
-function getSentSms() {
-  log("Getting the sent SMS message (id: " + outSmsId + ").");
-  let requestRet = manager.getMessage(outSmsId);
-  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 + ").");
-    is(foundSms.threadId, outThreadId, "thread id matches");
-    is(foundSms.body, outText, "SMS msg text matches");
-    is(foundSms.delivery, "sent", "delivery");
-    is(foundSms.deliveryStatus, "pending", "deliveryStatus");
-    is(foundSms.read, true, "read");
-    is(foundSms.receiver, REMOTE, "receiver");
-    is(foundSms.sender, EMULATOR, "sender");
-    is(foundSms.messageClass, "normal", "messageClass");
-    is(foundSms.timestamp, outSmsTimeStamp, "timestamp matches");
-    is(foundSms.sentTimestamp, outSmsSentTimeStamp, "sentTimestamp matches");
-    deleteMsgs();
-  };
+    .then(() => getMessage(incomingSms.id))
+    .then((aMessage) => compareSmsMessage(aMessage, incomingSms))
 
-  requestRet.onerror = function(event) {
-    log("Received 'onerror' smsrequest event.");
-    ok(event.target.error, "domerror obj");
-    is(event.target.error.name, "NotFoundError", "error returned");
-    log("Could not get SMS (id: " + outSmsId + ") but should have.");
-    ok(false,"Could not get sent SMS");
-    cleanUp();
-  };
-}
-
-function deleteMsgs() {
-  log("Deleting SMS (id: " + inSmsId + ").");
-  let requestRet = manager.delete(inSmsId);
-  ok(requestRet,"smsrequest obj returned");
-
-  requestRet.onsuccess = function(event) {
-    log("Received 'onsuccess' smsrequest event.");
-    if(event.target.result){
-      log("Deleting SMS (id: " + outSmsId + ").");
-      let nextReqRet = manager.delete(outSmsId);
-      ok(nextReqRet,"smsrequest obj returned");
+    .then(() => getMessage(outgoingSms.id))
+    .then((aMessage) => compareSmsMessage(aMessage, outgoingSms))
 
-      nextReqRet.onsuccess = function(event) {
-        log("Received 'onsuccess' smsrequest event.");
-        if(event.target.result) {
-          cleanUp();
-        } else {
-          log("smsrequest returned false for manager.delete");
-          ok(false,"SMS delete failed");
-        }
-      };
-    } else {
-      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, "manager.delete request returned unexpected error: "
-        + event.target.error.name );
-    cleanUp();
-  };
-}
-
-function cleanUp() {
-  manager.onreceived = null;
-  SpecialPowers.removePermission("sms", document);
-  SpecialPowers.clearUserPref("dom.sms.enabled");
-  SpecialPowers.clearUserPref("dom.sms.requestStatusReport");
-
-  finish();
-}
-
-// Start the test
-verifyInitialState();
+    .then(deleteAllMessages);
+});
--- a/dom/mobilemessage/tests/marionette/test_getmessage_notfound.js
+++ b/dom/mobilemessage/tests/marionette/test_getmessage_notfound.js
@@ -1,120 +1,50 @@
 /* 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);
+MARIONETTE_HEAD_JS = 'head.js';
 
-let manager = window.navigator.mozMobileMessage;
-let myNumber = "15555215554";
-let inText = "Incoming SMS message. Mozilla Firefox OS!";
-let remoteNumber = "5559997777";
-let inSmsId = 0;
+const TEXT = "Incoming SMS message. Mozilla Firefox OS!";
+const REMOTE = "5559997777";
 
-function verifyInitialState() {
-  log("Verifying initial state.");
-  ok(manager instanceof MozMobileMessageManager,
-     "manager is instance of " + manager.constructor);
-  simulateIncomingSms();  
-}
+function getNonExistentMsg(aId) {
+  log("Attempting to get non-existent message (id: " + aId + ").");
 
-function simulateIncomingSms() {
-  log("Simulating incoming SMS.");
-
-  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();
-  };
-  // Simulate incoming sms sent from remoteNumber to our emulator
-  runEmulatorCmd("sms send " + remoteNumber + " " + inText, function(result) {
-    is(result[0], "OK", "emulator output");
-  });
+  return getMessage(aId)
+    .then(function onresolve() {
+      ok(false, "request succeeded when tried to get non-existent sms");
+    }, function onreject(aEvent) {
+      let error = aEvent.target.error;
+      ok(error, "DOMError");
+      is(error.name, "NotFoundError", "error.name");
+    });
 }
 
-function getNonExistentMsg() {
-  let msgIdNoExist = inSmsId + 1;
-  log("Attempting to get non-existent message (id: " + 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");
-    getMsgInvalidId();
-  };
-
-  requestRet.onerror = function(event) {
-    log("Received 'onerror' smsrequest event.");
-    ok(event.target.error, "domerror obj");
-    is(event.target.error.name, "NotFoundError", "error returned");
-    log("Could not get SMS (id: " + msgIdNoExist + ") as expected.");
-    getMsgInvalidId();
-  };
-}  
+function getMsgInvalidId(aId) {
+  log("Attempting to get sms with invalid id (id: " + aId + ").");
 
-function getMsgInvalidId() {
-  invalidId = -1;
-  log("Attempting to get sms with invalid id (id: " + 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 " +
-    		"invalid id (id: " + invalidId + ").");
-    deleteMsg();
-  };
-
-  requestRet.onerror = function(event) {
-    log("Received 'onerror' smsrequest event.");
-    ok(event.target.error, "domerror obj");
-    is(event.target.error.name, "NotFoundError", "error returned");
-    log("Could not get SMS (id: -1) as expected.");
-    deleteMsg();
-  };
+  return getMessage(aId)
+    .then(function onresolve() {
+      ok(false, "request succeeded when tried to get message with " +
+                "invalid id (id: " + aId + ").");
+    }, function onreject(aEvent) {
+      let error = aEvent.target.error;
+      ok(error, "DOMError");
+      is(error.name, "NotFoundError", "error.name");
+    });
 }
 
-function deleteMsg() {
-  log("Deleting SMS (id: " + inSmsId + ").");
-  let requestRet = manager.delete(inSmsId);
-  ok(requestRet,"smsrequest obj returned");
+startTestBase(function testCaseMain() {
+  let lastMessageId;
 
-  requestRet.onsuccess = function(event) {
-    log("Received 'onsuccess' smsrequest event.");
-    if(event.target.result){
-      cleanUp();
-    }
-  };
+  return ensureMobileMessage()
 
-  requestRet.onerror = function(event) {
-    log("Received 'onerror' smsrequest event.");
-    ok(event.target.error, "domerror obj");
-    ok(false, "manager.delete request returned unexpected error: "
-        + event.target.error.name );
-    cleanUp();
-  };
-}
+    .then(() => sendTextSmsToEmulatorAndWait(REMOTE, TEXT))
+    .then((aMessage) => { lastMessageId = aMessage.id; })
 
-function cleanUp() {
-  manager.onreceived = null;
-  SpecialPowers.removePermission("sms", document);
-  SpecialPowers.setBoolPref("dom.sms.enabled", false);
-  finish();
-}
+    .then(() => getNonExistentMsg(lastMessageId + 1))
+    .then(() => getMsgInvalidId(-1))
+    .then(() => getMsgInvalidId(0))
 
-// Start the test
-verifyInitialState();
+    .then(deleteAllMessages);
+});
--- a/dom/mobilemessage/tests/marionette/test_getmessages.js
+++ b/dom/mobilemessage/tests/marionette/test_getmessages.js
@@ -1,227 +1,46 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 MARIONETTE_TIMEOUT = 60000;
-
-SpecialPowers.addPermission("sms", true, document);
-SpecialPowers.setBoolPref("dom.sms.enabled", true);
-
-let manager = window.navigator.mozMobileMessage;
-let numberMsgs = 10;
-let smsList = new Array();
-
-function verifyInitialState() {
-  log("Verifying initial state.");
-  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 = manager.getMessages(smsFilter, false);
-  ok(cursor instanceof DOMCursor,
-      "cursor is instanceof " + cursor.constructor);
+MARIONETTE_HEAD_JS = 'head.js';
 
-  cursor.onsuccess = function(event) {
-    // Check if message was found
-    if (cursor.result) {
-      msgList.push(cursor.result.id);
-      // Now get next message in the list
-      cursor.continue();
-    } else {
-      // No (more) messages found
-      if (msgList.length) {
-        log("Found " + msgList.length + " SMS messages to delete.");
-        deleteMsgs(msgList, nextFunction);
-      } else {
-        log("No SMS messages found.");
-        nextFunction();
-      }
-    }
-  };
-
-  cursor.onerror = function(event) {
-    log("Received 'onerror' event.");
-    ok(event.target.error, "domerror obj");
-    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 = 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,"manager.delete request returned false");
-      cleanUp();
-    }
-  };
-
-  request.onerror = function(event) {
-    log("Received 'onerror' smsrequest event.");
-    ok(event.target.error, "domerror obj");
-    ok(false, "manager.delete request returned unexpected error: "
-        + event.target.error.name );
-    cleanUp();
-  };
-}
+const NUMBER_OF_MESSAGES = 10;
+const REMOTE = "5552229797";
 
 function simulateIncomingSms() {
-  let text = "Incoming SMS number " + (smsList.length + 1);
-  let remoteNumber = "5552229797";
-
-  log("Simulating incoming SMS number " + (smsList.length + 1) + " of "
-      + numberMsgs + ".");
-
-  // 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;
-  });
-}
-
-// Callback for incoming sms
-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);
+  let promise = Promise.resolve();
+  let messages = [];
 
-  // Wait for emulator to catch up before continuing
-  waitFor(nextRep,function() {
-    return(rcvdEmulatorCallback);
-  });
-};
-
-function nextRep() {
-  if (smsList.length < numberMsgs) {
-    simulateIncomingSms();
-  } else {
-    log("Received " + numberMsgs + " sms messages in total.");
-    getMsgs(false);
-  }
-}
-
-function getMsgs(reverse) {
-  let smsFilter = new MozSmsFilter;
-  let foundSmsCount = 0;
-  let foundSmsList = new Array();
-
-  if (!reverse) {
-    log("Getting the sms messages.");
-  } else {
-    log("Getting the sms messages in reverse order.");
+  for (let i = 0; i< NUMBER_OF_MESSAGES; i++) {
+    let text = "Incoming SMS number " + i;
+    promise = promise.then(() => sendTextSmsToEmulatorAndWait(REMOTE, text))
+      .then(function(aMessage) {
+        messages.push(aMessage);
+        return messages;
+      });
   }
 
-  // Note: This test is intended for getMessages, so just a basic test with
-  // no filter (default); separate tests will be written for sms filtering
-  let cursor = manager.getMessages(smsFilter, reverse);
-  ok(cursor instanceof DOMCursor,
-      "cursor is instanceof " + cursor.constructor);
-
-  cursor.onsuccess = function(event) {
-    log("Received 'onsuccess' event.");
-
-    if (cursor.result) {
-      // Another message found
-      log("Got SMS (id: " + cursor.result.id + ").");
-      foundSmsCount++;
-      // Store found message
-      foundSmsList.push(cursor.result);
-      // Now get next message in the list
-      cursor.continue();
-    } else {
-      // No more messages; ensure correct number found
-      if (foundSmsCount == numberMsgs) {
-        log("SMS getMessages returned " + foundSmsCount +
-            " messages as expected.");  
-      } else {
-        log("SMS getMessages returned " + foundSmsCount +
-            " messages, but expected " + numberMsgs + ".");
-        ok(false, "Incorrect number of messages returned by manager.getMessages");
-      }
-      verifyFoundMsgs(foundSmsList, reverse);
-    }
-  };
-
-  cursor.onerror = function(event) {
-    log("Received 'onerror' event.");
-    ok(event.target.error, "domerror obj");
-    log("manager.getMessages error: " + event.target.error.name);
-    ok(false,"Could not get SMS messages");
-    cleanUp();
-  };
+  return promise;
 }
 
-function verifyFoundMsgs(foundSmsList, reverse) {
-  if (reverse) {
-    smsList.reverse();
-  }
-  for (var x = 0; x < numberMsgs; x++) {
-    is(foundSmsList[x].id, smsList[x].id, "id");
-    is(foundSmsList[x].threadId, smsList[x].threadId, "thread id");
-    is(foundSmsList[x].body, smsList[x].body, "body");
-    is(foundSmsList[x].delivery, smsList[x].delivery, "delivery");
-    is(foundSmsList[x].read, smsList[x].read, "read");
-
-    // Bug 805799: receiver null when onreceived event is fired, until do a
-    // getMessage. Default emulator (receiver) phone number is 15555215554
-    if (!smsList[x].receiver) {
-      isIn(foundSmsList[x].receiver, ["15555215554", "+15555215554"], "receiver");
-    } else {
-      isIn(foundSmsList[x].receiver, [smsList[x].receiver, "+15555215554"], "receiver");
-    }
-
-    isIn(foundSmsList[x].sender, [smsList[x].sender, "+15552229797"], "sender");
-    is(foundSmsList[x].timestamp, smsList[x].timestamp, "timestamp");
-    is(foundSmsList[x].sentTimestamp, smsList[x].sentTimestamp, "sentTimestamp");
+function verifyFoundMsgs(foundSmsList, smsList) {
+  for (let x = 0; x < NUMBER_OF_MESSAGES; x++) {
+    compareSmsMessage(foundSmsList[x], smsList[x]);
   }
 
   log("Content in all of the returned SMS messages is correct.");
-
-  if (!reverse) {
-    // Now get messages in reverse
-    getMsgs(true);
-  } else {
-    // Finished, delete all messages
-    deleteAllMsgs(cleanUp);
-  };
 }
 
-function cleanUp() {
-  manager.onreceived = null;
-  SpecialPowers.removePermission("sms", document);
-  SpecialPowers.clearUserPref("dom.sms.enabled");
-  finish();
-}
+startTestCommon(function testCaseMain() {
+  let incomingMessages;
+
+  return simulateIncomingSms()
+    .then((aMessages) => { incomingMessages = aMessages; })
 
-// Start the test
-verifyInitialState();
+    .then(() => getMessages(null, false))
+    .then((aFoundMessages) => verifyFoundMsgs(aFoundMessages, incomingMessages))
+
+    .then(() => getMessages(null, true))
+    .then((aFoundMessages) => verifyFoundMsgs(aFoundMessages,
+                                              incomingMessages.slice().reverse()));
+});
--- a/dom/mobilemessage/tests/marionette/test_getsegmentinfofortext.js
+++ b/dom/mobilemessage/tests/marionette/test_getsegmentinfofortext.js
@@ -72,31 +72,18 @@ function addTest(text, segments, charsPe
 
     domRequest.onerror = function(e) {
       ok(false, "Failed to call getSegmentInfoForText().");
       tasks.finish();
     };
   });
 }
 
-function addTestThrows(text) {
-  tasks.push(function() {
-    log("Testing '" + text + "' ...");
-    try {
-      let domRequest = manager.getSegmentInfoForText(text);
-
-      ok(false, "Not thrown.");
-      tasks.finish();
-    } catch (e) {
-      tasks.next();
-    }
-  });
-}
-
-addTestThrows(null);
+addTest(null, 1, PDU_MAX_USER_DATA_7BIT,
+        PDU_MAX_USER_DATA_7BIT - "null".length);
 
 // Testing "undefined".
 addTest(undefined, 1, PDU_MAX_USER_DATA_7BIT,
         PDU_MAX_USER_DATA_7BIT - "undefined".length);
 
 // Testing numeric values.
 addTest(0,   1, PDU_MAX_USER_DATA_7BIT, PDU_MAX_USER_DATA_7BIT - "0".length);
 addTest(1.0, 1, PDU_MAX_USER_DATA_7BIT, PDU_MAX_USER_DATA_7BIT - "1".length);
--- a/dom/mobilemessage/tests/marionette/test_incoming.js
+++ b/dom/mobilemessage/tests/marionette/test_incoming.js
@@ -1,51 +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);
+MARIONETTE_HEAD_JS = 'head.js';
 
 const SENDER = "5555552368"; // the remote number
 const RECEIVER = "15555215554"; // the emulator's number
 
-let manager = window.navigator.mozMobileMessage;
-ok(manager instanceof MozMobileMessageManager,
-   "manager is instance of " + manager.constructor);
-
-let body = "Hello SMS world!";
+const SHORT_BODY = "Hello SMS world!";
+const LONG_BODY = new Array(17).join(SHORT_BODY);
+ok(LONG_BODY.length > 160, "LONG_BODY.length");
 
-let completed = false;
-runEmulatorCmd("sms send " + SENDER + " " + body, function(result) {
-  log("Sent fake SMS: " + result);
-  is(result[0], "OK", "Emulator command result");
-  completed = true;
-});
+function checkMessage(aMessage, aBody) {
+  ok(aMessage instanceof MozSmsMessage, "Message is instanceof MozSmsMessage");
 
-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");
-  is(message.sender, SENDER, "Message sender");
-  is(message.receiver, RECEIVER, "Message receiver");
-  is(message.body, body, "Message body");
-  is(message.messageClass, "normal", "Message class");
-  is(message.deliveryTimestamp, 0, "deliveryTimestamp is 0");
-
-  cleanUp();
+  is(aMessage.type, "sms", "message.type");
+  ok(aMessage.id, "message.id");
+  ok(aMessage.threadId, "message.threadId");
+  ok(aMessage.iccId, "message.iccId");
+  is(aMessage.delivery, "received", "message.delivery");
+  is(aMessage.deliveryStatus, "success", "message.deliveryStatus");
+  is(aMessage.sender, SENDER, "message.sender");
+  is(aMessage.receiver, RECEIVER, "message.receiver");
+  is(aMessage.body, aBody, "message.body");
+  is(aMessage.messageClass, "normal", "message.messageClass");
+  ok(aMessage.timestamp, "message.timestamp");
+  is(aMessage.deliveryTimestamp, 0, "message.deliveryTimestamp");
+  ok(aMessage.sentTimestamp, "message.sentTimestamp");
+  is(aMessage.read, false, "message.read");
 };
 
-function cleanUp() {
-  if (!completed) {
-    window.setTimeout(cleanUp, 100);
-    return;
-  }
+function test(aBody) {
+  return sendTextSmsToEmulatorAndWait(SENDER, aBody)
+    .then((aMessage) => checkMessage(aMessage, aBody));
+}
 
-  SpecialPowers.removePermission("sms", document);
-  finish();
-}
+startTestBase(function testCaseMain() {
+  return ensureMobileMessage()
+    .then(() => test(SHORT_BODY))
+    .then(() => test(LONG_BODY));
+});
deleted file mode 100644
--- a/dom/mobilemessage/tests/marionette/test_incoming_multipart.js
+++ /dev/null
@@ -1,115 +0,0 @@
-/* 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);
-
-const SENDER = "5555552368"; // the remote number
-const RECEIVER = "15555215554"; // the emulator's number
-
-let manager = window.navigator.mozMobileMessage;
-
-function verifyInitialState() {
-  log("Verifying initial state.");
-  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 ';
-  }
-
-  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");
-    is(incomingSms.receiver, RECEIVER, "receiver");
-    is(incomingSms.sender, SENDER, "sender");
-    is(incomingSms.deliveryTimestamp, 0, "deliveryTimestamp is 0");
-
-    verifySmsExists(incomingSms);
-  };
-  runEmulatorCmd("sms send " + SENDER + " " + msgText, function(result) {
-    is(result[0], "OK", "emulator output");
-  });
-}
-
-function verifySmsExists(incomingSms) {
-  log("Getting SMS (id: " + incomingSms.id + ").");
-  let requestRet = manager.getMessage(incomingSms.id);
-  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");
-    is(foundSms.body, incomingSms.body, "found SMS msg text matches");
-    is(foundSms.delivery, "received", "delivery");
-    is(foundSms.read, false, "read");
-    is(foundSms.receiver, RECEIVER, "receiver");
-    is(foundSms.sender, SENDER, "sender");
-    log("Got SMS (id: " + foundSms.id + ") as expected.");
-    deleteSms(incomingSms);
-  };
-
-  requestRet.onerror = function(event) {
-    log("Received 'onerror' smsrequest event.");
-    ok(event.target.error, "domerror obj");
-    is(event.target.error.name, "NotFoundError", "error returned");
-    log("Could not get SMS (id: " + incomingSms.id + ") but should have.");
-    ok(false,"SMS was not found");
-    cleanUp();
-  };
-}
-
-function deleteSms(smsMsgObj){
-  log("Deleting SMS (id: " + smsMsgObj.id + ") using smsmsg obj parameter.");
-  let requestRet = manager.delete(smsMsgObj);
-  ok(requestRet,"smsrequest obj returned");
-
-  requestRet.onsuccess = function(event) {
-    log("Received 'onsuccess' smsrequest event.");
-    if(event.target.result){
-      cleanUp();
-    } else {
-      log("smsrequest returned false for manager.delete");
-      ok(false,"SMS delete failed");
-      cleanUp();
-    }
-  };
-
-  requestRet.onerror = function(event) {
-    log("Received 'onerror' smsrequest event.");
-    ok(event.target.error, "domerror obj");
-    ok(false, "manager.delete request returned unexpected error: "
-        + event.target.error.name );
-    cleanUp();
-  };
-}
-
-function cleanUp() {
-  manager.onreceived = null;
-  SpecialPowers.removePermission("sms", document);
-  SpecialPowers.clearUserPref("dom.sms.enabled");
-  finish();
-}
-
-// Start the test
-verifyInitialState();
--- a/dom/mobilemessage/tests/marionette/test_outgoing.js
+++ b/dom/mobilemessage/tests/marionette/test_outgoing.js
@@ -1,24 +1,16 @@
 /* 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.setBoolPref("dom.sms.strict7BitEncoding", false);
-SpecialPowers.setBoolPref("dom.sms.requestStatusReport", true);
-SpecialPowers.addPermission("sms", true, document);
+MARIONETTE_HEAD_JS = 'head.js';
 
 const SENDER = "15555215554"; // the emulator's number
 
-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"
@@ -30,18 +22,20 @@ const LONG_BODY = "Let me not to the mar
                 + "If this be error and upon me proved,\n"
                 + "I never writ, nor no man ever loved. ";
 
 function checkMessage(message, delivery, body) {
   ok(message, "message is valid");
   ok(message instanceof MozSmsMessage,
      "message is instanceof " + message.constructor);
 
+  is(message.type, "sms", "message.type");
   ok(message.id, "message.id");
   ok(message.threadId, "message.threadId");
+  ok(message.iccId, "message.iccId");
   is(message.delivery, delivery, "message.delivery");
   is(message.deliveryStatus, "pending", "message.deliveryStatus");
   is(message.sender, SENDER, "message.sender");
   ok(message.receiver, "message.receiver");
   is(message.body, body, "message.body");
   is(message.messageClass, "normal", "message.messageClass");
   is(message.read, true, "message.read");
 
@@ -51,153 +45,110 @@ function checkMessage(message, delivery,
   // Test message.sentTimestamp.
   if (message.delivery == "sending") {
     ok(message.sentTimestamp == 0, "message.sentTimestamp should be 0");
   } else if (message.delivery == "sent") {
     ok(message.sentTimestamp != 0, "message.sentTimestamp shouldn't be 0");
   }
 }
 
-function doSendMessageAndCheckSuccess(receivers, body, callback) {
-  let options = {};
-  let now = Date.now();
+function isReceiverMatch(aReceiver, aEvent) {
+  // Bug 838542: following check throws an exception and fails this case.
+  // ok(event instanceof MozSmsEvent,
+  //    "event is instanceof " + event.constructor)
+  ok(aEvent, "sending event is valid");
 
-  function done() {
-    let rs = Array.isArray(receivers) ? receivers : [receivers];
-    // 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;
-      }
-    }
+  let message = aEvent.message;
+  return message.receiver === aReceiver;
+}
 
-    manager.removeEventListener("sending", onSmsSending);
-    manager.removeEventListener("sent", onSmsSent);
-
-    log("Done!");
-    window.setTimeout(callback, 0);
-  }
-
-  function checkSentMessage(message, mark) {
-    checkMessage(message, "sent", body);
+function doSingleRequest(aRequest, aReceiver, aBody, aNow) {
+  let sendingGot = false, sentGot = false, successGot = false;
+  let sendingMessage;
+  let promises = [];
 
-    let receiver = message && message.receiver;
-    if (!receiver) {
-      ok(false, "message.receiver should be valid.");
-      return;
-    }
+  promises.push(waitForManagerEvent("sending",
+                                    isReceiverMatch.bind(null, aReceiver))
+    .then(function(aEvent) {
+      log("  onsending event for '" + aReceiver + "' received.");
 
-    let opt = options[receiver];
-    if (!opt) {
-      ok(false, "onsent should be called after onsending.");
-      return;
-    }
+      sendingMessage = aEvent.message;
+      checkMessage(sendingMessage, "sending", aBody);
+      // timestamp is in seconds.
+      ok(Math.floor(sendingMessage.timestamp / 1000) >= Math.floor(aNow / 1000),
+         "sent timestamp is valid");
 
-    let saved = opt.saved;
-    is(message.id, saved.id, "message.id");
-    is(message.receiver, saved.receiver, "message.receiver");
-    is(message.body, saved.body, "message.body");
-    is(message.timestamp, saved.timestamp, "message.timestamp");
+      ok(!sendingGot, "sending event should not have been triggered");
+      ok(!sentGot, "sent event should not have been triggered");
+      ok(!successGot, "success event should not have been triggered");
 
-    opt[mark] = true;
+      sendingGot = true;
+    }));
 
-    done();
-  }
-
-  function onRequestSuccess(event) {
-    log("request.onsuccess event received.");
+  promises.push(waitForManagerEvent("sent",
+                                    isReceiverMatch.bind(null, aReceiver))
+    .then(function(aEvent) {
+      log("  onsent event for '" + aReceiver + "' received.");
 
-    ok(event.target instanceof DOMRequest,
-       "event.target is instanceof " + event.target.constructor);
-    event.target.removeEventListener("success", onRequestSuccess);
-
-    checkSentMessage(event.target.result, "onRequestSuccessCalled");
-  }
-
-  function onSmsSending(event) {
-    log("onsending event received.");
+      let message = aEvent.message;
+      checkMessage(message, "sent", aBody);
+      // Should be mostly identical to sendingMessage.
+      is(message.id, sendingMessage.id, "message.id");
+      is(message.receiver, sendingMessage.receiver, "message.receiver");
+      is(message.body, sendingMessage.body, "message.body");
+      is(message.timestamp, sendingMessage.timestamp, "message.timestamp");
 
-    // 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");
+      ok(sendingGot, "sending event should have been triggered");
+      ok(!sentGot, "sent event should not have been triggered");
+      ok(successGot, "success event should have been triggered");
 
-    let message = event.message;
-    checkMessage(message, "sending", body);
-    // timestamp is in seconds.
-    ok(Math.floor(message.timestamp / 1000) >= Math.floor(now / 1000),
-       "sent timestamp is valid");
+      sentGot = true;
+    }));
 
-    let receiver = message.receiver;
-    if (!receiver) {
-      return;
-    }
+  promises.push(wrapDomRequestAsPromise(aRequest)
+    .then(function(aEvent) {
+      log("  onsuccess event for '" + aReceiver + "' received.");
 
-    if (options[receiver]) {
-      ok(false, "duplicated onsending events found!");
-      return;
-    }
-
-    options[receiver] = {
-      saved: message,
-      onSentCalled: false,
-      onRequestSuccessCalled: false
-    };
-  }
+      let message = aEvent.target.result;
+      checkMessage(message, "sent", aBody);
+      // Should be mostly identical to sendingMessage.
+      is(message.id, sendingMessage.id, "message.id");
+      is(message.receiver, sendingMessage.receiver, "message.receiver");
+      is(message.body, sendingMessage.body, "message.body");
+      is(message.timestamp, sendingMessage.timestamp, "message.timestamp");
 
-  function onSmsSent(event) {
-    log("onsent event received.");
+      ok(sendingGot, "sending event should have been triggered");
+      ok(!sentGot, "sent event should not have been triggered");
+      ok(!successGot, "success event should not have been triggered");
+
+      successGot = true;
+    }));
 
-    // 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");
+  return Promise.all(promises);
+}
 
-    checkSentMessage(event.message, "onSentCalled");
-  }
+function doSendMessageAndCheckSuccess(receivers, body) {
+  log("Testing sending message(s) to receiver(s): " + JSON.stringify(receivers));
 
-  manager.addEventListener("sending", onSmsSending);
-  manager.addEventListener("sent", onSmsSent);
+  let now = Date.now();
 
   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];
+
+    return Promise.all(result.map(function(request, index) {
+      return doSingleRequest(request, receivers[index], body, now);
+    }));
   }
 
-  for (let i = 0; i < result.length; i++) {
-    let request = result[i];
-    ok(request instanceof DOMRequest,
-       "request is instanceof " + request.constructor);
-    request.addEventListener("success", onRequestSuccess);
-  }
-}
-
-function testSendMessage() {
-  log("Testing sending message to one receiver:");
-  doSendMessageAndCheckSuccess("1", SHORT_BODY, testSendMultipartMessage);
+  return doSingleRequest(result, receivers, body, now);
 }
 
-function testSendMultipartMessage() {
-  log("Testing sending message to one receiver:");
-  doSendMessageAndCheckSuccess("1", LONG_BODY,
-                               testSendMessageToMultipleRecipients);
-}
-
-function testSendMessageToMultipleRecipients() {
-  log("Testing sending message to multiple receivers:");
-  // TODO: bug 788928 - add test cases for ondelivered event.
-  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");
-  finish();
-}
-
-testSendMessage();
+startTestBase(function testCaseMain() {
+  return ensureMobileMessage()
+    .then(() => pushPrefEnv({ set: [['dom.sms.strict7BitEncoding', false],
+                                    ['dom.sms.requestStatusReport', true]] }))
+    .then(() => doSendMessageAndCheckSuccess("1", SHORT_BODY))
+    .then(() => doSendMessageAndCheckSuccess("1", LONG_BODY))
+    .then(() => doSendMessageAndCheckSuccess(["1", "2"], SHORT_BODY));
+});
--- a/dom/mobilemessage/tests/xpcshell/test_mms_pdu_helper.js
+++ b/dom/mobilemessage/tests/xpcshell/test_mms_pdu_helper.js
@@ -11,25 +11,25 @@ function run_test() {
 
 //
 // Test target: BooleanValue
 //
 
 //// BooleanValue.decode ////
 
 add_test(function test_BooleanValue_decode() {
-  for (let i = 0; i < 256; i++) {
-    if (i == 128) {
-      wsp_decode_test(MMS.BooleanValue, [128], true);
-    } else if (i == 129) {
-      wsp_decode_test(MMS.BooleanValue, [129], false);
-    } else {
-      wsp_decode_test(MMS.BooleanValue, [i], null, "CodeError");
-    }
-  }
+  // Valid codes are 128 and 129. Check boundary conditions 0, 1, 127, 130 and
+  // 255 as well.
+  wsp_decode_test(MMS.BooleanValue, [0], null, "CodeError");
+  wsp_decode_test(MMS.BooleanValue, [1], null, "CodeError");
+  wsp_decode_test(MMS.BooleanValue, [127], null, "CodeError");
+  wsp_decode_test(MMS.BooleanValue, [128], true);
+  wsp_decode_test(MMS.BooleanValue, [129], false);
+  wsp_decode_test(MMS.BooleanValue, [130], null, "CodeError");
+  wsp_decode_test(MMS.BooleanValue, [255], null, "CodeError");
 
   run_next_test();
 });
 
 //// BooleanValue.encode ////
 
 add_test(function test_BooleanValue_encode() {
   wsp_encode_test(MMS.BooleanValue, true, [128]);
@@ -456,69 +456,79 @@ add_test(function test_MmsHeader_encode(
 
 //
 // Test target: CancelStatusValue
 //
 
 //// CancelStatusValue.decode ////
 
 add_test(function test_CancelStatusValue_decode() {
-  for (let i = 0; i < 256; i++) {
-    if ((i >= 128) && (i <= 129)) {
-      wsp_decode_test(MMS.CancelStatusValue, [i], i);
-    } else {
-      wsp_decode_test(MMS.CancelStatusValue, [i], null, "CodeError");
-    }
-  }
+  // Valid codes are 128 and 129. Check boundary conditions 0, 1, 127, 130 and
+  // 255 as well.
+  wsp_decode_test(MMS.CancelStatusValue, [0], null, "CodeError");
+  wsp_decode_test(MMS.CancelStatusValue, [1], null, "CodeError");
+  wsp_decode_test(MMS.CancelStatusValue, [127], null, "CodeError");
+  wsp_decode_test(MMS.CancelStatusValue, [128], 128);
+  wsp_decode_test(MMS.CancelStatusValue, [129], 129);
+  wsp_decode_test(MMS.CancelStatusValue, [130], null, "CodeError");
+  wsp_decode_test(MMS.CancelStatusValue, [255], null, "CodeError");
 
   run_next_test();
 });
 
 //// CancelStatusValue.encode ////
 
 add_test(function test_CancelStatusValue_encode() {
-  for (let i = 0; i < 256; i++) {
-    if ((i >= 128) && (i <= 129)) {
-      wsp_encode_test(MMS.CancelStatusValue, i, [i]);
-    } else {
-      wsp_encode_test(MMS.CancelStatusValue, i, null, "CodeError");
-    }
-  }
+  // Valid codes are 128 and 129. Check boundary conditions 0, 1, 127, 130 and
+  // 255 as well.
+  wsp_encode_test(MMS.CancelStatusValue, 0, null, "CodeError");
+  wsp_encode_test(MMS.CancelStatusValue, 1, null, "CodeError");
+  wsp_encode_test(MMS.CancelStatusValue, 127, null, "CodeError");
+  wsp_encode_test(MMS.CancelStatusValue, 128, [128]);
+  wsp_encode_test(MMS.CancelStatusValue, 129, [129]);
+  wsp_encode_test(MMS.CancelStatusValue, 130, null, "CodeError");
+  wsp_encode_test(MMS.CancelStatusValue, 255, null, "CodeError");
 
   run_next_test();
 });
 
 //
 // Test target: ContentClassValue
 //
 
 //// ContentClassValue.decode ////
 
 add_test(function test_ContentClassValue_decode() {
-  for (let i = 0; i < 256; i++) {
-    if ((i >= 128) && (i <= 135)) {
-      wsp_decode_test(MMS.ContentClassValue, [i], i);
-    } else {
-      wsp_decode_test(MMS.ContentClassValue, [i], null, "CodeError");
-    }
+  // Valid codes are 128 - 135. Check boundary conditions 0, 1, 127, 136 and
+  // 255 as well.
+  wsp_decode_test(MMS.ContentClassValue, [0], null, "CodeError");
+  wsp_decode_test(MMS.ContentClassValue, [1], null, "CodeError");
+  wsp_decode_test(MMS.ContentClassValue, [127], null, "CodeError");
+  for (let i = 128; i <= 135; i++) {
+    wsp_decode_test(MMS.ContentClassValue, [i], i);
   }
+  wsp_decode_test(MMS.ContentClassValue, [136], null, "CodeError");
+  wsp_decode_test(MMS.ContentClassValue, [255], null, "CodeError");
 
   run_next_test();
 });
 
 //// ContentClassValue.encode ////
 
 add_test(function test_ContentClassValue_encode() {
-  for (let i = 0; i < 256; i++) {
-    if ((i >= 128) && (i <= 135)) {
-      wsp_encode_test(MMS.ContentClassValue, i, [i]);
-    } else {
-      wsp_encode_test(MMS.ContentClassValue, i, null, "CodeError");
-    }
+  // Valid codes are 128 - 135. Check boundary conditions 0, 1, 127, 136 and
+  // 255 as well.
+  wsp_encode_test(MMS.ContentClassValue, 0, null, "CodeError");
+  wsp_encode_test(MMS.ContentClassValue, 1, null, "CodeError");
+  wsp_encode_test(MMS.ContentClassValue, 127, null, "CodeError");
+  for (let i = 128; i <= 135; i++) {
+    wsp_encode_test(MMS.ContentClassValue, i, [i]);
   }
+  wsp_encode_test(MMS.ContentClassValue, 136, null, "CodeError");
+  wsp_encode_test(MMS.ContentClassValue, 255, null, "CodeError");
 
   run_next_test();
 });
 
 //
 // Test target: ContentLocationValue
 //
 
@@ -804,32 +814,36 @@ add_test(function test_FromValue_encode(
 
 //
 // Test target: MessageClassValue
 //
 
 //// MessageClassValue.decodeClassIdentifier ////
 
 add_test(function test_MessageClassValue_decodeClassIdentifier() {
-  let (IDs = ["personal", "advertisement", "informational", "auto"]) {
-    for (let i = 0; i < 256; i++) {
-      if ((i >= 128) && (i <= 131)) {
-        wsp_decode_test_ex(function(data) {
-            return MMS.MessageClassValue.decodeClassIdentifier(data);
-          }, [i], IDs[i - 128]
-        );
-      } else {
-        wsp_decode_test_ex(function(data) {
-            return MMS.MessageClassValue.decodeClassIdentifier(data);
-          }, [i], null, "CodeError"
-        );
-      }
-    }
+  const IDs = ["personal", "advertisement", "informational", "auto"];
+
+  function test(i, error) {
+    let id = IDs[i - 128];
+    wsp_decode_test_ex(function(data) {
+        return MMS.MessageClassValue.decodeClassIdentifier(data);
+      }, [i], (error ? null : id), error);
   }
 
+  // Valid codes are 128 - 131. Check boundary conditions 0, 1, 127, 132 and
+  // 255 as well.
+  test(0, "CodeError");
+  test(1, "CodeError");
+  test(127, "CodeError");
+  for (let i = 128; i <= 131; i++) {
+    test(i, null);
+  }
+  test(132, "CodeError");
+  test(255, "CodeError");
+
   run_next_test();
 });
 
 //// MessageClassValue.decode ////
 
 add_test(function test_MessageClassValue_decode() {
   wsp_decode_test(MMS.MessageClassValue, [65, 0], "A");
   wsp_decode_test(MMS.MessageClassValue, [128], "personal");
@@ -851,215 +865,250 @@ add_test(function test_MessageClassValue
 
 //
 // Test target: MessageTypeValue
 //
 
 //// MessageTypeValue.decode ////
 
 add_test(function test_MessageTypeValue_decode() {
-  for (let i = 0; i < 256; i++) {
-    if ((i >= 128) && (i <= 151)) {
-      wsp_decode_test(MMS.MessageTypeValue, [i], i);
-    } else {
-      wsp_decode_test(MMS.MessageTypeValue, [i], null, "CodeError");
-    }
+  // Valid codes are 128 - 151. Check boundary conditions 0, 1, 127, 152 and
+  // 255 as well.
+  wsp_decode_test(MMS.MessageTypeValue, [0], null, "CodeError");
+  wsp_decode_test(MMS.MessageTypeValue, [1], null, "CodeError");
+  wsp_decode_test(MMS.MessageTypeValue, [127], null, "CodeError");
+  for (let i = 128; i <= 151; i++) {
+    wsp_decode_test(MMS.MessageTypeValue, [i], i);
   }
+  wsp_decode_test(MMS.MessageTypeValue, [152], null, "CodeError");
+  wsp_decode_test(MMS.MessageTypeValue, [255], null, "CodeError");
 
   run_next_test();
 });
 
 //// MessageTypeValue.encode ////
 
 add_test(function test_MessageTypeValue_encode() {
-  for (let i = 0; i < 256; i++) {
-    if ((i >= 128) && (i <= 151)) {
-      wsp_encode_test(MMS.MessageTypeValue, i, [i]);
-    } else {
-      wsp_encode_test(MMS.MessageTypeValue, i, null, "CodeError");
-    }
+  // Valid codes are 128 - 151. Check boundary conditions 0, 1, 127, 152 and
+  // 255 as well.
+  wsp_encode_test(MMS.MessageTypeValue, 0, null, "CodeError");
+  wsp_encode_test(MMS.MessageTypeValue, 1, null, "CodeError");
+  wsp_encode_test(MMS.MessageTypeValue, 127, null, "CodeError");
+  for (let i = 128; i <= 151; i++) {
+    wsp_encode_test(MMS.MessageTypeValue, i, [i]);
   }
+  wsp_encode_test(MMS.MessageTypeValue, 152, null, "CodeError");
+  wsp_encode_test(MMS.MessageTypeValue, 255, null, "CodeError");
 
   run_next_test();
 });
 
 //
 // Test target: MmFlagsValue
 //
 
 //// MmFlagsValue.decode ////
 
 add_test(function test_MmFlagsValue_decode() {
-  for (let i = 0; i < 256; i++) {
-    if ((i >= 128) && (i <= 130)) {
-      wsp_decode_test(MMS.MmFlagsValue, [3, i, 65, 0], {type: i, text: "A"});
-    } else {
-      wsp_decode_test(MMS.MmFlagsValue, [3, i, 65, 0], null, "CodeError");
-    }
+  // Valid codes are 128 - 130. Check boundary conditions 0, 1, 127, 131 and
+  // 255 as well.
+  wsp_decode_test(MMS.MmFlagsValue, [3, 0, 65, 0], null, "CodeError");
+  wsp_decode_test(MMS.MmFlagsValue, [3, 1, 65, 0], null, "CodeError");
+  wsp_decode_test(MMS.MmFlagsValue, [3, 127, 65, 0], null, "CodeError");
+  for (let i = 128; i <= 130; i++) {
+    wsp_decode_test(MMS.MmFlagsValue, [3, i, 65, 0], {type: i, text: "A"});
   }
+  wsp_decode_test(MMS.MmFlagsValue, [3, 131, 65, 0], null, "CodeError");
+  wsp_decode_test(MMS.MmFlagsValue, [3, 255, 65, 0], null, "CodeError");
 
   run_next_test();
 });
 
 //// MmFlagsValue.encode ////
 
 add_test(function test_MmFlagsValue_encode() {
-  for (let i = 0; i < 256; i++) {
-    if ((i >= 128) && (i <= 130)) {
-      wsp_encode_test(MMS.MmFlagsValue, {type: i, text: "A"}, [3, i, 65, 0]);
-    } else {
-      wsp_encode_test(MMS.MmFlagsValue, {type: i, text: "A"}, null, "CodeError");
-    }
+  // Valid codes are 128 - 130. Check boundary conditions 0, 1, 127, 131 and
+  // 255 as well.
+  wsp_encode_test(MMS.MmFlagsValue, {type: 0, text: "A"}, null, "CodeError");
+  wsp_encode_test(MMS.MmFlagsValue, {type: 1, text: "A"}, null, "CodeError");
+  wsp_encode_test(MMS.MmFlagsValue, {type: 127, text: "A"}, null, "CodeError");
+  for (let i = 128; i <= 130; i++) {
+    wsp_encode_test(MMS.MmFlagsValue, {type: i, text: "A"}, [3, i, 65, 0]);
   }
+  wsp_encode_test(MMS.MmFlagsValue, {type: 131, text: "A"}, null, "CodeError");
+  wsp_encode_test(MMS.MmFlagsValue, {type: 255, text: "A"}, null, "CodeError");
 
   run_next_test();
 });
 
 //
 // Test target: MmStateValue
 //
 
 //// MmStateValue.decode ////
 
 add_test(function test_MmStateValue_decode() {
-  for (let i = 0; i < 256; i++) {
-    if ((i >= 128) && (i <= 132)) {
-      wsp_decode_test(MMS.MmStateValue, [i], i);
-    } else {
-      wsp_decode_test(MMS.MmStateValue, [i], null, "CodeError");
-    }
+  // Valid codes are 128 - 132. Check boundary conditions 0, 1, 127, 133 and
+  // 255 as well.
+  wsp_decode_test(MMS.MmStateValue, [0], null, "CodeError");
+  wsp_decode_test(MMS.MmStateValue, [1], null, "CodeError");
+  wsp_decode_test(MMS.MmStateValue, [127], null, "CodeError");
+  for (let i = 128; i <= 132; i++) {
+    wsp_decode_test(MMS.MmStateValue, [i], i);
   }
+  wsp_decode_test(MMS.MmStateValue, [133], null, "CodeError");
+  wsp_decode_test(MMS.MmStateValue, [255], null, "CodeError");
 
   run_next_test();
 });
 
 //// MmStateValue.encode ////
 
 add_test(function test_MmStateValue_encode() {
-  for (let i = 0; i < 256; i++) {
-    if ((i >= 128) && (i <= 132)) {
-      wsp_encode_test(MMS.MmStateValue, i, [i]);
-    } else {
-      wsp_encode_test(MMS.MmStateValue, i, null, "CodeError");
-    }
+  // Valid codes are 128 - 132. Check boundary conditions 0, 1, 127, 133 and
+  // 255 as well.
+  wsp_encode_test(MMS.MmStateValue, 0, null, "CodeError");
+  wsp_encode_test(MMS.MmStateValue, 1, null, "CodeError");
+  wsp_encode_test(MMS.MmStateValue, 127, null, "CodeError");
+  for (let i = 128; i <= 132; i++) {
+    wsp_encode_test(MMS.MmStateValue, i, [i]);
   }
+  wsp_encode_test(MMS.MmStateValue, 133, null, "CodeError");
+  wsp_encode_test(MMS.MmStateValue, 255, null, "CodeError");
 
   run_next_test();
 });
 
 //
 // Test target: PriorityValue
 //
 
 //// PriorityValue.decode ////
 
 add_test(function test_PriorityValue_decode() {
-  for (let i = 0; i < 256; i++) {
-    if ((i >= 128) && (i <= 130)) {
-      wsp_decode_test(MMS.PriorityValue, [i], i);
-    } else {
-      wsp_decode_test(MMS.PriorityValue, [i], null, "CodeError");
-    }
+  // Valid codes are 128 - 130. Check boundary conditions 0, 1, 127, 131 and
+  // 255 as well.
+  wsp_decode_test(MMS.PriorityValue, [0], null, "CodeError");
+  wsp_decode_test(MMS.PriorityValue, [1], null, "CodeError");
+  wsp_decode_test(MMS.PriorityValue, [127], null, "CodeError");
+  for (let i = 128; i <= 130; i++) {
+    wsp_decode_test(MMS.PriorityValue, [i], i);
   }
+  wsp_decode_test(MMS.PriorityValue, [131], null, "CodeError");
+  wsp_decode_test(MMS.PriorityValue, [255], null, "CodeError");
 
   run_next_test();
 });
 
 //// PriorityValue.encode ////
 
 add_test(function test_PriorityValue_encode() {
-  for (let i = 0; i < 256; i++) {
-    if ((i >= 128) && (i <= 130)) {
-      wsp_encode_test(MMS.PriorityValue, i, [i]);
-    } else {
-      wsp_encode_test(MMS.PriorityValue, i, null, "CodeError");
-    }
+  // Valid codes are 128 - 130. Check boundary conditions 0, 1, 127, 131 and
+  // 255 as well.
+  wsp_encode_test(MMS.PriorityValue, 0, null, "CodeError");
+  wsp_encode_test(MMS.PriorityValue, 1, null, "CodeError");
+  wsp_encode_test(MMS.PriorityValue, 127, null, "CodeError");
+  for (let i = 128; i <= 130; i++) {
+    wsp_encode_test(MMS.PriorityValue, i, [i]);
   }
+  wsp_encode_test(MMS.PriorityValue, 131, null, "CodeError");
+  wsp_encode_test(MMS.PriorityValue, 255, null, "CodeError");
 
   run_next_test();
 });
 
 //
 // Test target: ReadStatusValue
 //
 
 //// ReadStatusValue.decode ////
 
 add_test(function test_ReadStatusValue_decode() {
-  for (let i = 0; i < 256; i++) {
-    if ((i >= 128) && (i <= 129)) {
-      wsp_decode_test(MMS.ReadStatusValue, [i], i);
-    } else {
-      wsp_decode_test(MMS.ReadStatusValue, [i], null, "CodeError");
-    }
-  }
+  // Valid codes are 128, 129. Check boundary conditions 0, 1, 127, 130 and
+  // 255 as well.
+  wsp_decode_test(MMS.ReadStatusValue, [0], null, "CodeError");
+  wsp_decode_test(MMS.ReadStatusValue, [1], null, "CodeError");
+  wsp_decode_test(MMS.ReadStatusValue, [127], null, "CodeError");
+  wsp_decode_test(MMS.ReadStatusValue, [128], 128);
+  wsp_decode_test(MMS.ReadStatusValue, [129], 129);
+  wsp_decode_test(MMS.ReadStatusValue, [130], null, "CodeError");
+  wsp_decode_test(MMS.ReadStatusValue, [255], null, "CodeError");
 
   run_next_test();
 });
 
 //// ReadStatusValue.encode ////
 
 add_test(function test_ReadStatusValue_encode() {
-  for (let i = 0; i < 256; i++) {
-    if ((i >= 128) && (i <= 129)) {
-      wsp_encode_test(MMS.ReadStatusValue, i, [i]);
-    } else {
-      wsp_encode_test(MMS.ReadStatusValue, i, null, "CodeError");
-    }
-  }
+  // Valid codes are 128, 129. Check boundary conditions 0, 1, 127, 130 and
+  // 255 as well.
+  wsp_encode_test(MMS.ReadStatusValue, 0, null, "CodeError");
+  wsp_encode_test(MMS.ReadStatusValue, 1, null, "CodeError");
+  wsp_encode_test(MMS.ReadStatusValue, 127, null, "CodeError");
+  wsp_encode_test(MMS.ReadStatusValue, 128, [128]);
+  wsp_encode_test(MMS.ReadStatusValue, 129, [129]);
+  wsp_encode_test(MMS.ReadStatusValue, 130, null, "CodeError");
+  wsp_encode_test(MMS.ReadStatusValue, 255, null, "CodeError");
 
   run_next_test();
 });
 
 //
 // Test target: RecommendedRetrievalModeValue
 //
 
 //// RecommendedRetrievalModeValue.decode ////
 
 add_test(function test_RecommendedRetrievalModeValue_decode() {
-  for (let i = 0; i < 256; i++) {
-    if (i == 128) {
-      wsp_decode_test(MMS.RecommendedRetrievalModeValue, [i], i);
-    } else {
-      wsp_decode_test(MMS.RecommendedRetrievalModeValue, [i], null, "CodeError");
-    }
-  }
+  // Valid codes is 128. Check boundary conditions 0, 1, 127, 130 and 255 as
+  // well.
+  wsp_decode_test(MMS.RecommendedRetrievalModeValue, [0], null, "CodeError");
+  wsp_decode_test(MMS.RecommendedRetrievalModeValue, [1], null, "CodeError");
+  wsp_decode_test(MMS.RecommendedRetrievalModeValue, [127], null, "CodeError");
+  wsp_decode_test(MMS.RecommendedRetrievalModeValue, [128], 128);
+  wsp_decode_test(MMS.RecommendedRetrievalModeValue, [129], null, "CodeError");
+  wsp_decode_test(MMS.RecommendedRetrievalModeValue, [255], null, "CodeError");
 
   run_next_test();
 });
 
 //
 // Test target: ReplyChargingValue
 //
 
 //// ReplyChargingValue.decode ////
 
 add_test(function test_ReplyChargingValue_decode() {
-  for (let i = 0; i < 256; i++) {
-    if ((i >= 128) && (i <= 131)) {
-      wsp_decode_test(MMS.ReplyChargingValue, [i], i);
-    } else {
-      wsp_decode_test(MMS.ReplyChargingValue, [i], null, "CodeError");
-    }
+  // Valid codes are 128 - 131. Check boundary conditions 0, 1, 127, 132 and
+  // 255 as well.
+  wsp_decode_test(MMS.ReplyChargingValue, [0], null, "CodeError");
+  wsp_decode_test(MMS.ReplyChargingValue, [1], null, "CodeError");
+  wsp_decode_test(MMS.ReplyChargingValue, [127], null, "CodeError");
+  for (let i = 128; i <= 131; i++) {
+    wsp_decode_test(MMS.ReplyChargingValue, [i], i);
   }
+  wsp_decode_test(MMS.ReplyChargingValue, [132], null, "CodeError");
+  wsp_decode_test(MMS.ReplyChargingValue, [255], null, "CodeError");
 
   run_next_test();
 });
 
 //// ReplyChargingValue.encode ////
 
 add_test(function test_ReplyChargingValue_encode() {
-  for (let i = 0; i < 256; i++) {
-    if ((i >= 128) && (i <= 131)) {
-      wsp_encode_test(MMS.ReplyChargingValue, i, [i]);
-    } else {
-      wsp_encode_test(MMS.ReplyChargingValue, i, null, "CodeError");
-    }
+  // Valid codes are 128 - 131. Check boundary conditions 0, 1, 127, 132 and
+  // 255 as well.
+  wsp_encode_test(MMS.ReplyChargingValue, 0, null, "CodeError");
+  wsp_encode_test(MMS.ReplyChargingValue, 1, null, "CodeError");
+  wsp_encode_test(MMS.ReplyChargingValue, 127, null, "CodeError");
+  for (let i = 128; i <= 131; i++) {
+    wsp_encode_test(MMS.ReplyChargingValue, i, [i]);
   }
+  wsp_encode_test(MMS.ReplyChargingValue, 132, null, "CodeError");
+  wsp_encode_test(MMS.ReplyChargingValue, 255, null, "CodeError");
 
   run_next_test();
 });
 
 //
 // Test target: ResponseText
 //
 
@@ -1099,89 +1148,108 @@ add_test(function test_ResponseText_deco
 
 //
 // Test target: RetrieveStatusValue
 //
 
 //// RetrieveStatusValue.decode ////
 
 add_test(function test_RetrieveStatusValue_decode() {
-  for (let i = 0; i < 256; i++) {
-    if ((i == MMS_PDU_ERROR_OK)
-        || (i >= MMS_PDU_ERROR_TRANSIENT_FAILURE)) {
-      wsp_decode_test(MMS.RetrieveStatusValue, [i], i);
-    } else {
-      wsp_decode_test(MMS.RetrieveStatusValue, [i],
-                      MMS_PDU_ERROR_PERMANENT_FAILURE);
-    }
+  // Valid codes are 128, 192 - 255. Check boundary conditions 0, 1, 127, 129,
+  // and 191 as well.
+  wsp_decode_test(MMS.RetrieveStatusValue, [0],
+                  MMS_PDU_ERROR_PERMANENT_FAILURE);
+  wsp_decode_test(MMS.RetrieveStatusValue, [1],
+                  MMS_PDU_ERROR_PERMANENT_FAILURE);
+  wsp_decode_test(MMS.RetrieveStatusValue, [127],
+                  MMS_PDU_ERROR_PERMANENT_FAILURE);
+
+  wsp_decode_test(MMS.RetrieveStatusValue, [128], MMS_PDU_ERROR_OK);
+
+  wsp_decode_test(MMS.RetrieveStatusValue, [129],
+                  MMS_PDU_ERROR_PERMANENT_FAILURE);
+  wsp_decode_test(MMS.RetrieveStatusValue, [191],
+                  MMS_PDU_ERROR_PERMANENT_FAILURE);
+  for (let i = 192; i < 256; i++) {
+    wsp_decode_test(MMS.RetrieveStatusValue, [i], i);
   }
 
   run_next_test();
 });
 
 //
 // Test target: SenderVisibilityValue
 //
 
 //// SenderVisibilityValue.decode ////
 
 add_test(function test_SenderVisibilityValue_decode() {
-  for (let i = 0; i < 256; i++) {
-    if ((i >= 128) && (i <= 129)) {
-      wsp_decode_test(MMS.SenderVisibilityValue, [i], i);
-    } else {
-      wsp_decode_test(MMS.SenderVisibilityValue, [i], null, "CodeError");
-    }
-  }
+  // Valid codes are 128, 129. Check boundary conditions 0, 1, 127, 130 and
+  // 255 as well.
+  wsp_decode_test(MMS.SenderVisibilityValue, [0], null, "CodeError");
+  wsp_decode_test(MMS.SenderVisibilityValue, [1], null, "CodeError");
+  wsp_decode_test(MMS.SenderVisibilityValue, [127], null, "CodeError");
+  wsp_decode_test(MMS.SenderVisibilityValue, [128], 128);
+  wsp_decode_test(MMS.SenderVisibilityValue, [129], 129);
+  wsp_decode_test(MMS.SenderVisibilityValue, [130], null, "CodeError");
+  wsp_decode_test(MMS.SenderVisibilityValue, [255], null, "CodeError");
 
   run_next_test();
 });
 
 //// SenderVisibilityValue.encode ////
 
 add_test(function test_SenderVisibilityValue_encode() {
-  for (let i = 0; i < 256; i++) {
-    if ((i >= 128) && (i <= 129)) {
-      wsp_encode_test(MMS.SenderVisibilityValue, i, [i]);
-    } else {
-      wsp_encode_test(MMS.SenderVisibilityValue, i, null, "CodeError");
-    }
-  }
+  // Valid codes are 128, 129. Check boundary conditions 0, 1, 127, 130 and
+  // 255 as well.
+  wsp_encode_test(MMS.SenderVisibilityValue, 0, null, "CodeError");
+  wsp_encode_test(MMS.SenderVisibilityValue, 1, null, "CodeError");
+  wsp_encode_test(MMS.SenderVisibilityValue, 127, null, "CodeError");
+  wsp_encode_test(MMS.SenderVisibilityValue, 128, [128]);
+  wsp_encode_test(MMS.SenderVisibilityValue, 129, [129]);
+  wsp_encode_test(MMS.SenderVisibilityValue, 130, null, "CodeError");
+  wsp_encode_test(MMS.SenderVisibilityValue, 255, null, "CodeError");
 
   run_next_test();
 });
 
 //
 // Test target: StatusValue
 //
 
 //// StatusValue.decode ////
 
 add_test(function test_StatusValue_decode() {
-  for (let i = 0; i < 256; i++) {
-    if ((i >= 128) && (i <= 135)) {
-      wsp_decode_test(MMS.StatusValue, [i], i);
-    } else {
-      wsp_decode_test(MMS.StatusValue, [i], null, "CodeError");
-    }
+  // Valid codes are 128 - 135. Check boundary conditions 0, 1, 127, 136 and
+  // 255 as well.
+  wsp_decode_test(MMS.StatusValue, [0], null, "CodeError");
+  wsp_decode_test(MMS.StatusValue, [1], null, "CodeError");
+  wsp_decode_test(MMS.StatusValue, [127], null, "CodeError");
+  for (let i = 128; i <= 135; i++) {
+    wsp_decode_test(MMS.StatusValue, [i], i);
   }
+  wsp_decode_test(MMS.StatusValue, [136], null, "CodeError");
+  wsp_decode_test(MMS.StatusValue, [255], null, "CodeError");
 
   run_next_test();
 });
 
 //// StatusValue.encode ////
 
 add_test(function test_StatusValue_encode() {
-  for (let i = 0; i < 256; i++) {
-    if ((i >= 128) && (i <= 135)) {
-      wsp_encode_test(MMS.StatusValue, i, [i]);
-    } else {
-      wsp_encode_test(MMS.StatusValue, i, null, "CodeError");
-    }
+  // Valid codes are 128 - 135. Check boundary conditions 0, 1, 127, 136 and
+  // 255 as well.
+  wsp_encode_test(MMS.StatusValue, 0, null, "CodeError");
+  wsp_encode_test(MMS.StatusValue, 1, null, "CodeError");
+  wsp_encode_test(MMS.StatusValue, 127, null, "CodeError");
+  for (let i = 128; i <= 135; i++) {
+    wsp_encode_test(MMS.StatusValue, i, [i]);
   }
+  wsp_encode_test(MMS.StatusValue, 136, null, "CodeError");
+  wsp_encode_test(MMS.StatusValue, 255, null, "CodeError");
 
   run_next_test();
 });
 
 //
 // Test target: PduHelper
 //
 
--- a/dom/mobilemessage/tests/xpcshell/test_wsp_pdu_helper.js
+++ b/dom/mobilemessage/tests/xpcshell/test_wsp_pdu_helper.js
@@ -5,29 +5,16 @@ let WSP = {};
 subscriptLoader.loadSubScript("resource://gre/modules/WspPduHelper.jsm", WSP);
 WSP.debug = do_print;
 
 function run_test() {
   run_next_test();
 }
 
 //
-// Test target: ensureHeader
-//
-
-add_test(function test_ensureHeader() {
-  do_check_throws(function() {
-      WSP.ensureHeader({}, "no-such-property");
-    }, "FatalCodeError"
-  );
-
-  run_next_test();
-});
-
-//
 // Test target: skipValue()
 //
 
 add_test(function test_skipValue() {
   function func(data) {
     return WSP.skipValue(data);
   }
 
@@ -42,422 +29,16 @@ add_test(function test_skipValue() {
   wsp_decode_test_ex(func, strToCharCodeArray("Hello world!"), "Hello world!");
   // Test first octet >= 128
   wsp_decode_test_ex(func, [0x80 | 0x01], 0x01);
 
   run_next_test();
 });
 
 //
-// Test target: Octet
-//
-
-//// Octet.decode ////
-
-add_test(function test_Octet_decode() {
-  wsp_decode_test(WSP.Octet, [1], 1);
-  wsp_decode_test(WSP.Octet, [], null, "RangeError");
-
-  run_next_test();
-});
-
-//// Octet.decodeMultiple ////
-
-add_test(function test_Octet_decodeMultiple() {
-  wsp_decode_test_ex(function(data) {
-      return WSP.Octet.decodeMultiple(data, 3);
-    }, [0, 1, 2], [0, 1, 2], null
-  );
-  wsp_decode_test_ex(function(data) {
-      return WSP.Octet.decodeMultiple(data, 3);
-    }, new Uint8Array([0, 1, 2]), new Uint8Array([0, 1, 2]), null
-  );
-  wsp_decode_test_ex(function(data) {
-      return WSP.Octet.decodeMultiple(data, 4);
-    }, [0, 1, 2], null, "RangeError"
-  );
-
-  run_next_test();
-});
-
-//// Octet.decodeEqualTo ////
-
-add_test(function test_Octet_decodeEqualTo() {
-  wsp_decode_test_ex(function(data) {
-      return WSP.Octet.decodeEqualTo(data, 1);
-    }, [1], 1, null
-  );
-  wsp_decode_test_ex(function(data) {
-      return WSP.Octet.decodeEqualTo(data, 2);
-    }, [1], null, "CodeError"
-  );
-  wsp_decode_test_ex(function(data) {
-      return WSP.Octet.decodeEqualTo(data, 2);
-    }, [], null, "RangeError"
-  );
-
-  run_next_test();
-});
-
-//// Octet.encode ////
-
-add_test(function test_Octet_encode() {
-  for (let i = 0; i < 256; i++) {
-    wsp_encode_test(WSP.Octet, i, [i]);
-  }
-
-  run_next_test();
-});
-
-//// Octet.encodeMultiple ////
-
-add_test(function test_Octet_encodeMultiple() {
-  wsp_encode_test_ex(function(data, input) {
-    WSP.Octet.encodeMultiple(data, input);
-    return data.array;
-  }, [0, 1, 2, 3], [0, 1, 2, 3]);
-
-  run_next_test();
-});
-
-//
-// Test target: Text
-//
-
-//// Text.decode ////
-
-add_test(function test_Text_decode() {
-  for (let i = 0; i < 256; i++) {
-    if (i == 0) {
-      wsp_decode_test(WSP.Text, [0], null, "NullCharError");
-    } else if ((i < WSP.CTLS) || (i == WSP.DEL)) {
-      wsp_decode_test(WSP.Text, [i], null, "CodeError");
-    } else {
-      wsp_decode_test(WSP.Text, [i], String.fromCharCode(i));
-    }
-  }
-  // Test \r\n(SP|HT)* sequence:
-  wsp_decode_test(WSP.Text, strToCharCodeArray("\r\n \t \t \t", true), " ");
-  wsp_decode_test(WSP.Text, strToCharCodeArray("\r\n \t \t \t"), " ");
-  wsp_decode_test(WSP.Text, strToCharCodeArray("\r\n \t \t \tA"), " ");
-
-  run_next_test();
-});
-
-//// Text.encode ////
-
-add_test(function test_Text_encode() {
-  for (let i = 0; i < 256; i++) {
-    if ((i < WSP.CTLS) || (i == WSP.DEL)) {
-      wsp_encode_test(WSP.Text, String.fromCharCode(i), null, "CodeError");
-    } else {
-      wsp_encode_test(WSP.Text, String.fromCharCode(i), [i]);
-    }
-  }
-
-  run_next_test();
-});
-
-//
-// Test target: NullTerminatedTexts
-//
-
-//// NullTerminatedTexts.decode ////
-
-add_test(function test_NullTerminatedTexts_decode() {
-  // Test incompleted string:
-  wsp_decode_test(WSP.NullTerminatedTexts, strToCharCodeArray(" ", true), null, "RangeError");
-  // Test control char:
-  wsp_decode_test(WSP.NullTerminatedTexts, strToCharCodeArray(" \n"), null, "CodeError");
-  // Test normal string:
-  wsp_decode_test(WSP.NullTerminatedTexts, strToCharCodeArray(""), "");
-  wsp_decode_test(WSP.NullTerminatedTexts, strToCharCodeArray("oops"), "oops");
-  // Test \r\n(SP|HT)* sequence:
-  wsp_decode_test(WSP.NullTerminatedTexts, strToCharCodeArray("A\r\n \t \t \tB"), "A B");
-
-  run_next_test();
-});
-
-//// NullTerminatedTexts.encode ////
-
-add_test(function test_NullTerminatedTexts_encode() {
-  wsp_encode_test(WSP.NullTerminatedTexts, "", [0]);
-  wsp_encode_test(WSP.NullTerminatedTexts, "Hello, World!",
-                  strToCharCodeArray("Hello, World!"));
-
-  run_next_test();
-});
-
-//
-// Test target: Token
-//
-
-let TOKEN_SEPS = "()<>@,;:\\\"/[]?={} \t";
-
-//// Token.decode ////
-
-add_test(function test_Token_decode() {
-  for (let i = 0; i < 256; i++) {
-    if (i == 0) {
-      wsp_decode_test(WSP.Token, [i], null, "NullCharError");
-    } else if ((i < WSP.CTLS) || (i >= WSP.ASCIIS)
-        || (TOKEN_SEPS.indexOf(String.fromCharCode(i)) >= 0)) {
-      wsp_decode_test(WSP.Token, [i], null, "CodeError");
-    } else {
-      wsp_decode_test(WSP.Token, [i], String.fromCharCode(i));
-    }
-  }
-
-  run_next_test();
-});
-
-//// Token.encode ////
-
-add_test(function test_Token_encode() {
-  for (let i = 0; i < 256; i++) {
-    if ((i < WSP.CTLS) || (i >= WSP.ASCIIS)
-        || (TOKEN_SEPS.indexOf(String.fromCharCode(i)) >= 0)) {
-      wsp_encode_test(WSP.Token, String.fromCharCode(i), null, "CodeError");
-    } else {
-      wsp_encode_test(WSP.Token, String.fromCharCode(i), [i]);
-    }
-  }
-
-  run_next_test();
-});
-
-//
-// Test target: URIC
-//
-
-//// URIC.decode ////
-
-add_test(function test_URIC_decode() {
-  let uric = "!#$%&'()*+,-./0123456789:;=?@ABCDEFGHIJKLMN"
-             + "OPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~";
-  for (let i = 0; i < 256; i++) {
-    if (i == 0) {
-      wsp_decode_test(WSP.URIC, [i], null, "NullCharError");
-    } else if (uric.indexOf(String.fromCharCode(i)) >= 0) {
-      wsp_decode_test(WSP.URIC, [i], String.fromCharCode(i));
-    } else {
-      wsp_decode_test(WSP.URIC, [i], null, "CodeError");
-    }
-  }
-
-  run_next_test();
-});
-
-//
-// Test target: TextString
-//
-
-//// TextString.decode ////
-
-add_test(function test_TextString_decode() {
-  // Test quoted string
-  wsp_decode_test(WSP.TextString, [127, 128, 0], String.fromCharCode(128));
-  // Test illegal quoted string
-  wsp_decode_test(WSP.TextString, [127, 32, 0], null, "CodeError");
-  // Test illegal unquoted string
-  wsp_decode_test(WSP.TextString, [128, 0], null, "CodeError");
-  // Test normal string
-  wsp_decode_test(WSP.TextString, [32, 0], " ");
-
-  run_next_test();
-});
-
-//// TextString.encode ////
-
-add_test(function test_TextString_encode() {
-  // Test quoted string
-  wsp_encode_test(WSP.TextString, String.fromCharCode(128), [127, 128, 0]);
-  // Test normal string
-  wsp_encode_test(WSP.TextString, "Mozilla", strToCharCodeArray("Mozilla"));
-
-  run_next_test();
-});
-
-//
-// Test target: TokenText
-//
-
-//// TokenText.decode ////
-
-add_test(function test_TokenText_decode() {
-  wsp_decode_test(WSP.TokenText, [65], null, "RangeError");
-  wsp_decode_test(WSP.TokenText, [0], "");
-  wsp_decode_test(WSP.TokenText, [65, 0], "A");
-
-  run_next_test();
-});
-
-//// TokenText.encode ////
-
-add_test(function test_TokenText_encode() {
-  wsp_encode_test(WSP.TokenText, "B2G", strToCharCodeArray("B2G"));
-
-  run_next_test();
-});
-
-//
-// Test target: QuotedString
-//
-
-//// QuotedString.decode ////
-
-add_test(function test_QuotedString_decode() {
-  // Test non-quoted string
-  wsp_decode_test(WSP.QuotedString, [32, 0], null, "CodeError");
-  // Test incompleted string
-  wsp_decode_test(WSP.QuotedString, [34, 32], null, "RangeError");
-  wsp_decode_test(WSP.QuotedString, [34, 32, 0], " ");
-
-  run_next_test();
-});
-
-//// QuotedString.encode ////
-
-add_test(function test_QuotedString_encode() {
-  wsp_encode_test(WSP.QuotedString, "B2G", [34].concat(strToCharCodeArray("B2G")));
-
-  run_next_test();
-});
-
-//
-// Test target: ShortInteger
-//
-
-//// ShortInteger.decode ////
-
-add_test(function test_ShortInteger_decode() {
-  for (let i = 0; i < 256; i++) {
-    if (i & 0x80) {
-      wsp_decode_test(WSP.ShortInteger, [i], i & 0x7F);
-    } else {
-      wsp_decode_test(WSP.ShortInteger, [i], null, "CodeError");
-    }
-  }
-
-  run_next_test();
-});
-
-//// ShortInteger.encode ////
-
-add_test(function test_ShortInteger_encode() {
-  for (let i = 0; i < 256; i++) {
-    if (i & 0x80) {
-      wsp_encode_test(WSP.ShortInteger, i, null, "CodeError");
-    } else {
-      wsp_encode_test(WSP.ShortInteger, i, [0x80 | i]);
-    }
-  }
-
-  run_next_test();
-});
-
-//
-// Test target: LongInteger
-//
-
-//// LongInteger.decode ////
-
-function LongInteger_decode_testcases(target) {
-  // Test LongInteger of zero octet
-  wsp_decode_test(target, [0, 0], null, "CodeError");
-  wsp_decode_test(target, [1, 0x80], 0x80);
-  wsp_decode_test(target, [2, 0x80, 2], 0x8002);
-  wsp_decode_test(target, [3, 0x80, 2, 3], 0x800203);
-  wsp_decode_test(target, [4, 0x80, 2, 3, 4], 0x80020304);
-  wsp_decode_test(target, [5, 0x80, 2, 3, 4, 5], 0x8002030405);
-  wsp_decode_test(target, [6, 0x80, 2, 3, 4, 5, 6], 0x800203040506);
-  // Test LongInteger of more than 6 octets
-  wsp_decode_test(target, [7, 0x80, 2, 3, 4, 5, 6, 7], [0x80, 2, 3, 4, 5, 6, 7]);
-  // Test LongInteger of more than 30 octets
-  wsp_decode_test(target, [31], null, "CodeError");
-}
-add_test(function test_LongInteger_decode() {
-  LongInteger_decode_testcases(WSP.LongInteger);
-
-  run_next_test();
-});
-
-//// LongInteger.encode ////
-
-function LongInteger_encode_testcases(target) {
-  wsp_encode_test(target, 0x80,           [1, 0x80]);
-  wsp_encode_test(target, 0x8002,         [2, 0x80, 2]);
-  wsp_encode_test(target, 0x800203,       [3, 0x80, 2, 3]);
-  wsp_encode_test(target, 0x80020304,     [4, 0x80, 2, 3, 4]);
-  wsp_encode_test(target, 0x8002030405,   [5, 0x80, 2, 3, 4, 5]);
-  wsp_encode_test(target, 0x800203040506, [6, 0x80, 2, 3, 4, 5, 6]);
-  // Test LongInteger of more than 6 octets
-  wsp_encode_test(target, 0x1000000000000, null, "CodeError");
-  // Test input empty array
-  wsp_encode_test(target, [], null, "CodeError");
-  // Test input octets array of length 1..30
-  let array = [];
-  for (let i = 1; i <= 30; i++) {
-    array.push(i);
-    wsp_encode_test(target, array, [i].concat(array));
-  }
-  // Test input octets array of 31 elements.
-  array.push(31);
-  wsp_encode_test(target, array, null, "CodeError");
-}
-add_test(function test_LongInteger_encode() {
-  wsp_encode_test(WSP.LongInteger, 0, [1, 0]);
-
-  LongInteger_encode_testcases(WSP.LongInteger);
-
-  run_next_test();
-});
-
-//
-// Test target: UintVar
-//
-
-//// UintVar.decode ////
-
-add_test(function test_UintVar_decode() {
-  wsp_decode_test(WSP.UintVar, [0x80], null, "RangeError");
-  // Test up to max 53 bits integer
-  wsp_decode_test(WSP.UintVar, [0x7F], 0x7F);
-  wsp_decode_test(WSP.UintVar, [0xFF, 0x7F], 0x3FFF);
-  wsp_decode_test(WSP.UintVar, [0xFF, 0xFF, 0x7F], 0x1FFFFF);
-  wsp_decode_test(WSP.UintVar, [0xFF, 0xFF, 0xFF, 0x7F], 0xFFFFFFF);
-  wsp_decode_test(WSP.UintVar, [0xFF, 0xFF, 0xFF, 0xFF, 0x7F], 0x7FFFFFFFF);
-  wsp_decode_test(WSP.UintVar, [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F], 0x3FFFFFFFFFF);
-  wsp_decode_test(WSP.UintVar, [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F], 0x1FFFFFFFFFFFF);
-  wsp_decode_test(WSP.UintVar, [0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F], 0x1FFFFFFFFFFFFF);
-  wsp_decode_test(WSP.UintVar, [0x01, 0x02], 1);
-  wsp_decode_test(WSP.UintVar, [0x80, 0x01, 0x02], 1);
-  wsp_decode_test(WSP.UintVar, [0x80, 0x80, 0x80, 0x01, 0x2], 1);
-
-  run_next_test();
-});
-
-//// UintVar.encode ////
-
-add_test(function test_UintVar_encode() {
-  // Test up to max 53 bits integer
-  wsp_encode_test(WSP.UintVar, 0, [0]);
-  wsp_encode_test(WSP.UintVar, 0x7F, [0x7F]);
-  wsp_encode_test(WSP.UintVar, 0x3FFF, [0xFF, 0x7F]);
-  wsp_encode_test(WSP.UintVar, 0x1FFFFF, [0xFF, 0xFF, 0x7F]);
-  wsp_encode_test(WSP.UintVar, 0xFFFFFFF, [0xFF, 0xFF, 0xFF, 0x7F]);
-  wsp_encode_test(WSP.UintVar, 0x7FFFFFFFF, [0xFF, 0xFF, 0xFF, 0xFF, 0x7F]);
-  wsp_encode_test(WSP.UintVar, 0x3FFFFFFFFFF, [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F]);
-  wsp_encode_test(WSP.UintVar, 0x1FFFFFFFFFFFF, [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F]);
-  wsp_encode_test(WSP.UintVar, 0x1FFFFFFFFFFFFF, [0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F]);
-
-  run_next_test();
-});
-
-//
 // Test target: ConstrainedEncoding
 //
 
 //// ConstrainedEncoding.decode ////
 
 add_test(function test_ConstrainedEncoding_decode() {
   wsp_decode_test(WSP.ConstrainedEncoding, [0x80], 0);
   wsp_decode_test(WSP.ConstrainedEncoding, [32, 0], " ");
@@ -534,71 +115,16 @@ add_test(function test_NoValue_encode() 
   wsp_encode_test(WSP.NoValue, "", null, "CodeError");
   wsp_encode_test(WSP.NoValue, [], null, "CodeError");
   wsp_encode_test(WSP.NoValue, {}, null, "CodeError");
 
   run_next_test();
 });
 
 //
-// Test target: TextValue
-//
-
-//// TextValue.decode ////
-
-add_test(function test_TextValue_decode() {
-  wsp_decode_test(WSP.TextValue, [0], null);
-  wsp_decode_test(WSP.TextValue, [65, 0], "A");
-  wsp_decode_test(WSP.TextValue, [32, 0], null, "CodeError");
-  wsp_decode_test(WSP.TextValue, [34, 32, 0], " ");
-
-  run_next_test();
-});
-
-//// TextValue.encode ////
-
-add_test(function test_TextValue_encode() {
-  wsp_encode_test(WSP.TextValue, undefined, [0]);
-  wsp_encode_test(WSP.TextValue, null, [0]);
-  wsp_encode_test(WSP.TextValue, "", [0]);
-  wsp_encode_test(WSP.TextValue, "A", [65, 0]);
-  wsp_encode_test(WSP.TextValue, "\x80", [34, 128, 0]);
-
-  run_next_test();
-});
-
-//
-// Test target: IntegerValue
-//
-
-//// IntegerValue.decode ////
-
-add_test(function test_IntegerValue_decode() {
-  for (let i = 128; i < 256; i++) {
-    wsp_decode_test(WSP.IntegerValue, [i], i & 0x7F);
-  }
-
-  LongInteger_decode_testcases(WSP.IntegerValue);
-
-  run_next_test();
-});
-
-//// IntegerValue.decode ////
-
-add_test(function test_IntegerValue_encode() {
-  for (let i = 0; i < 128; i++) {
-    wsp_encode_test(WSP.IntegerValue, i, [0x80 | i]);
-  }
-
-  LongInteger_encode_testcases(WSP.IntegerValue);
-
-  run_next_test();
-});
-
-//
 // Test target: DateValue
 //
 
 //// DateValue.decode ////
 
 add_test(function test_DateValue_decode() {
   wsp_decode_test(WSP.DateValue, [0, 0], null, "CodeError");
   wsp_decode_test(WSP.DateValue, [1, 0x80], new Date(0x80 * 1000));
@@ -733,242 +259,16 @@ add_test(function test_TypeValue_encode(
                   [0x33 | 0x80]);
   wsp_encode_test(WSP.TypeValue, "image/gif",
                   [0x1d | 0x80]);
 
   run_next_test();
 });
 
 //
-// Test target: Parameter
-//
-
-//// Parameter.decodeTypedParameter ////
-
-add_test(function test_Parameter_decodeTypedParameter() {
-  function func(data) {
-    return WSP.Parameter.decodeTypedParameter(data);
-  }
-
-  // Test for array-typed return value from IntegerValue
-  wsp_decode_test_ex(func, [7, 0, 0, 0, 0, 0, 0, 0], null, "CodeError");
-  // Test for number-typed return value from IntegerValue
-  wsp_decode_test_ex(func, [1, 0, 0], {name: "q", value: null});
-  // Test for NotWellKnownEncodingError
-  wsp_decode_test_ex(func, [1, 0xFF], null, "NotWellKnownEncodingError");
-  // Test for parameter specific decoder
-  wsp_decode_test_ex(func, [1, 0, 100], {name: "q", value: 0.99});
-  // Test for TextValue
-  wsp_decode_test_ex(func, [1, 0x10, 48, 46, 57, 57, 0],
-                     {name: "secure", value: "0.99"});
-  // Test for TextString
-  wsp_decode_test_ex(func, [1, 0x0A, 60, 115, 109, 105, 108, 62, 0],
-                     {name: "start", value: "<smil>"});
-  // Test for skipValue
-  wsp_decode_test_ex(func, [1, 0x0A, 128], null);
-
-  run_next_test();
-});
-
-//// Parameter.decodeUntypedParameter ////
-
-add_test(function test_Parameter_decodeUntypedParameter() {
-  function func (data) {
-    return WSP.Parameter.decodeUntypedParameter(data);
-  }
-
-  wsp_decode_test_ex(func, [1], null, "CodeError");
-  wsp_decode_test_ex(func, [65, 0, 0], {name: "a", value: null});
-  // Test for IntegerValue
-  wsp_decode_test_ex(func, [65, 0, 1, 0], {name: "a", value: 0});
-  // Test for TextValue
-  wsp_decode_test_ex(func, [65, 0, 66, 0], {name: "a", value: "B"});
-
-  run_next_test();
-});
-
-//// Parameter.decode ////
-
-add_test(function test_Parameter_decode() {
-  wsp_decode_test(WSP.Parameter, [1, 0x0A, 60, 115, 109, 105, 108, 62, 0],
-                  {name: "start", value: "<smil>"});
-  wsp_decode_test(WSP.Parameter, [65, 0, 66, 0], {name: "a", value: "B"});
-
-  run_next_test();
-});
-
-//// Parameter.decodeMultiple ////
-
-add_test(function test_Parameter_decodeMultiple() {
-  wsp_decode_test_ex(function(data) {
-      return WSP.Parameter.decodeMultiple(data, 13);
-    }, [1, 0x0A, 60, 115, 109, 105, 108, 62, 0, 65, 0, 66, 0], {start: "<smil>", a: "B"}
-  );
-
-  run_next_test();
-});
-
-//// Parameter.encodeTypedParameter ////
-
-add_test(function test_Parameter_encodeTypedParameter() {
-  function func(data, input) {
-    WSP.Parameter.encodeTypedParameter(data, input);
-    return data.array;
-  }
-
-  // Test for NotWellKnownEncodingError
-  wsp_encode_test_ex(func, {name: "xxx", value: 0}, null, "NotWellKnownEncodingError");
-  wsp_encode_test_ex(func, {name: "q", value: 0}, [0x80, 1]);
-  wsp_encode_test_ex(func, {name: "name", value: "A"}, [0x85, 65, 0]);
-
-  run_next_test();
-});
-
-//// Parameter.encodeUntypedParameter ////
-
-add_test(function test_Parameter_encodeUntypedParameter() {
-  function func(data, input) {
-    WSP.Parameter.encodeUntypedParameter(data, input);
-    return data.array;
-  }
-
-  wsp_encode_test_ex(func, {name: "q", value: 0}, [113, 0, 0x80]);
-  wsp_encode_test_ex(func, {name: "name", value: "A"}, [110, 97, 109, 101, 0, 65, 0]);
-
-  run_next_test();
-});
-
-//// Parameter.encodeMultiple ////
-
-add_test(function test_Parameter_encodeMultiple() {
-  function func(data, input) {
-    WSP.Parameter.encodeMultiple(data, input);
-    return data.array;
-  }
-
-  wsp_encode_test_ex(func, {q: 0, n: "A"}, [0x80, 1, 110, 0, 65, 0]);
-
-  run_next_test();
-});
-
-//// Parameter.encode ////
-
-add_test(function test_Parameter_encode() {
-
-  wsp_encode_test(WSP.Parameter, {name: "q", value: 0}, [0x80, 1]);
-  wsp_encode_test(WSP.Parameter, {name: "n", value: "A"}, [110, 0, 65, 0]);
-
-  run_next_test();
-});
-
-//
-// Test target: Header
-//
-
-//// Header.decode ////
-
-add_test(function test_Header_decode() {
-  wsp_decode_test(WSP.Header, [0x34 | 0x80, 0x80], {name: "push-flag", value: 0});
-  wsp_decode_test(WSP.Header, [65, 0, 66, 0], {name: "a", value: "B"});
-
-  run_next_test();
-});
-
-//
-// Test target: WellKnownHeader
-//
-
-//// WellKnownHeader.decode ////
-
-add_test(function test_WellKnownHeader_decode() {
-  wsp_decode_test(WSP.WellKnownHeader, [0xFF], null, "NotWellKnownEncodingError");
-  let (entry = WSP.WSP_HEADER_FIELDS["push-flag"]) {
-    // Test for Short-Integer
-    wsp_decode_test(WSP.WellKnownHeader, [entry.number | 0x80, 0x80],
-                        {name: entry.name, value: 0});
-    // Test for NoValue
-    wsp_decode_test(WSP.WellKnownHeader, [entry.number | 0x80, 0],
-                        {name: entry.name, value: null});
-    // Test for TokenText
-    wsp_decode_test(WSP.WellKnownHeader, [entry.number | 0x80, 65, 0],
-                        {name: entry.name, value: "A"});
-    // Test for QuotedString
-    wsp_decode_test(WSP.WellKnownHeader, [entry.number | 0x80, 34, 128, 0],
-                        {name: entry.name, value: String.fromCharCode(128)});
-    // Test for skipValue
-    wsp_decode_test(WSP.WellKnownHeader, [entry.number | 0x80, 2, 0, 0], null);
-  }
-
-  run_next_test();
-});
-
-//
-// Test target: ApplicationHeader
-//
-
-//// ApplicationHeader.decode ////
-
-add_test(function test_ApplicationHeader_decode() {
-  wsp_decode_test(WSP.ApplicationHeader, [5, 0, 66, 0], null, "CodeError");
-  wsp_decode_test(WSP.ApplicationHeader, [65, 0, 66, 0], {name: "a", value: "B"});
-  // Test for skipValue
-  wsp_decode_test(WSP.ApplicationHeader, [65, 0, 2, 0, 0], null);
-
-  run_next_test();
-});
-
-//// ApplicationHeader.encode ////
-
-add_test(function test_ApplicationHeader_encode() {
-  // Test invalid header name string:
-  wsp_encode_test(WSP.ApplicationHeader, {name: undefined, value: "asdf"}, null, "CodeError");
-  wsp_encode_test(WSP.ApplicationHeader, {name: null, value: "asdf"}, null, "CodeError");
-  wsp_encode_test(WSP.ApplicationHeader, {name: "", value: "asdf"}, null, "CodeError");
-  wsp_encode_test(WSP.ApplicationHeader, {name: "a b", value: "asdf"}, null, "CodeError");
-  // Test value string:
-  wsp_encode_test(WSP.ApplicationHeader, {name: "asdf", value: undefined},
-                  strToCharCodeArray("asdf").concat([0]));
-  wsp_encode_test(WSP.ApplicationHeader, {name: "asdf", value: null},
-                  strToCharCodeArray("asdf").concat([0]));
-  wsp_encode_test(WSP.ApplicationHeader, {name: "asdf", value: ""},
-                  strToCharCodeArray("asdf").concat([0]));
-  wsp_encode_test(WSP.ApplicationHeader, {name: "asdf", value: "fdsa"},
-                  strToCharCodeArray("asdf").concat(strToCharCodeArray("fdsa")));
-
-  run_next_test();
-});
-
-//
-// Test target: FieldName
-//
-
-//// FieldName.decode ////
-
-add_test(function test_FieldName_decode() {
-  wsp_decode_test(WSP.FieldName, [0], "");
-  wsp_decode_test(WSP.FieldName, [65, 0], "a");
-  wsp_decode_test(WSP.FieldName, [97, 0], "a");
-  let (entry = WSP.WSP_HEADER_FIELDS["content-length"]) {
-    wsp_decode_test(WSP.FieldName, [entry.number | 0x80], entry.name);
-  }
-  wsp_decode_test(WSP.FieldName, [0xFF], null, "NotWellKnownEncodingError");
-
-  run_next_test();
-});
-
-//// FieldName.encode ////
-
-add_test(function test_FieldName_encode() {
-  wsp_encode_test(WSP.FieldName, "", [0]);
-  wsp_encode_test(WSP.FieldName, "date", [0x92]);
-
-  run_next_test();
-});
-
-//
 // Test target: AcceptCharsetValue
 //
 
 //// AcceptCharsetValue.decode ////
 
 add_test(function test_AcceptCharsetValue_decode() {
   wsp_decode_test(WSP.AcceptCharsetValue, [0xFF], null, "CodeError");
   // Test for Any-Charset
@@ -1098,17 +398,17 @@ add_test(function test_WellKnownCharset_
 add_test(function test_ContentTypeValue_decodeConstrainedMedia() {
   function func(data) {
     return WSP.ContentTypeValue.decodeConstrainedMedia(data);
   }
 
   // Test for string-typed return value from ConstrainedEncoding
   wsp_decode_test_ex(func, [65, 0], {media: "a", params: null});
   // Test for number-typed return value from ConstrainedEncoding
-  for(let ix = 0; ix <WSP.WSP_WELL_KNOWN_CONTENT_TYPES.length ; ++ix){
+  for (let ix = 0; ix <WSP.WSP_WELL_KNOWN_CONTENT_TYPES.length ; ++ix) {
     wsp_decode_test_ex(func, [WSP.WSP_WELL_KNOWN_CONTENT_TYPES[ix].number | 0x80],
       {media: WSP.WSP_WELL_KNOWN_CONTENT_TYPES[ix].value, params: null});
   }
   // Test for NotWellKnownEncodingError
   wsp_decode_test_ex(func, [0x59 | 0x80], null, "NotWellKnownEncodingError");
 
   run_next_test();
 });
@@ -1180,17 +480,17 @@ add_test(function test_ContentTypeValue_
     WSP.ContentTypeValue.encodeConstrainedMedia(data, input);
     return data.array;
   }
 
   // Test media type with additional parameters.
   wsp_encode_test_ex(func, {media: "a", params: [{a: "b"}]}, null, "CodeError");
   wsp_encode_test_ex(func, {media: "no/such.type"},
                      [110, 111, 47, 115, 117, 99, 104, 46, 116, 121, 112, 101, 0]);
-  for(let ix = 0; ix <WSP.WSP_WELL_KNOWN_CONTENT_TYPES.length ; ++ix){
+  for (let ix = 0; ix <WSP.WSP_WELL_KNOWN_CONTENT_TYPES.length ; ++ix) {
     wsp_encode_test_ex(func, {media: WSP.WSP_WELL_KNOWN_CONTENT_TYPES[ix].value},
     [WSP.WSP_WELL_KNOWN_CONTENT_TYPES[ix].number | 0x80]);
   }
   wsp_encode_test_ex(func, {media: "TexT/X-hdml"}, [0x04 | 0x80]);
   wsp_encode_test_ex(func, {media: "appLication/*"}, [0x10 | 0x80]);
 
   run_next_test();
 });
@@ -1254,104 +554,8 @@ add_test(function test_ApplicationIdValu
   let (entry = WSP.OMNA_PUSH_APPLICATION_IDS["x-wap-application:mms.ua"]) {
     wsp_decode_test(WSP.ApplicationIdValue, [entry.number | 0x80], entry.urn);
     wsp_decode_test(WSP.ApplicationIdValue, [1, entry.number], entry.urn);
   }
   wsp_decode_test(WSP.ApplicationIdValue, [0xFF], null, "NotWellKnownEncodingError");
 
   run_next_test();
 });
-
-//
-// Test target: PduHelper
-//
-
-//// PduHelper.parseHeaders ////
-
-add_test(function test_PduHelper_parseHeaders() {
-  wsp_decode_test_ex(function(data) {
-      return WSP.PduHelper.parseHeaders(data, data.array.length);
-    }, [0x80 | 0x05, 2, 0x23, 0x28, 0x80 | 0x2F, 0x80 | 0x04],
-    {"age": 9000, "x-wap-application-id": "x-wap-application:mms.ua"}
-  );
-
-  run_next_test();
-});
-
-//// PduHelper.decodeStringContent ////
-
-add_test(function StringContent_decode() {
-  //Test for utf-8
-  let (entry = WSP.WSP_WELL_KNOWN_CHARSETS["utf-8"]) {
-    // "Mozilla" in full width.
-    let str = "\uff2d\uff4f\uff5a\uff49\uff4c\uff4c\uff41";
-
-    let conv = Cc["@mozilla.org/intl/scriptableunicodeconverter"]
-               .createInstance(Ci.nsIScriptableUnicodeConverter);
-    conv.charset = entry.converter;
-
-    let raw = conv.convertToByteArray(str);
-    let data = {array: raw, offset: 0};
-    let octetArray = WSP.Octet.decodeMultiple(data, data.array.length);
-    wsp_decode_test_ex(function(data) {
-        return WSP.PduHelper.decodeStringContent(data.array, "utf-8");
-      }, octetArray, str);
-  }
-
-  let (entry = WSP.WSP_WELL_KNOWN_CHARSETS["utf-16"]) {
-    // "Mozilla" in full width.
-    let str = "\u004d\u006F\u007A\u0069\u006C\u006C\u0061";
-
-    let conv = Cc["@mozilla.org/intl/scriptableunicodeconverter"]
-               .createInstance(Ci.nsIScriptableUnicodeConverter);
-    conv.charset = entry.converter;
-
-    let raw = conv.convertToByteArray(str);
-    let data = {array: raw, offset: 0};
-    let octetArray = WSP.Octet.decodeMultiple(data, data.array.length);
-    wsp_decode_test_ex(function(data) {
-        return WSP.PduHelper.decodeStringContent(data.array, "utf-16");
-      }, raw, str);
-  }
-
-  run_next_test();
-});
-
-//// PduHelper.composeMultiPart ////
-
-add_test(function test_PduHelper_composeMultiPart() {
-  let multiStream = Components.classes["@mozilla.org/io/multiplex-input-stream;1"]
-                    .createInstance(Ci.nsIMultiplexInputStream);
-  let uint8Array = new Uint8Array(5);
-  uint8Array[0] = 0x00;
-  uint8Array[1] = 0x01;
-  uint8Array[2] = 0x02;
-  uint8Array[3] = 0x03;
-  uint8Array[4] = 0x04;
-
-  let parts = [
-      {
-        content: "content",
-        headers: {
-            "content-type": {
-                media: "text/plain",
-                params: {}
-            }
-        }
-      },
-      {
-        content: uint8Array,
-        headers: {
-            "content-type": {
-                media: "text/plain",
-                params: {}
-            }
-        }
-      }
-    ];
-
-  let beforeCompose = JSON.stringify(parts);
-  WSP.PduHelper.composeMultiPart(multiStream, parts);
-  let afterCompose = JSON.stringify(parts);
-
-  do_check_eq(beforeCompose, afterCompose);
-  run_next_test();
-});
new file mode 100644
--- /dev/null
+++ b/dom/mobilemessage/tests/xpcshell/test_wsp_pdu_helper_header.js
@@ -0,0 +1,223 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+let WSP = {};
+subscriptLoader.loadSubScript("resource://gre/modules/WspPduHelper.jsm", WSP);
+WSP.debug = do_print;
+
+function run_test() {
+  run_next_test();
+}
+
+//
+// Test target: ensureHeader
+//
+
+add_test(function test_ensureHeader() {
+  do_check_throws(function() {
+      WSP.ensureHeader({}, "no-such-property");
+    }, "FatalCodeError"
+  );
+
+  run_next_test();
+});
+
+//
+// Test target: Header
+//
+
+//// Header.decode ////
+
+add_test(function test_Header_decode() {
+  wsp_decode_test(WSP.Header, [0x34 | 0x80, 0x80], {name: "push-flag", value: 0});
+  wsp_decode_test(WSP.Header, [65, 0, 66, 0], {name: "a", value: "B"});
+
+  run_next_test();
+});
+
+//
+// Test target: WellKnownHeader
+//
+
+//// WellKnownHeader.decode ////
+
+add_test(function test_WellKnownHeader_decode() {
+  wsp_decode_test(WSP.WellKnownHeader, [0xFF], null, "NotWellKnownEncodingError");
+  let (entry = WSP.WSP_HEADER_FIELDS["push-flag"]) {
+    // Test for Short-Integer
+    wsp_decode_test(WSP.WellKnownHeader, [entry.number | 0x80, 0x80],
+                        {name: entry.name, value: 0});
+    // Test for NoValue
+    wsp_decode_test(WSP.WellKnownHeader, [entry.number | 0x80, 0],
+                        {name: entry.name, value: null});
+    // Test for TokenText
+    wsp_decode_test(WSP.WellKnownHeader, [entry.number | 0x80, 65, 0],
+                        {name: entry.name, value: "A"});
+    // Test for QuotedString
+    wsp_decode_test(WSP.WellKnownHeader, [entry.number | 0x80, 34, 128, 0],
+                        {name: entry.name, value: String.fromCharCode(128)});
+    // Test for skipValue
+    wsp_decode_test(WSP.WellKnownHeader, [entry.number | 0x80, 2, 0, 0], null);
+  }
+
+  run_next_test();
+});
+
+//
+// Test target: ApplicationHeader
+//
+
+//// ApplicationHeader.decode ////
+
+add_test(function test_ApplicationHeader_decode() {
+  wsp_decode_test(WSP.ApplicationHeader, [5, 0, 66, 0], null, "CodeError");
+  wsp_decode_test(WSP.ApplicationHeader, [65, 0, 66, 0], {name: "a", value: "B"});
+  // Test for skipValue
+  wsp_decode_test(WSP.ApplicationHeader, [65, 0, 2, 0, 0], null);
+
+  run_next_test();
+});
+
+//// ApplicationHeader.encode ////
+
+add_test(function test_ApplicationHeader_encode() {
+  // Test invalid header name string:
+  wsp_encode_test(WSP.ApplicationHeader, {name: undefined, value: "asdf"}, null, "CodeError");
+  wsp_encode_test(WSP.ApplicationHeader, {name: null, value: "asdf"}, null, "CodeError");
+  wsp_encode_test(WSP.ApplicationHeader, {name: "", value: "asdf"}, null, "CodeError");
+  wsp_encode_test(WSP.ApplicationHeader, {name: "a b", value: "asdf"}, null, "CodeError");
+  // Test value string:
+  wsp_encode_test(WSP.ApplicationHeader, {name: "asdf", value: undefined},
+                  strToCharCodeArray("asdf").concat([0]));
+  wsp_encode_test(WSP.ApplicationHeader, {name: "asdf", value: null},
+                  strToCharCodeArray("asdf").concat([0]));
+  wsp_encode_test(WSP.ApplicationHeader, {name: "asdf", value: ""},
+                  strToCharCodeArray("asdf").concat([0]));
+  wsp_encode_test(WSP.ApplicationHeader, {name: "asdf", value: "fdsa"},
+                  strToCharCodeArray("asdf").concat(strToCharCodeArray("fdsa")));
+
+  run_next_test();
+});
+
+//
+// Test target: FieldName
+//
+
+//// FieldName.decode ////
+
+add_test(function test_FieldName_decode() {
+  wsp_decode_test(WSP.FieldName, [0], "");
+  wsp_decode_test(WSP.FieldName, [65, 0], "a");
+  wsp_decode_test(WSP.FieldName, [97, 0], "a");
+  let (entry = WSP.WSP_HEADER_FIELDS["content-length"]) {
+    wsp_decode_test(WSP.FieldName, [entry.number | 0x80], entry.name);
+  }
+  wsp_decode_test(WSP.FieldName, [0xFF], null, "NotWellKnownEncodingError");
+
+  run_next_test();
+});
+
+//// FieldName.encode ////
+
+add_test(function test_FieldName_encode() {
+  wsp_encode_test(WSP.FieldName, "", [0]);
+  wsp_encode_test(WSP.FieldName, "date", [0x92]);
+
+  run_next_test();
+});
+
+//
+// Test target: PduHelper
+//
+
+//// PduHelper.parseHeaders ////
+
+add_test(function test_PduHelper_parseHeaders() {
+  wsp_decode_test_ex(function(data) {
+      return WSP.PduHelper.parseHeaders(data, data.array.length);
+    }, [0x80 | 0x05, 2, 0x23, 0x28, 0x80 | 0x2F, 0x80 | 0x04],
+    {"age": 9000, "x-wap-application-id": "x-wap-application:mms.ua"}
+  );
+
+  run_next_test();
+});
+
+//// PduHelper.decodeStringContent ////
+
+add_test(function StringContent_decode() {
+  //Test for utf-8
+  let (entry = WSP.WSP_WELL_KNOWN_CHARSETS["utf-8"]) {
+    // "Mozilla" in full width.
+    let str = "\uff2d\uff4f\uff5a\uff49\uff4c\uff4c\uff41";
+
+    let conv = Cc["@mozilla.org/intl/scriptableunicodeconverter"]
+               .createInstance(Ci.nsIScriptableUnicodeConverter);
+    conv.charset = entry.converter;
+
+    let raw = conv.convertToByteArray(str);
+    let data = {array: raw, offset: 0};
+    let octetArray = WSP.Octet.decodeMultiple(data, data.array.length);
+    wsp_decode_test_ex(function(data) {
+        return WSP.PduHelper.decodeStringContent(data.array, "utf-8");
+      }, octetArray, str);
+  }
+
+  let (entry = WSP.WSP_WELL_KNOWN_CHARSETS["utf-16"]) {
+    // "Mozilla" in full width.
+    let str = "\u004d\u006F\u007A\u0069\u006C\u006C\u0061";
+
+    let conv = Cc["@mozilla.org/intl/scriptableunicodeconverter"]
+               .createInstance(Ci.nsIScriptableUnicodeConverter);
+    conv.charset = entry.converter;
+
+    let raw = conv.convertToByteArray(str);
+    let data = {array: raw, offset: 0};
+    let octetArray = WSP.Octet.decodeMultiple(data, data.array.length);
+    wsp_decode_test_ex(function(data) {
+        return WSP.PduHelper.decodeStringContent(data.array, "utf-16");
+      }, raw, str);
+  }
+
+  run_next_test();
+});
+
+//// PduHelper.composeMultiPart ////
+
+add_test(function test_PduHelper_composeMultiPart() {
+  let multiStream = Components.classes["@mozilla.org/io/multiplex-input-stream;1"]
+                    .createInstance(Ci.nsIMultiplexInputStream);
+  let uint8Array = new Uint8Array(5);
+  uint8Array[0] = 0x00;
+  uint8Array[1] = 0x01;
+  uint8Array[2] = 0x02;
+  uint8Array[3] = 0x03;
+  uint8Array[4] = 0x04;
+
+  let parts = [
+      {
+        content: "content",
+        headers: {
+            "content-type": {
+                media: "text/plain",
+                params: {}
+            }
+        }
+      },
+      {
+        content: uint8Array,
+        headers: {
+            "content-type": {
+                media: "text/plain",
+                params: {}
+            }
+        }
+      }
+    ];
+
+  let beforeCompose = JSON.stringify(parts);
+  WSP.PduHelper.composeMultiPart(multiStream, parts);
+  let afterCompose = JSON.stringify(parts);
+
+  do_check_eq(beforeCompose, afterCompose);
+  run_next_test();
+});
new file mode 100644
--- /dev/null
+++ b/dom/mobilemessage/tests/xpcshell/test_wsp_pdu_helper_numeric.js
@@ -0,0 +1,240 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+let WSP = {};
+subscriptLoader.loadSubScript("resource://gre/modules/WspPduHelper.jsm", WSP);
+WSP.debug = do_print;
+
+function run_test() {
+  run_next_test();
+}
+
+//
+// Test target: Octet
+//
+
+//// Octet.decode ////
+
+add_test(function test_Octet_decode() {
+  wsp_decode_test(WSP.Octet, [1], 1);
+  wsp_decode_test(WSP.Octet, [], null, "RangeError");
+
+  run_next_test();
+});
+
+//// Octet.decodeMultiple ////
+
+add_test(function test_Octet_decodeMultiple() {
+  wsp_decode_test_ex(function(data) {
+      return WSP.Octet.decodeMultiple(data, 3);
+    }, [0, 1, 2], [0, 1, 2], null
+  );
+  wsp_decode_test_ex(function(data) {
+      return WSP.Octet.decodeMultiple(data, 3);
+    }, new Uint8Array([0, 1, 2]), new Uint8Array([0, 1, 2]), null
+  );
+  wsp_decode_test_ex(function(data) {
+      return WSP.Octet.decodeMultiple(data, 4);
+    }, [0, 1, 2], null, "RangeError"
+  );
+
+  run_next_test();
+});
+
+//// Octet.decodeEqualTo ////
+
+add_test(function test_Octet_decodeEqualTo() {
+  wsp_decode_test_ex(function(data) {
+      return WSP.Octet.decodeEqualTo(data, 1);
+    }, [1], 1, null
+  );
+  wsp_decode_test_ex(function(data) {
+      return WSP.Octet.decodeEqualTo(data, 2);
+    }, [1], null, "CodeError"
+  );
+  wsp_decode_test_ex(function(data) {
+      return WSP.Octet.decodeEqualTo(data, 2);
+    }, [], null, "RangeError"
+  );
+
+  run_next_test();
+});
+
+//// Octet.encode ////
+
+add_test(function test_Octet_encode() {
+  for (let i = 0; i < 256; i++) {
+    wsp_encode_test(WSP.Octet, i, [i]);
+  }
+
+  run_next_test();
+});
+
+//// Octet.encodeMultiple ////
+
+add_test(function test_Octet_encodeMultiple() {
+  wsp_encode_test_ex(function(data, input) {
+    WSP.Octet.encodeMultiple(data, input);
+    return data.array;
+  }, [0, 1, 2, 3], [0, 1, 2, 3]);
+
+  run_next_test();
+});
+
+//
+// Test target: ShortInteger
+//
+
+//// ShortInteger.decode ////
+
+add_test(function test_ShortInteger_decode() {
+  for (let i = 0; i < 256; i++) {
+    if (i & 0x80) {
+      wsp_decode_test(WSP.ShortInteger, [i], i & 0x7F);
+    } else {
+      wsp_decode_test(WSP.ShortInteger, [i], null, "CodeError");
+    }
+  }
+
+  run_next_test();
+});
+
+//// ShortInteger.encode ////
+
+add_test(function test_ShortInteger_encode() {
+  for (let i = 0; i < 256; i++) {
+    if (i & 0x80) {
+      wsp_encode_test(WSP.ShortInteger, i, null, "CodeError");
+    } else {
+      wsp_encode_test(WSP.ShortInteger, i, [0x80 | i]);
+    }
+  }
+
+  run_next_test();
+});
+
+//
+// Test target: LongInteger
+//
+
+//// LongInteger.decode ////
+
+function LongInteger_decode_testcases(target) {
+  // Test LongInteger of zero octet
+  wsp_decode_test(target, [0, 0], null, "CodeError");
+  wsp_decode_test(target, [1, 0x80], 0x80);
+  wsp_decode_test(target, [2, 0x80, 2], 0x8002);
+  wsp_decode_test(target, [3, 0x80, 2, 3], 0x800203);
+  wsp_decode_test(target, [4, 0x80, 2, 3, 4], 0x80020304);
+  wsp_decode_test(target, [5, 0x80, 2, 3, 4, 5], 0x8002030405);
+  wsp_decode_test(target, [6, 0x80, 2, 3, 4, 5, 6], 0x800203040506);
+  // Test LongInteger of more than 6 octets
+  wsp_decode_test(target, [7, 0x80, 2, 3, 4, 5, 6, 7], [0x80, 2, 3, 4, 5, 6, 7]);
+  // Test LongInteger of more than 30 octets
+  wsp_decode_test(target, [31], null, "CodeError");
+}
+add_test(function test_LongInteger_decode() {
+  LongInteger_decode_testcases(WSP.LongInteger);
+
+  run_next_test();
+});
+
+//// LongInteger.encode ////
+
+function LongInteger_encode_testcases(target) {
+  wsp_encode_test(target, 0x80,           [1, 0x80]);
+  wsp_encode_test(target, 0x8002,         [2, 0x80, 2]);
+  wsp_encode_test(target, 0x800203,       [3, 0x80, 2, 3]);
+  wsp_encode_test(target, 0x80020304,     [4, 0x80, 2, 3, 4]);
+  wsp_encode_test(target, 0x8002030405,   [5, 0x80, 2, 3, 4, 5]);
+  wsp_encode_test(target, 0x800203040506, [6, 0x80, 2, 3, 4, 5, 6]);
+  // Test LongInteger of more than 6 octets
+  wsp_encode_test(target, 0x1000000000000, null, "CodeError");
+  // Test input empty array
+  wsp_encode_test(target, [], null, "CodeError");
+  // Test input octets array of length 1..30
+  let array = [];
+  for (let i = 1; i <= 30; i++) {
+    array.push(i);
+    wsp_encode_test(target, array, [i].concat(array));
+  }
+  // Test input octets array of 31 elements.
+  array.push(31);
+  wsp_encode_test(target, array, null, "CodeError");
+}
+add_test(function test_LongInteger_encode() {
+  wsp_encode_test(WSP.LongInteger, 0, [1, 0]);
+
+  LongInteger_encode_testcases(WSP.LongInteger);
+
+  run_next_test();
+});
+
+//
+// Test target: UintVar
+//
+
+//// UintVar.decode ////
+
+add_test(function test_UintVar_decode() {
+  wsp_decode_test(WSP.UintVar, [0x80], null, "RangeError");
+  // Test up to max 53 bits integer
+  wsp_decode_test(WSP.UintVar, [0x7F], 0x7F);
+  wsp_decode_test(WSP.UintVar, [0xFF, 0x7F], 0x3FFF);
+  wsp_decode_test(WSP.UintVar, [0xFF, 0xFF, 0x7F], 0x1FFFFF);
+  wsp_decode_test(WSP.UintVar, [0xFF, 0xFF, 0xFF, 0x7F], 0xFFFFFFF);
+  wsp_decode_test(WSP.UintVar, [0xFF, 0xFF, 0xFF, 0xFF, 0x7F], 0x7FFFFFFFF);
+  wsp_decode_test(WSP.UintVar, [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F], 0x3FFFFFFFFFF);
+  wsp_decode_test(WSP.UintVar, [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F], 0x1FFFFFFFFFFFF);
+  wsp_decode_test(WSP.UintVar, [0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F], 0x1FFFFFFFFFFFFF);
+  wsp_decode_test(WSP.UintVar, [0x01, 0x02], 1);
+  wsp_decode_test(WSP.UintVar, [0x80, 0x01, 0x02], 1);
+  wsp_decode_test(WSP.UintVar, [0x80, 0x80, 0x80, 0x01, 0x2], 1);
+
+  run_next_test();
+});
+
+//// UintVar.encode ////
+
+add_test(function test_UintVar_encode() {
+  // Test up to max 53 bits integer
+  wsp_encode_test(WSP.UintVar, 0, [0]);
+  wsp_encode_test(WSP.UintVar, 0x7F, [0x7F]);
+  wsp_encode_test(WSP.UintVar, 0x3FFF, [0xFF, 0x7F]);
+  wsp_encode_test(WSP.UintVar, 0x1FFFFF, [0xFF, 0xFF, 0x7F]);
+  wsp_encode_test(WSP.UintVar, 0xFFFFFFF, [0xFF, 0xFF, 0xFF, 0x7F]);
+  wsp_encode_test(WSP.UintVar, 0x7FFFFFFFF, [0xFF, 0xFF, 0xFF, 0xFF, 0x7F]);
+  wsp_encode_test(WSP.UintVar, 0x3FFFFFFFFFF, [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F]);
+  wsp_encode_test(WSP.UintVar, 0x1FFFFFFFFFFFF, [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F]);
+  wsp_encode_test(WSP.UintVar, 0x1FFFFFFFFFFFFF, [0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F]);
+
+  run_next_test();
+});
+
+//
+// Test target: IntegerValue
+//
+
+//// IntegerValue.decode ////
+
+add_test(function test_IntegerValue_decode() {
+  for (let i = 128; i < 256; i++) {
+    wsp_decode_test(WSP.IntegerValue, [i], i & 0x7F);
+  }
+
+  LongInteger_decode_testcases(WSP.IntegerValue);
+
+  run_next_test();
+});
+
+//// IntegerValue.decode ////
+
+add_test(function test_IntegerValue_encode() {
+  for (let i = 0; i < 128; i++) {
+    wsp_encode_test(WSP.IntegerValue, i, [0x80 | i]);
+  }
+
+  LongInteger_encode_testcases(WSP.IntegerValue);
+
+  run_next_test();
+});
new file mode 100644
--- /dev/null
+++ b/dom/mobilemessage/tests/xpcshell/test_wsp_pdu_helper_parameter.js
@@ -0,0 +1,132 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+let WSP = {};
+subscriptLoader.loadSubScript("resource://gre/modules/WspPduHelper.jsm", WSP);
+WSP.debug = do_print;
+
+function run_test() {
+  run_next_test();
+}
+
+//
+// Test target: Parameter
+//
+
+//// Parameter.decodeTypedParameter ////
+
+add_test(function test_Parameter_decodeTypedParameter() {
+  function func(data) {
+    return WSP.Parameter.decodeTypedParameter(data);
+  }
+
+  // Test for array-typed return value from IntegerValue
+  wsp_decode_test_ex(func, [7, 0, 0, 0, 0, 0, 0, 0], null, "CodeError");
+  // Test for number-typed return value from IntegerValue
+  wsp_decode_test_ex(func, [1, 0, 0], {name: "q", value: null});
+  // Test for NotWellKnownEncodingError
+  wsp_decode_test_ex(func, [1, 0xFF], null, "NotWellKnownEncodingError");
+  // Test for parameter specific decoder
+  wsp_decode_test_ex(func, [1, 0, 100], {name: "q", value: 0.99});
+  // Test for TextValue
+  wsp_decode_test_ex(func, [1, 0x10, 48, 46, 57, 57, 0],
+                     {name: "secure", value: "0.99"});
+  // Test for TextString
+  wsp_decode_test_ex(func, [1, 0x0A, 60, 115, 109, 105, 108, 62, 0],
+                     {name: "start", value: "<smil>"});
+  // Test for skipValue
+  wsp_decode_test_ex(func, [1, 0x0A, 128], null);
+
+  run_next_test();
+});
+
+//// Parameter.decodeUntypedParameter ////
+
+add_test(function test_Parameter_decodeUntypedParameter() {
+  function func (data) {
+    return WSP.Parameter.decodeUntypedParameter(data);
+  }
+
+  wsp_decode_test_ex(func, [1], null, "CodeError");
+  wsp_decode_test_ex(func, [65, 0, 0], {name: "a", value: null});
+  // Test for IntegerValue
+  wsp_decode_test_ex(func, [65, 0, 1, 0], {name: "a", value: 0});
+  // Test for TextValue
+  wsp_decode_test_ex(func, [65, 0, 66, 0], {name: "a", value: "B"});
+
+  run_next_test();
+});
+
+//// Parameter.decode ////
+
+add_test(function test_Parameter_decode() {
+  wsp_decode_test(WSP.Parameter, [1, 0x0A, 60, 115, 109, 105, 108, 62, 0],
+                  {name: "start", value: "<smil>"});
+  wsp_decode_test(WSP.Parameter, [65, 0, 66, 0], {name: "a", value: "B"});
+
+  run_next_test();
+});
+
+//// Parameter.decodeMultiple ////
+
+add_test(function test_Parameter_decodeMultiple() {
+  wsp_decode_test_ex(function(data) {
+      return WSP.Parameter.decodeMultiple(data, 13);
+    }, [1, 0x0A, 60, 115, 109, 105, 108, 62, 0, 65, 0, 66, 0], {start: "<smil>", a: "B"}
+  );
+
+  run_next_test();
+});
+
+//// Parameter.encodeTypedParameter ////
+
+add_test(function test_Parameter_encodeTypedParameter() {
+  function func(data, input) {
+    WSP.Parameter.encodeTypedParameter(data, input);
+    return data.array;
+  }
+
+  // Test for NotWellKnownEncodingError
+  wsp_encode_test_ex(func, {name: "xxx", value: 0}, null, "NotWellKnownEncodingError");
+  wsp_encode_test_ex(func, {name: "q", value: 0}, [0x80, 1]);
+  wsp_encode_test_ex(func, {name: "name", value: "A"}, [0x85, 65, 0]);
+
+  run_next_test();
+});
+
+//// Parameter.encodeUntypedParameter ////
+
+add_test(function test_Parameter_encodeUntypedParameter() {
+  function func(data, input) {
+    WSP.Parameter.encodeUntypedParameter(data, input);
+    return data.array;
+  }
+
+  wsp_encode_test_ex(func, {name: "q", value: 0}, [113, 0, 0x80]);
+  wsp_encode_test_ex(func, {name: "name", value: "A"}, [110, 97, 109, 101, 0, 65, 0]);
+
+  run_next_test();
+});
+
+//// Parameter.encodeMultiple ////
+
+add_test(function test_Parameter_encodeMultiple() {
+  function func(data, input) {
+    WSP.Parameter.encodeMultiple(data, input);
+    return data.array;
+  }
+
+  wsp_encode_test_ex(func, {q: 0, n: "A"}, [0x80, 1, 110, 0, 65, 0]);
+
+  run_next_test();
+});
+
+//// Parameter.encode ////
+
+add_test(function test_Parameter_encode() {
+
+  wsp_encode_test(WSP.Parameter, {name: "q", value: 0}, [0x80, 1]);
+  wsp_encode_test(WSP.Parameter, {name: "n", value: "A"}, [110, 0, 65, 0]);
+
+  run_next_test();
+});
new file mode 100644
--- /dev/null
+++ b/dom/mobilemessage/tests/xpcshell/test_wsp_pdu_helper_text.js
@@ -0,0 +1,241 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+let WSP = {};
+subscriptLoader.loadSubScript("resource://gre/modules/WspPduHelper.jsm", WSP);
+WSP.debug = do_print;
+
+function run_test() {
+  run_next_test();
+}
+
+//
+// Test target: Text
+//
+
+//// Text.decode ////
+
+add_test(function test_Text_decode() {
+  for (let i = 0; i < 256; i++) {
+    if (i == 0) {
+      wsp_decode_test(WSP.Text, [0], null, "NullCharError");
+    } else if ((i < WSP.CTLS) || (i == WSP.DEL)) {
+      wsp_decode_test(WSP.Text, [i], null, "CodeError");
+    } else {
+      wsp_decode_test(WSP.Text, [i], String.fromCharCode(i));
+    }
+  }
+  // Test \r\n(SP|HT)* sequence:
+  wsp_decode_test(WSP.Text, strToCharCodeArray("\r\n \t \t \t", true), " ");
+  wsp_decode_test(WSP.Text, strToCharCodeArray("\r\n \t \t \t"), " ");
+  wsp_decode_test(WSP.Text, strToCharCodeArray("\r\n \t \t \tA"), " ");
+
+  run_next_test();
+});
+
+//// Text.encode ////
+
+add_test(function test_Text_encode() {
+  for (let i = 0; i < 256; i++) {
+    if ((i < WSP.CTLS) || (i == WSP.DEL)) {
+      wsp_encode_test(WSP.Text, String.fromCharCode(i), null, "CodeError");
+    } else {
+      wsp_encode_test(WSP.Text, String.fromCharCode(i), [i]);
+    }
+  }
+
+  run_next_test();
+});
+
+//
+// Test target: NullTerminatedTexts
+//
+
+//// NullTerminatedTexts.decode ////
+
+add_test(function test_NullTerminatedTexts_decode() {
+  // Test incompleted string:
+  wsp_decode_test(WSP.NullTerminatedTexts, strToCharCodeArray(" ", true), null, "RangeError");
+  // Test control char:
+  wsp_decode_test(WSP.NullTerminatedTexts, strToCharCodeArray(" \n"), null, "CodeError");
+  // Test normal string:
+  wsp_decode_test(WSP.NullTerminatedTexts, strToCharCodeArray(""), "");
+  wsp_decode_test(WSP.NullTerminatedTexts, strToCharCodeArray("oops"), "oops");
+  // Test \r\n(SP|HT)* sequence:
+  wsp_decode_test(WSP.NullTerminatedTexts, strToCharCodeArray("A\r\n \t \t \tB"), "A B");
+
+  run_next_test();
+});
+
+//// NullTerminatedTexts.encode ////
+
+add_test(function test_NullTerminatedTexts_encode() {
+  wsp_encode_test(WSP.NullTerminatedTexts, "", [0]);
+  wsp_encode_test(WSP.NullTerminatedTexts, "Hello, World!",
+                  strToCharCodeArray("Hello, World!"));
+
+  run_next_test();
+});
+
+//
+// Test target: Token
+//
+
+let TOKEN_SEPS = "()<>@,;:\\\"/[]?={} \t";
+
+//// Token.decode ////
+
+add_test(function test_Token_decode() {
+  for (let i = 0; i < 256; i++) {
+    if (i == 0) {
+      wsp_decode_test(WSP.Token, [i], null, "NullCharError");
+    } else if ((i < WSP.CTLS) || (i >= WSP.ASCIIS)
+        || (TOKEN_SEPS.indexOf(String.fromCharCode(i)) >= 0)) {
+      wsp_decode_test(WSP.Token, [i], null, "CodeError");
+    } else {
+      wsp_decode_test(WSP.Token, [i], String.fromCharCode(i));
+    }
+  }
+
+  run_next_test();
+});
+
+//// Token.encode ////
+
+add_test(function test_Token_encode() {
+  for (let i = 0; i < 256; i++) {
+    if ((i < WSP.CTLS) || (i >= WSP.ASCIIS)
+        || (TOKEN_SEPS.indexOf(String.fromCharCode(i)) >= 0)) {
+      wsp_encode_test(WSP.Token, String.fromCharCode(i), null, "CodeError");
+    } else {
+      wsp_encode_test(WSP.Token, String.fromCharCode(i), [i]);
+    }
+  }
+
+  run_next_test();
+});
+
+//
+// Test target: URIC
+//
+
+//// URIC.decode ////
+
+add_test(function test_URIC_decode() {
+  let uric = "!#$%&'()*+,-./0123456789:;=?@ABCDEFGHIJKLMN"
+             + "OPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~";
+  for (let i = 0; i < 256; i++) {
+    if (i == 0) {
+      wsp_decode_test(WSP.URIC, [i], null, "NullCharError");
+    } else if (uric.indexOf(String.fromCharCode(i)) >= 0) {
+      wsp_decode_test(WSP.URIC, [i], String.fromCharCode(i));
+    } else {
+      wsp_decode_test(WSP.URIC, [i], null, "CodeError");
+    }
+  }
+
+  run_next_test();
+});
+
+//
+// Test target: TextString
+//
+
+//// TextString.decode ////
+
+add_test(function test_TextString_decode() {
+  // Test quoted string
+  wsp_decode_test(WSP.TextString, [127, 128, 0], String.fromCharCode(128));
+  // Test illegal quoted string
+  wsp_decode_test(WSP.TextString, [127, 32, 0], null, "CodeError");
+  // Test illegal unquoted string
+  wsp_decode_test(WSP.TextString, [128, 0], null, "CodeError");
+  // Test normal string
+  wsp_decode_test(WSP.TextString, [32, 0], " ");
+
+  run_next_test();
+});
+
+//// TextString.encode ////
+
+add_test(function test_TextString_encode() {
+  // Test quoted string
+  wsp_encode_test(WSP.TextString, String.fromCharCode(128), [127, 128, 0]);
+  // Test normal string
+  wsp_encode_test(WSP.TextString, "Mozilla", strToCharCodeArray("Mozilla"));
+
+  run_next_test();
+});
+
+//
+// Test target: TokenText
+//
+
+//// TokenText.decode ////
+
+add_test(function test_TokenText_decode() {
+  wsp_decode_test(WSP.TokenText, [65], null, "RangeError");
+  wsp_decode_test(WSP.TokenText, [0], "");
+  wsp_decode_test(WSP.TokenText, [65, 0], "A");
+
+  run_next_test();
+});
+
+//// TokenText.encode ////
+
+add_test(function test_TokenText_encode() {
+  wsp_encode_test(WSP.TokenText, "B2G", strToCharCodeArray("B2G"));
+
+  run_next_test();
+});
+
+//
+// Test target: QuotedString
+//
+
+//// QuotedString.decode ////
+
+add_test(function test_QuotedString_decode() {
+  // Test non-quoted string
+  wsp_decode_test(WSP.QuotedString, [32, 0], null, "CodeError");
+  // Test incompleted string
+  wsp_decode_test(WSP.QuotedString, [34, 32], null, "RangeError");
+  wsp_decode_test(WSP.QuotedString, [34, 32, 0], " ");
+
+  run_next_test();
+});
+
+//// QuotedString.encode ////
+
+add_test(function test_QuotedString_encode() {
+  wsp_encode_test(WSP.QuotedString, "B2G", [34].concat(strToCharCodeArray("B2G")));
+
+  run_next_test();
+});
+
+//
+// Test target: TextValue
+//
+
+//// TextValue.decode ////
+
+add_test(function test_TextValue_decode() {
+  wsp_decode_test(WSP.TextValue, [0], null);
+  wsp_decode_test(WSP.TextValue, [65, 0], "A");
+  wsp_decode_test(WSP.TextValue, [32, 0], null, "CodeError");
+  wsp_decode_test(WSP.TextValue, [34, 32, 0], " ");
+
+  run_next_test();
+});
+
+//// TextValue.encode ////
+
+add_test(function test_TextValue_encode() {
+  wsp_encode_test(WSP.TextValue, undefined, [0]);
+  wsp_encode_test(WSP.TextValue, null, [0]);
+  wsp_encode_test(WSP.TextValue, "", [0]);
+  wsp_encode_test(WSP.TextValue, "A", [65, 0]);
+  wsp_encode_test(WSP.TextValue, "\x80", [34, 128, 0]);
+
+  run_next_test();
+});
--- a/dom/mobilemessage/tests/xpcshell/xpcshell.ini
+++ b/dom/mobilemessage/tests/xpcshell/xpcshell.ini
@@ -1,11 +1,19 @@
 [DEFAULT]
 head = header_helpers.js
 tail =
 
 [test_smsservice_createsmsmessage.js]
 [test_wsp_pdu_helper.js]
 run-if = toolkit == "gonk"
+[test_wsp_pdu_helper_header.js]
+run-if = toolkit == "gonk"
+[test_wsp_pdu_helper_numeric.js]
+run-if = toolkit == "gonk"
+[test_wsp_pdu_helper_parameter.js]
+run-if = toolkit == "gonk"
+[test_wsp_pdu_helper_text.js]
+run-if = toolkit == "gonk"
 [test_mms_pdu_helper.js]
 run-if = toolkit == "gonk"
 [test_mms_service.js]
 run-if = toolkit == "gonk"
--- a/dom/permission/tests/test_sms.html
+++ b/dom/permission/tests/test_sms.html
@@ -16,17 +16,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 <pre id="test">
 <script type="application/javascript;version=1.8" src="file_framework.js"></script>
 <script type="application/javascript;version=1.8">
 var gData = [
   {
     perm: ["sms"],
     needParentPerm: true,
     obj: "mozMobileMessage",
-    idl: "nsIDOMMozMobileMessageManager",
+    webidl: "MozMobileMessageManager",
     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
@@ -667,17 +667,17 @@ var interfaceNamesInGlobalScope =
     {name: "MozMobileConnection", b2g: true, pref: "dom.mobileconnection.enabled"},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "MozMobileConnectionArray", b2g: true, pref: "dom.mobileconnection.enabled"},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "MozMobileConnectionInfo", b2g: true, pref: "dom.mobileconnection.enabled"},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "MozMobileNetworkInfo", b2g: true, pref: "dom.mobileconnection.enabled"},
 // IMPORTANT: Do not change this list without review from a DOM peer!
-    "MozMobileMessageManager",
+    {name: "MozMobileMessageManager", b2g: true, pref: "dom.sms.enabled"},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "MozMobileMessageThread",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "MozNamedAttrMap",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "MozNDEFRecord", b2g: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "MozNFCPeer", b2g: true},
--- a/dom/webidl/MozMmsMessage.webidl
+++ b/dom/webidl/MozMmsMessage.webidl
@@ -1,24 +1,15 @@
 /* -*- Mode: IDL; 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/.
  */
 
-// If this is changed, change the MmsMessage.h structure as well.
-dictionary MmsAttachment {
-  DOMString? id = null;
-  DOMString? location = null;
-  Blob? content = null;
-};
-
 dictionary MmsDeliveryInfo {
   DOMString? receiver = null;
   DOMString? deliveryStatus = null;
   DOMTimeStamp deliveryTimestamp = 0; // 0 if not available (e.g.,
                                       // |delivery| = "received" or not yet delivered).
   DOMString? readStatus = null;
   DOMTimeStamp readTimestamp = 0; // 0 if not available (e.g.,
                                   // |delivery| = "received" or not yet read).
 };
-
-// If we start using MmsParameters here, remove it from DummyBinding.
rename from dom/webidl/MobileMessageManager.webidl
rename to dom/webidl/MozMobileMessageManager.webidl
--- a/dom/webidl/MobileMessageManager.webidl
+++ b/dom/webidl/MozMobileMessageManager.webidl
@@ -1,24 +1,123 @@
 /* -*- Mode: IDL; 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/.
  */
 
+interface MozMmsMessage;
+interface MozSmsFilter;
+interface MozSmsMessage;
+
+dictionary MmsAttachment {
+  DOMString? id = null;
+  DOMString? location = null;
+  Blob? content = null;
+};
+
 dictionary MmsParameters {
   sequence<DOMString> receivers;
   DOMString? subject = null;
   DOMString? smil = null;
   sequence<MmsAttachment> attachments;
 };
 
-// If we start using MmsParameters here, remove it from DummyBinding.
-
 dictionary SmsSendParameters {
   unsigned long serviceId; // The ID of the RIL service which needs to be
                            // specified under the multi-sim scenario.
 };
 
 dictionary MmsSendParameters {
   unsigned long serviceId; // The ID of the RIL service which needs to be
                            // specified under the multi-sim scenario.
 };
+
+[Pref="dom.sms.enabled"]
+interface MozMobileMessageManager : EventTarget
+{
+  [Throws]
+  DOMRequest getSegmentInfoForText(DOMString text);
+
+  /**
+   * Send SMS.
+   *
+   * @param number
+   *        Either a DOMString (only one number) or an array of numbers.
+   * @param text
+   *        The text message to be sent.
+   * @param sendParameters
+   *        A SmsSendParameters object.
+   *
+   * @return
+   *        A DOMRequest object indicating the sending result if one number
+   *        has been passed; an array of DOMRequest objects otherwise.
+   */
+  [Throws]
+  DOMRequest send(DOMString number,
+                  DOMString text,
+                  optional SmsSendParameters sendParameters);
+  [Throws]
+  sequence<DOMRequest> send(sequence<DOMString> numbers,
+                            DOMString text,
+                            optional SmsSendParameters sendParameters);
+
+  /**
+   * Send MMS.
+   *
+   * @param parameters
+   *        A MmsParameters object.
+   * @param sendParameters
+   *        A MmsSendParameters object.
+   *
+   * @return
+   *        A DOMRequest object indicating the sending result.
+   */
+  [Throws]
+  DOMRequest sendMMS(optional MmsParameters parameters,
+                     optional MmsSendParameters sendParameters);
+
+  [Throws]
+  DOMRequest getMessage(long id);
+
+  // The parameter can be either a message id, or a Moz{Mms,Sms}Message, or an
+  // array of Moz{Mms,Sms}Message objects.
+  [Throws]
+  DOMRequest delete(long id);
+  [Throws]
+  DOMRequest delete(MozSmsMessage message);
+  [Throws]
+  DOMRequest delete(MozMmsMessage message);
+  [Throws]
+  DOMRequest delete(sequence<(long or MozSmsMessage or MozMmsMessage)> params);
+
+  // Iterates through Moz{Mms,Sms}Message.
+  [Throws]
+  DOMCursor getMessages(optional MozSmsFilter? filter = null,
+                        optional boolean reverse = false);
+
+  [Throws]
+  DOMRequest markMessageRead(long id,
+                             boolean read,
+                             optional boolean sendReadReport = false);
+
+  // Iterates through nsIDOMMozMobileMessageThread.
+  [Throws]
+  DOMCursor getThreads();
+
+  [Throws]
+  DOMRequest retrieveMMS(long id);
+  [Throws]
+  DOMRequest retrieveMMS(MozMmsMessage message);
+
+  [Throws]
+  DOMRequest getSmscAddress(optional unsigned long serviceId);
+
+  attribute EventHandler onreceived;
+  attribute EventHandler onretrieving;
+  attribute EventHandler onsending;
+  attribute EventHandler onsent;
+  attribute EventHandler onfailed;
+  attribute EventHandler ondeliverysuccess;
+  attribute EventHandler ondeliveryerror;
+  attribute EventHandler onreadsuccess;
+  attribute EventHandler onreaderror;
+};
--- a/dom/webidl/Navigator.webidl
+++ b/dom/webidl/Navigator.webidl
@@ -240,18 +240,16 @@ partial interface Navigator {
 };
 
 // nsIDOMClientInformation
 partial interface Navigator {
   [Throws]
   boolean mozIsLocallyAvailable(DOMString uri, boolean whenOffline);
 };
 
-// nsIDOMMozNavigatorMobileMessage
-interface MozMobileMessageManager;
 partial interface Navigator {
   [Func="Navigator::HasMobileMessageSupport"]
   readonly attribute MozMobileMessageManager? mozMobileMessage;
 };
 
 // NetworkInformation
 partial interface Navigator {
   [Throws, Pref="dom.netinfo.enabled"]
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -246,21 +246,21 @@ WEBIDL_FILES = [
     'MediaStreamTrack.webidl',
     'MediaTrackConstraintSet.webidl',
     'MessageChannel.webidl',
     'MessageEvent.webidl',
     'MessagePort.webidl',
     'MessagePortList.webidl',
     'MimeType.webidl',
     'MimeTypeArray.webidl',
-    'MobileMessageManager.webidl',
     'MouseEvent.webidl',
     'MouseScrollEvent.webidl',
     'MozActivity.webidl',
     'MozMmsMessage.webidl',
+    'MozMobileMessageManager.webidl',
     'MozNamedAttrMap.webidl',
     'MozPowerManager.webidl',
     'MozTimeManager.webidl',
     'MozWakeLock.webidl',
     'MutableFile.webidl',
     'MutationEvent.webidl',
     'MutationObserver.webidl',
     'NativeOSFileInternals.webidl',
--- a/image/test/reftest/bmp/bmp-corrupted/reftest.list
+++ b/image/test/reftest/bmp/bmp-corrupted/reftest.list
@@ -3,10 +3,10 @@
 == wrapper.html?invalid-signature.bmp about:blank
 == wrapper.html?invalid-bpp.bmp about:blank
 == wrapper.html?os2-invalid-bpp.bmp about:blank
 # Tests for an unsupported compression value
 == wrapper.html?invalid-compression.bmp about:blank
 # Tests for RLE4 with an invalid BPP
 == wrapper.html?invalid-compression-RLE4.bmp about:blank
 # Tests for RLE8 with an invalid BPP
-random-if(B2G&&browserIsRemote) == wrapper.html?invalid-compression-RLE8.bmp about:blank # Bug 921207
+== wrapper.html?invalid-compression-RLE8.bmp about:blank
 
--- a/image/test/reftest/ico/ico-bmp-corrupted/reftest.list
+++ b/image/test/reftest/ico/ico-bmp-corrupted/reftest.list
@@ -1,15 +1,15 @@
 # ICOs containing corrupted BMP tests
 
 # Invalid value for bits per pixel (BPP)
 == wrapper.html?invalid-bpp.ico about:blank
 # Invalid BPP values for RLE4
-random-if(B2G&&browserIsRemote) == wrapper.html?invalid-compression-RLE4.ico about:blank
+== wrapper.html?invalid-compression-RLE4.ico about:blank
 # Invalid BPP values for RLE8
-random-if(B2G&&browserIsRemote) == wrapper.html?invalid-compression-RLE8.ico about:blank
+== wrapper.html?invalid-compression-RLE8.ico about:blank
 # Invalid compression value
 == wrapper.html?invalid-compression.ico about:blank
 
 # Invalid ICO width and heigth should be ignored if the
 # contained BMP is correct.
 == invalid_ico_height.ico 16x16.png
 == invalid_ico_width.ico 16x16.png
--- a/layout/reftests/abs-pos/reftest.list
+++ b/layout/reftests/abs-pos/reftest.list
@@ -1,9 +1,9 @@
-random-if(B2G&&browserIsRemote) == font-size-wrap.html font-size-wrap-ref.html
+== font-size-wrap.html font-size-wrap-ref.html
 == abs-pos-auto-margin-1.html abs-pos-auto-margin-1-ref.html
 fuzzy-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!layersGPUAccelerated&&!azureSkia,73,1) == auto-offset-inline-block-1.html auto-offset-inline-block-1-ref.html # bug 696670
 == fieldset-1.html fieldset-1-ref.html
 == table-1.html table-1-ref.html
 == table-2.html table-2-ref.html
 == table-3.html table-3-ref.html
 == table-cell-1.html table-internal-1-ref.html
 == table-cell-2.html table-internal-2-ref.html
--- a/layout/reftests/border-image/reftest.list
+++ b/layout/reftests/border-image/reftest.list
@@ -5,17 +5,17 @@
 == multicolor-image-1.html multicolor-image-1-ref.html
 == multicolor-image-2.html multicolor-image-2-ref.html
 == multicolor-image-3.html multicolor-image-3-ref.html
 == multicolor-image-4.html multicolor-image-4-ref.html
 == multicolor-image-5.html multicolor-image-5-ref.html
 == transparent-image-1.html transparent-image-1-ref.html
 != repeat-image-1.html repeat-image-1-ref.html
 == 470250-1.html 470250-1-ref.html
-random-if(B2G&&browserIsRemote) == 470250-2.html 470250-2-ref.html
+== 470250-2.html 470250-2-ref.html
 != different-h-v-1.html different-h-v-ref.html
 != different-h-v-2.html different-h-v-ref.html
 != different-h-v-1.html different-h-v-2.html
 == center-scaling-1.html center-scaling-1-ref.html
 fails-if(Android||B2G) == center-scaling-2.html center-scaling-2-ref.html # Android/B2G: very different scaling (blurriness) on some sides
 fails-if(Android||B2G) == center-scaling-3.html center-scaling-3-ref.html # Android/B2G: very different scaling (blurriness) on some sides
 == center-scaling-4t.html center-scaling-4t-ref.html
 == center-scaling-4r.html center-scaling-4r-ref.html
--- a/layout/reftests/box-ordinal/reftest.list
+++ b/layout/reftests/box-ordinal/reftest.list
@@ -1,7 +1,7 @@
-skip-if(B2G&&browserIsRemote) == box-ordinal-with-out-of-flow-1.html box-ordinal-with-out-of-flow-1-ref.html
+== box-ordinal-with-out-of-flow-1.html box-ordinal-with-out-of-flow-1-ref.html
 skip-if(B2G&&browserIsRemote) == dynamic-1-remove-to-none-grouped.xul dynamic-1-ref.xul
 skip-if(B2G&&browserIsRemote) == dynamic-1-add-to-one-grouped.xul dynamic-1-ref.xul
 skip-if(B2G&&browserIsRemote) == dynamic-1-remove-to-one-grouped-1.xul dynamic-1-ref.xul
 fails skip-if(B2G&&browserIsRemote) == dynamic-1-remove-to-one-grouped-2.xul dynamic-1-ref.xul # bug 575500
 skip-if(B2G&&browserIsRemote) == dynamic-1-add-to-two-grouped-1.xul dynamic-1-ref.xul
 skip-if(B2G&&browserIsRemote) == dynamic-1-add-to-two-grouped-2.xul dynamic-1-ref.xul
--- a/layout/reftests/box-properties/reftest.list
+++ b/layout/reftests/box-properties/reftest.list
@@ -1,9 +1,9 @@
-random-if(B2G&&browserIsRemote) == outline-radius-percent-1.html outline-radius-percent-1-ref.html
+== outline-radius-percent-1.html outline-radius-percent-1-ref.html
 == min-width-1.html min-width-1-ref.html
 == min-height-1.html min-height-1-ref.html
 == max-width-1.html max-width-1-ref.html
 == max-height-1.html max-height-1-ref.html
 == width-special-values-block.html width-special-values-block-ref.html
 == width-special-values-float.html width-special-values-block-ref.html
 == width-special-values-image-block.html width-special-values-image-block-ref.html
 == width-special-values-image.html width-special-values-image-ref.html
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -301,17 +301,17 @@ skip-if(B2G) == 273681-1.html 273681-1-r
 == 289384-1.xhtml 289384-ref.xhtml
 random-if(d2d) fuzzy-if(Android&&AndroidVersion>=15,8,1439) skip-if(B2G&&browserIsRemote) HTTP == 289480.html#top 289480-ref.html # basically-verbatim acid2 test, HTTP for a 404 page -- bug 578114 for the d2d failures
 == 290129-1.html 290129-1-ref.html
 skip-if(B2G) == 291078-1.html 291078-1-ref.html
 == 291078-2.html 291078-2-ref.html
 == 291262-1.html 291262-1-ref.html
 == 294306-1.html 294306-1a-ref.html
 != 294306-1.html 294306-1b-ref.html
-random-if(B2G&&browserIsRemote) == 296361-1.html 296361-ref.html
+== 296361-1.html 296361-ref.html
 == 296904-1.html 296904-1-ref.html
 skip-if(B2G) == 299136-1.html 299136-1-ref.html
 == 299837-1.html 299837-1-ref.html
 skip-if(B2G&&browserIsRemote) == 299837-2.xul 299837-2-ref.xul # bug 974780
 random-if(d2d) skip-if(B2G&&browserIsRemote) == 299837-3.xul 299837-3-ref.xul # bug 587631, 974780
 == 300691-1a.html 300691-1-ref.html
 == 300691-1b.html 300691-1-ref.html
 == 300691-1c.html 300691-1-ref.html
@@ -461,17 +461,17 @@ skip-if(B2G&&browserIsRemote) == 346189-
 == 347348-1.xhtml 347348-1-ref.xhtml
 == 347496-1.xhtml 347496-1-ref.xhtml
 == 347912-1.html 347912-1-ref.html
 skip-if(B2G&&browserIsRemote) == 348049-1.xhtml 348049-1-ref.xhtml
 == 348516-1.html 348516-1-ref.html
 == 348516-2.html 348516-2-ref.html
 != 348516-2.html 348516-2-notref.html
 != 348516-3.html 348516-3-notref.html
-random-if(B2G&&browserIsRemote) == 348597-1.html 348597-ref.html
+== 348597-1.html 348597-ref.html
 == 348809-1a.html 348809-1-ref.html
 == 348809-1b.html 348809-1-ref.html
 == 348809-1c.html 348809-1-ref.html
 == 348809-1d.html 348809-1-ref.html
 == 348809-1e.html 348809-1-ref.html
 == 348809-1f.html 348809-1-ref.html
 == 348809-2a.html 348809-2-ref.html
 == 348809-2b.html 348809-2-ref.html
@@ -535,17 +535,17 @@ skip-if(B2G) == 359903-1.html 359903-1-r
 == 362594-2a.html 362594-2-quirks-ref.html
 != 362594-2b.html 362594-1-standards-ref.html
 == 362594-2b.html 362594-2-standards-ref.html
 == 362594-2c.html 362594-2-standards-ref.html
 == 362901-1.html 362901-1-ref.html
 == 363247-1.html 363247-1-ref.html
 == 363329-1.html 363329-1-ref.html
 == 363329-2.html 363329-2-ref.html
-random-if(B2G&&browserIsRemote) == 363370-1.html 363370-1-ref.html
+== 363370-1.html 363370-1-ref.html
 == 363402-1.html 363402-1-ref.html
 == 363637-1.html 363637-1-ref.html
 skip-if(Android) == 363706-1.html 363706-1-ref.html
 != 363706-1.html about:blank
 == 363728-1.html 363728-1-ref.html
 == 363728-2.html 363728-2-ref.html
 skip-if(B2G) == 363858-1.html 363858-1-ref.html
 skip-if(B2G) == 363858-2.html 363858-2-ref.html
@@ -693,22 +693,22 @@ skip-if(B2G) == 379349-3a.xhtml 379349-3
 skip-if(B2G) == 379349-3b.xhtml 379349-3-ref.xhtml
 == 379361-1.html 379361-1-ref.html
 == 379361-2.html 379361-2-ref.html
 == 379361-3.html 379361-3-ref.html
 == 379461-1.xhtml 379461-1.html
 == 379461-2.xhtml 379461-2.html
 skip-if(B2G) == 379461-3-container-xhtml.html 379461-3-container-html.html
 skip-if(B2G) fails-if(Android) != 379461-3-container-xhtml.html 379461-3-container-blank.html # there is a scrollbar
-random-if(B2G&&browserIsRemote) == 380004-1.html 380004-1-ref.html
-random-if(B2G&&browserIsRemote) == 380227-1.html 380227-1-ref.html
+== 380004-1.html 380004-1-ref.html
+== 380227-1.html 380227-1-ref.html
 == 380825-1.html 380825-1-ref.html
 == 380842-1.html 380842-1-ref.html
 == 381130-1.html 381130-1-ref.html
-random-if(B2G&&browserIsRemote) == 381507-1.html 381507-1-ref.html
+== 381507-1.html 381507-1-ref.html
 == 381746-1.html 381746-1-ref.html
 == 382600-1.html 382600-1-ref.html
 == 382916-1.html 382916-1-ref.html
 == 383035-1.html about:blank
 == 383035-2.html about:blank
 == 383488-1.html 383488-1-ref.html
 == 383551-1.html 383551-1-ref.html
 == 383883-1.html 383883-1-ref.html
@@ -736,18 +736,18 @@ fails == 385823-2b.html 385823-2-ref.htm
 == 386014-1c.html 386014-1-ref.html
 == 386065-1.html 386065-1-ref.html
 == 386065-2.html about:blank
 skip-if(B2G) fails == 386147-1.html 386147-1-ref.html # bug 447460
 == 386310-1a.html 386310-1-ref.html
 == 386310-1b.html 386310-1-ref.html
 == 386310-1c.html 386310-1-ref.html
 == 386310-1d.html 386310-1-ref.html
-random-if(B2G&&browserIsRemote) == 386401-1.html 386401-1-ref.html
-random-if(B2G&&browserIsRemote) == 386401-2.html 386401-2-ref.html
+== 386401-1.html 386401-1-ref.html
+== 386401-2.html 386401-2-ref.html
 == 386401-3.html 386401-3-ref.html
 == 386470-1a.html 386470-1-ref.html
 == 386470-1b.html 386470-1-ref.html
 == 386470-1c.html 386470-1-ref.html
 == 386920-1.html 386920-1-ref.html
 == 387201-1.html 387201-1-ref.html
 == 387201-2.html about:blank  # Really an assertion test rather than a rendering test
 == 387201-3.html about:blank  # Really an assertion test rather than a rendering test
@@ -755,18 +755,18 @@ random-if(B2G&&browserIsRemote) == 38640
 == 387227-2.html 387227-2-ref.html
 fails == 387344-1.html 387344-1-ref.html # scrolling rowgroups were removed in bug 28800
 == 387876-1.html 387876-1-ref.html
 == 387876-2.html 387876-2-ref.html
 == 387876-3a.html 387876-3-ref.html
 == 387876-3b.html 387876-3-ref.html
 == 388026-1.html 388026-1-ref.html
 == 389074-1.html 389074-1-ref.html
-random-if(B2G&&browserIsRemote) == 389224-1.html 389224-1-ref.html
-random-if(B2G&&browserIsRemote) == 389224-2.html about:blank
+== 389224-1.html 389224-1-ref.html
+== 389224-2.html about:blank
 skip-if(B2G) == 389468-1.html 389468-1-ref.html
 == 389623-1.html 389623-1-ref.html
 skip-if(B2G&&browserIsRemote) == 389636-1.html about:blank  # assertion test # bug 975911
 == 389924-1a.html 389924-1-ref.html
 == 389924-1b.html 389924-1-ref.html
 != 389924-1a.html about:blank
 == 390318-1a.html 390318-1-ref.html
 == 390318-1b.html 390318-1-ref.html
@@ -841,19 +841,19 @@ fails-if(winWidget) fails-if(cocoaWidget
 == 400813-1.html 400813-1-ref.html
 == 400826-1.html 400826-1-ref.html
 skip-if(B2G&&browserIsRemote) == 401946-1.xul about:blank # bug 974780
 == 402338-1.html 402338-1-ref.html
 == 402567-1.html 402567-1-ref.html
 == 402567-2.html 402567-2-ref.html
 == 402567-3.html 402567-3-ref.html
 skip-if(B2G) fuzzy-if(gtk2Widget,2,40) == 402567-4.html 402567-4-ref.html
-random-if(B2G&&browserIsRemote) == 402629-1.html 402629-1-ref.html
-random-if(B2G&&browserIsRemote) == 402629-2.html 402629-2-ref.html
-random-if(B2G&&browserIsRemote) == 402629-3.html 402629-3-ref.html
+== 402629-1.html 402629-1-ref.html
+== 402629-2.html 402629-2-ref.html
+== 402629-3.html 402629-3-ref.html
 skip-if(B2G) == 402807-1.html 402807-1-ref.html
 == 402940-1.html 402940-1-ref.html
 == 402940-1b.html 402940-1-ref.html
 != 402940-2.html 402940-2-notref.html
 != 402940-3.html 402940-3-notref.html
 == 402950-1.html 402950-1-ref.html
 == 403129-1.html 403129-1-ref.html
 == 403129-2.html 403129-2-ref.html
@@ -958,17 +958,17 @@ fails == 413027-3.html 413027-3-ref.html
 == 413286-2a.html 413286-2-ref.html
 == 413286-2b.html 413286-2-ref.html
 == 413286-2c.html 413286-2-ref.html
 == 413286-3.html 413286-3-ref.html
 == 413286-4a.html 413286-4-ref.html
 == 413286-4b.html 413286-4-ref.html
 == 413286-5.html 413286-5-ref.html
 == 413286-6.html 413286-6-ref.html
-skip-if(cocoaWidget) random-if(B2G&&browserIsRemote) == 413292-1.html 413292-1-ref.html # disabling due to failure loading on some mac tinderboxes. See bug 432954
+skip-if(cocoaWidget) == 413292-1.html 413292-1-ref.html # disabling due to failure loading on some mac tinderboxes. See bug 432954
 == 413361-1.html 413361-1-ref.html
 == 413840-background-unchanged.html 413840-background-unchanged-ref.html
 == 413840-ltr-offsets.html 413840-ltr-offsets-ref.html
 == 413840-rtl-offsets.html 413840-rtl-offsets-ref.html
 == 413840-pushed-line-bullet.html 413840-pushed-line-bullet-ref.html
 == 413840-bullet-first-line.html 413840-bullet-first-line-ref.html
 == 413982.html 413982-ref.html
 == 414123.xhtml 414123-ref.xhtml
@@ -1000,17 +1000,17 @@ skip-if(B2G&&browserIsRemote) == 421203-
 skip-if(B2G&&browserIsRemote) == 421203-5.xul 321402-5-ref.xul # bug 974780
 skip-if(B2G&&browserIsRemote) == 421203-6.xul 321402-6-ref.xul # bug 974780
 skip-if(B2G) == 421234-1.html 421234-1-ref.html
 == 421239-1.html 421239-1-ref.html
 == 421239-2.html 421239-2-ref.html
 == 421419-1.html 421419-1-ref.html
 == 421436-1a.html 421436-1-ref.html
 == 421436-1b.html 421436-1-ref.html
-random-if(B2G&&browserIsRemote) == 421632-1.html 421632-1-ref.html
+== 421632-1.html 421632-1-ref.html
 != 421710-1.html about:blank
 skip-if(B2G) fails-if(Android) == 421885-1.xml 421885-1-ref.xml
 == 421955-1.html 421955-1-ref.html
 skip-if(B2G) == 422249-1.html 422249-1-ref.html
 == 422394-1.html 422394-1-ref.html
 == 422678-1.html 422678-1-ref.html
 == 423130-1.html 423130-1-ref.html
 == 423385-1.html 423385-1-ref.html
@@ -1027,17 +1027,17 @@ random-if(gtk2Widget) skip-if(B2G&&brows
 == 424236-5.html 424236-5-ref.html
 == 424236-6.html 424236-6-ref.html
 == 424236-7.html 424236-7-ref.html
 == 424236-8.html 424236-8-ref.html
 == 424236-9.html 424236-9-ref.html
 == 424236-10.html 424236-10-ref.html
 == 424236-11.html 424236-3-ref.html
 == 424434-1.html 424434-1-ref.html
-random-if(B2G&&browserIsRemote) == 424465-1.html 424465-1-ref.html
+== 424465-1.html 424465-1-ref.html
 == 424631-1.html 424631-1-ref.html
 == 424710-1.html 424710-1-ref.html
 skip-if(B2G) == 424766-1.html 424766-1-ref.html
 == 425972-1.html 425972-1-ref.html
 == 425972-2.html 425972-2-ref.html
 != 425972-1.html 425972-2.html
 == 426629-1.html 426629-1-ref.html
 asserts(3) != 427017-1.xhtml about:blank # crash test (needs reftest-print). existing assertions are bug 457400.
@@ -1126,17 +1126,17 @@ skip-if(B2G) == 430412-1.html 430412-1-r
 == 431341-1.html 431341-1-ref.html
 == 431341-2.html 431341-2-ref.html
 == 431520-1.html 431520-1-ref.html
 == 431948-1.html 431948-1-ref.html
 == 433640-1.html 433640-1-ref.html
 == 433700.html 433700-ref.html
 == 436356-1.html 436356-1-ref.html
 == 436356-2.html 436356-2-ref.html
-random-if(B2G&&browserIsRemote) == 438537-1.html 438537-1-ref.html
+== 438537-1.html 438537-1-ref.html
 == 438981-1.xhtml about:blank
 == 438987-1.html 438987-1-ref.html
 == 438987-2a.html 438987-2-ref.html
 == 438987-2b.html 438987-2-ref.html
 == 438987-2c.html 438987-2-ref.html
 != about:blank 438987-2-ref.html # check that backgrounds work at all
 == 439004-1.html 439004-1-ref.html
 == 439639-1.html 439639-1-ref.html
@@ -1169,17 +1169,17 @@ skip-if(B2G) == 447749-1.html 447749-1-r
 fuzzy(127,2) == 448193.html 448193-ref.html
 != 449149-1a.html about:blank
 != 449149-1b.html about:blank
 # Retry the above with XBL scopes
 test-pref(dom.use_xbl_scopes_for_remote_xul,true) != 449149-1a.html about:blank
 test-pref(dom.use_xbl_scopes_for_remote_xul,true) != 449149-1b.html about:blank
 == 449149-2.html 449149-2-ref.html
 == 449171-1.html 449171-ref.html
-random-if(B2G&&browserIsRemote) == 449362-1.html 449362-1-ref.html
+== 449362-1.html 449362-1-ref.html
 == 449519-1.html 449519-1-ref.html
 == 450670-1.html 450670-1-ref.html
 == 451168-1.html 451168-1-ref.html
 == 451876-1.html 451876-1-ref.html
 == 451876-2.html 451876-2-ref.html
 == 452915-1.html 452915-1-ref.html
 == 452964-1.html 452964-1-ref.html
 == 454361.html about:blank
@@ -1247,17 +1247,17 @@ fails skip-if(B2G&&browserIsRemote) == 4
 skip-if(B2G&&browserIsRemote) == 472500-1.xul 472500-1-ref.xul # bug 974780
 == 472769-1a.html 472769-1-ref.html
 == 472769-1b.html 472769-1-ref.html
 == 472769-2.html 472769-2-ref.html
 == 472769-3.html 472769-3-ref.html
 skip-if(B2G&&browserIsRemote) == 473847-1.xul 473847-1-ref.xul # bug 974780
 skip-if(B2G&&browserIsRemote) == 474336-1.xul 474336-1-ref.xul # bug 974780
 skip-if(B2G) == 474417-1.html 474417-1-ref.html
-random-if(B2G&&browserIsRemote) == 474472-1.html 474472-1-ref.html
+== 474472-1.html 474472-1-ref.html
 == 475986-1a.html 475986-1-ref.html
 == 475986-1b.html 475986-1-ref.html
 == 475986-1c.html 475986-1-ref.html
 == 475986-1d.html 475986-1-ref.html
 == 475986-1e.html 475986-1-ref.html
 == 475986-1f.html 475986-1-ref.html
 == 475986-2a.html 475986-2-ref.html
 == 475986-2b.html 475986-2-ref.html
@@ -1311,37 +1311,37 @@ skip-if(B2G) fails-if(Android) == 481024
 == 481024-1d.html 481024-1-ref.html
 == 481024-1e.html 481024-1-ref.html
 != 481948-1.html 481948-1-ref.html
 != 481948-2.html 481948-2-ref.html
 skip-if(B2G) fails-if(Android) random-if(winWidget) fails-if(gtk2Widget) == 481948-3.html 481948-3-ref.html # questionable test, see bug 488364
 == 482398-1.html 482398-1-ref.html
 random-if(d2d) skip-if(B2G&&browserIsRemote) == 482592-1a.xhtml 482592-1-ref.html # bug 586771
 random-if(d2d) skip-if(B2G&&browserIsRemote) == 482592-1b.xhtml 482592-1-ref.html # bug 586771
-random-if(winWidget||(B2G&&browserIsRemote)) == 482659-1a.html 482659-1-ref.html
-random-if(B2G&&browserIsRemote) == 482659-1b.html 482659-1-ref.html
-random-if(B2G&&browserIsRemote) == 482659-1c.html 482659-1-ref.html
-random-if(B2G&&browserIsRemote) == 482659-1d.html 482659-1-ref.html
+random-if(winWidget) == 482659-1a.html 482659-1-ref.html
+== 482659-1b.html 482659-1-ref.html
+== 482659-1c.html 482659-1-ref.html
+== 482659-1d.html 482659-1-ref.html
 skip-if(B2G&&browserIsRemote) == 483565.xul 483565-ref.xul # bug 974780
 == 484256-1.html 484256-1-ref.html
 == 484256-2.html 484256-1-ref.html
 == 485012-1.html 485012-1-ref.html
 == 485275-1.html 485275-1-ref.html
 == 485275-1.svg 485275-1-ref.html
 == 486052-1.html 486052-1-ref.html
 == 486052-2a.html 486052-2-ref.html
 == 486052-2b.html 486052-2-ref.html
 == 486052-2c.html 486052-2-ref.html
 == 486052-2d.html 486052-2-ref.html
 == 486052-2e.html 486052-2-ref.html
 == 486052-2f.html 486052-2-ref.html
 == 486052-2g.html 486052-2-ref.html
 == 486065-1.html 486065-1-ref.html
 skip-if(B2G&&browserIsRemote) == 486848-1.xul 486848-1-ref.xul # bug 974780
-random-if(B2G&&browserIsRemote) == 487539-1.html about:blank
+== 487539-1.html about:blank
 == 488390-1.html 488390-1-ref.html
 == 488649-1.html 488649-1-ref.html
 == 488685-1.html 488685-1-ref.html
 == 488692-1.html 488692-1-ref.html
 == 489868-1.svg 489868-1-ref.svg
 == 490173-1.html 490173-1-ref.html
 == 490173-2.html 490173-2-ref.html
 == 490176-1.html 490176-1-ref.html
@@ -1361,17 +1361,17 @@ skip-if(B2G&&browserIsRemote) == 495354-
 skip-if(B2G&&browserIsRemote) == 495354-1b.xhtml 495354-1-ref.xhtml # bug 974780
 == 495385-1a.html 495385-1-ref.html
 == 495385-1b.html 495385-1-ref.html
 == 495385-1c.html 495385-1-ref.html
 == 495385-1d.html 495385-1-ref.html
 == 495385-1e.html 495385-1-ref.html
 == 495385-1f.html 495385-1-ref.html
 == 495385-2a.html 495385-2-ref.html
-random-if(B2G&&browserIsRemote) == 495385-2b.html 495385-2-ref.html
+== 495385-2b.html 495385-2-ref.html
 == 495385-2c.html 495385-2-ref.html
 == 495385-2d.html 495385-2-ref.html
 == 495385-2e.html 495385-2-ref.html
 pref(dom.use_xbl_scopes_for_remote_xul,true) skip-if(B2G&&browserIsRemote) == 495385-2f.xhtml 495385-2-ref.html
 == 495385-2g.html 495385-2-ref.html
 == 495385-2h.html 495385-2-ref.html
 == 495385-2i.html 495385-2-ref.html
 == 495385-3.html 495385-3-ref.html
@@ -1379,68 +1379,68 @@ pref(dom.use_xbl_scopes_for_remote_xul,t
 == 495385-5.html 495385-5-ref.html
 asserts(1) == 496032-1.html 496032-1-ref.html # bug 399262
 == 496840-1.html 496840-1-ref.html
 skip-if(B2G&&browserIsRemote) == 498228-1.xul 498228-1-ref.xul # bug 974780
 == 501037.html 501037-ref.html
 == 501257-1a.html 501257-1-ref.html
 == 501257-1b.html 501257-1-ref.html
 == 501257-1.xhtml 501257-1-ref.xhtml
-skip-if(B2G&&browserIsRemote) == 501627-1.html 501627-1-ref.html # Bug 989165
-random-if(B2G&&browserIsRemote) == 502288-1.html 502288-1-ref.html
+== 501627-1.html 501627-1-ref.html
+== 502288-1.html 502288-1-ref.html
 skip-if(B2G) == 502447-1.html 502447-1-ref.html
 == 502795-1.html 502795-1-ref.html
 == 502942-1.html 502942-1-ref.html
 == 503364-1a.html 503364-1-ref.html
 == 503364-1b.html 503364-1-ref.html
 == 503399.html 503399-ref.html
 # Reftest for bug 503531 marked as failing; should be re-enabled when
 # bug 607548 gets resolved.
 needs-focus fails == 503531-1.html 503531-1-ref.html
 == 504032-1.html 504032-1-ref.html
-random-if(B2G&&browserIsRemote) == 505743-1.html about:blank
+== 505743-1.html about:blank
 skip-if(B2G) == 506481-1.html 506481-1-ref.html
 == 507187-1.html 507187-1-ref.html
 == 507487-1.html 507487-1-ref.html
 == 507487-2.xhtml 507487-2-ref.xhtml
 == 507762-1.html 507762-1-ref.html
 == 507762-2.html 507762-2-ref.html
 == 507762-3.html 507762-1-ref.html
 == 507762-4.html 507762-2-ref.html
 skip-if(B2G) random-if(cocoaWidget) == 508816-1.xul 508816-1-ref.xul # Bug 631982
 skip-if(B2G) == 508816-2.html 508816-2-ref.html
 skip-if(B2G&&browserIsRemote) == 508908-1.xul 508908-1-ref.xul # bug 974780
-random-if(B2G&&browserIsRemote) == 508919-1.xhtml 508919-1-ref.xhtml
-random-if(B2G&&browserIsRemote) == 509155-1.xhtml 509155-1-ref.xhtml
+== 508919-1.xhtml 508919-1-ref.xhtml
+== 509155-1.xhtml 509155-1-ref.xhtml
 skip-if(B2G) == 512410.html 512410-ref.html
 == 512631-1.html 512631-1-ref.html
-random-if(B2G&&browserIsRemote) == 513153-1a.html 513153-1-ref.html
-random-if(B2G&&browserIsRemote) == 513153-1b.html 513153-1-ref.html
-random-if(B2G&&browserIsRemote) == 513153-2a.html 513153-2-ref.html
-random-if(B2G&&browserIsRemote) == 513153-2b.html 513153-2-ref.html
+== 513153-1a.html 513153-1-ref.html
+== 513153-1b.html 513153-1-ref.html
+== 513153-2a.html 513153-2-ref.html
+== 513153-2b.html 513153-2-ref.html
 skip-if(B2G&&browserIsRemote) == 513318-1.xul 513318-1-ref.xul # bug 974780
 skip-if(B2G) fails-if(Android) != 513318-2.xul 513318-2-ref.xul
 == 514917-1.html 514917-1-ref.html
 HTTP(..) == 518172-1a.html 518172-a-ref.html
 HTTP(..) == 518172-1b.html 518172-b-ref.html
 HTTP(..) == 518172-2a.html 518172-a-ref.html
 HTTP(..) == 518172-2b.html 518172-b-ref.html
-random-if(B2G&&browserIsRemote) == 520421-1.html 520421-1-ref.html
+== 520421-1.html 520421-1-ref.html
 == 520563-1.xhtml 520563-1-ref.xhtml
 == 521525-1.html 521525-1-ref.html
 == 521525-2.html 521525-2-ref.html
 == 521539-1.html 521539-1-ref.html
 == 521542-1.xhtml 521542-1-ref.xhtml
 == 521602.html 521602-ref.html
 == 521685-1.html 521685-1-ref.html
 == 522632-1.html 522632-1-ref.html
 == 523096-1.html 523096-1-ref.html
 random-if(d2d) == 523468-1.html 523468-1-ref.html
 == 524175-1.html 524175-1-ref.html
-random-if(B2G&&browserIsRemote) == 526463-1.html 526463-1-ref.html
+== 526463-1.html 526463-1-ref.html
 == 527464-1.html 527464-ref.html
 == 528038-1a.html 528038-1-ref.html
 == 528038-1b.html 528038-1-ref.html
 == 528038-1c.html 528038-1-ref.html
 == 528038-1d.html 528038-1-ref.html
 == 528038-1e.html 528038-1-ref.html
 == 528038-1f.html 528038-1-ref.html
 == 528038-2.html 528038-2-ref.html
@@ -1456,32 +1456,32 @@ skip-if(B2G) == 530686-1.html 530686-1-r
 == 534808-2.html 534808-2-ref.html
 fails-if(OSX==10.7) == 534919-1.html 534919-1-ref.html # Bug 705044
 random == 536061.html 536061-ref.html # fixedpoint division in blur code makes this fail
 == 537471-1.html 537471-1-ref.html
 skip-if(B2G&&browserIsRemote) == 537507-1.xul 537507-1-ref.xul # bug 974780
 skip-if(B2G&&browserIsRemote) == 537507-2.html 537507-2-ref.html # bug 974780
 == 538909-1.html 538909-1-ref.html
 == 538935-1.html 538935-1-ref.html
-random-if(B2G&&browserIsRemote) == 539226-1.html about:blank
+== 539226-1.html about:blank
 == 539323-1.html 539323-1-ref.html
 == 539323-2.html 539323-2-ref.html
 == 539323-3.html 539323-3-ref.html
 == 539880-1.html 539880-1-ref.html
 == 539880-1-dynamic.html 539880-1-ref.html
 skip-if(B2G) fuzzy-if(Android&&AndroidVersion>=15,12,1000) == 539949-1.html#test2 539949-1-ref.html#test2
 == 541382-1.html 541382-1-ref.html
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)||!haveTestPlugin) == 541406-1.html 541406-1-ref.html
 needs-focus != 542116-1.html 542116-1-ref.html
 needs-focus != 542116-2.html 542116-2-ref.html
 needs-focus != 542116-3.html 542116-3-ref.html
 == 542317-1.html 542317-1-ref.html
 fuzzy-if(Android,17,2) skip-if(B2G&&browserIsRemote) == 542605-hidden-unscrollable.xul 542605-hidden-unscrollable-ref.xul # bug 974780
 == 542620-1.html 542620-1-ref.html
-random-if(B2G&&browserIsRemote) == 545049-1.html 545049-1-ref.html
+== 545049-1.html 545049-1-ref.html
 == 546033-1.html 546033-1-ref.html
 random-if(!haveTestPlugin) == 546071-1.html 546071-1-ref.html
 == 549184-1.html 549184-1-ref.html
 == 550325-1.html 550325-1-ref.html
 == 550325-2.html 550325-1-ref.html
 == 550325-3.html 550325-1-ref.html
 == 550716-1.html 550716-1-ref.html
 skip-if(B2G) fuzzy-if(Android&&AndroidVersion>=15,12,300) == 551463-1.html 551463-1-ref.html
@@ -1556,45 +1556,45 @@ skip-if(B2G) == 569006-1.html 569006-1-r
 == 574898-1.html 574898-ref.html
 # 574907 is a windows-only issue, result on other platforms depends on details of font support
 random-if(!winWidget) == 574907-1.html 574907-1-ref.html
 random-if(!winWidget) == 574907-2.html 574907-2-ref.html
 # 574907-3 only worked under directwrite, and even there it now depends on the rendering mode; marking as random for now
 random-if(!winWidget) fails-if(winWidget&&!d2d) random-if(winWidget&&d2d) != 574907-3.html 574907-3-notref.html
 == 577838-1.html 577838-1-ref.html
 == 577838-2.html 577838-2-ref.html
-random-if(B2G&&browserIsRemote) == 579323-1.html 579323-1-ref.html
+== 579323-1.html 579323-1-ref.html
 == 579349-1.html 579349-1-ref.html
 == 579655-1.html 579655-1-ref.html
 skip-if(B2G) fails-if(Android) == 579808-1.html 579808-1-ref.html
 skip-if(B2G) fails-if(Android) random-if(layersGPUAccelerated) == 579985-1.html 579985-1-ref.html # bug 623452 for WinXP; this bug was only for a regression in BasicLayers anyway
 skip-if(B2G) skip-if(Android) == 580160-1.html 580160-1-ref.html # bug 920927 for Android; issues without the test-plugin
 HTTP(..) == 580863-1.html 580863-1-ref.html
 skip-if(B2G) fails-if(Android) random-if(layersGPUAccelerated) == 581317-1.html 581317-1-ref.html
 == 581579-1.html 581579-1-ref.html
-random-if(B2G&&browserIsRemote) == 582037-1a.html 582037-1-ref.html
+== 582037-1a.html 582037-1-ref.html
 == 582037-1b.html 582037-1-ref.html
 skip-if(B2G) == 582037-2a.html 582037-2-ref.html
 skip-if(B2G) == 582037-2b.html 582037-2-ref.html
 asserts(1-2) == 582146-1.html about:blank
 skip-if(B2G) == 582476-1.svg 582476-1-ref.svg
 == 584400-dash-length.svg 584400-dash-length-ref.svg
-random-if(B2G&&browserIsRemote) == 584699-1.html 584699-1-ref.html
+== 584699-1.html 584699-1-ref.html
 == 585598-2.xhtml 585598-2-ref.xhtml
 == 586400-1.html 586400-1-ref.html
 skip-if(B2G) fuzzy-if(d2d,52,1051) fuzzy-if(OSX==10.8,129,1068) == 586683-1.html 586683-1-ref.html
 == 589615-1a.xhtml 589615-1-ref.html
 == 589615-1b.html 589615-1-ref.html
 == 589672-1.html 589672-1-ref.html
 != 589682-1.html 589682-1-notref.html
-skip-if(!browserIsRemote) random-if(B2G&&browserIsRemote) == 593243-1.html 593243-1-ref.html # bug 593168
-skip-if(!browserIsRemote) random-if(B2G&&browserIsRemote) == 593243-2.html 593243-2-ref.html # bug 593168
+skip-if(!browserIsRemote) == 593243-1.html 593243-1-ref.html # bug 593168
+skip-if(!browserIsRemote) == 593243-2.html 593243-2-ref.html # bug 593168
 == 593544-1.html 593544-1-ref.html
-random-if(Android||(B2G&&browserIsRemote)) == 594333-1.html 594333-1-ref.html
-random-if(B2G&&browserIsRemote) == 594624-1.html 594624-1-ref.html
+random-if(Android) == 594333-1.html 594333-1-ref.html
+== 594624-1.html 594624-1-ref.html
 == 594737-1.html 594737-1-ref.html
 == 597721-1.html 597721-1-ref.html
 random-if(winWidget) fuzzy-if(B2G,1,35) fuzzy-if(Android,38,539) needs-focus == 598726-1.html 598726-1-ref.html # Fails on Windows, bug 782196
 == 599113-1.html 599113-1-ref.html
 fails-if(!haveTestPlugin) == 599476.html 599476-ref.html
 == 599882-1a.html 599882-1-ref.html
 == 599882-1b.html 599882-1-ref.html
 == 599882-2.html 599882-2-ref.html
@@ -1604,17 +1604,17 @@ skip-if(B2G) == 600803-1.html 600803-1-r
 == 600974-2.html 600974-1-ref.html
 == 600974-3.html 600974-1-ref.html
 == 602200-1.html 602200-1-ref.html
 == 602200-2.html 602200-2-ref.html
 fuzzy-if(Android&&AndroidVersion>=15,8,20) == 602200-3.html 602200-3-ref.html
 == 602200-4.html 602200-4-ref.html
 == 603423-1.html 603423-1-ref.html
 == 604737.html 604737-ref.html
-random-if(B2G&&browserIsRemote) == 605138-1.html 605138-1-ref.html # Bug 988758
+== 605138-1.html 605138-1-ref.html
 == 605157-1.xhtml 605157-1-ref.xhtml
 == 607267-1.html 607267-1-ref.html
 == 608636-1.html 608636-1-ref.html
 == 608756-1a.html 608756-1-ref.html
 == 608756-1b.html 608756-1-ref.html
 == 608756-2.html 608756-2-ref.html
 == 609272-1.html 609272-1-ref.html
 needs-focus == 613433-1.html 613433-1-ref.html
@@ -1626,28 +1626,28 @@ needs-focus == 613433-2.html 613433-3-re
 needs-focus == 613433-3.html 613433-1-ref.html
 needs-focus == 613433-3.html 613433-2-ref.html
 needs-focus == 613433-3.html 613433-3-ref.html
 == 614272-1.svg  614272-1-ref.svg
 HTTP(..) == 615121-1.html 615121-1-ref.html
 HTTP(..) != 615121-2.html 615121-2-notref.html
 fails-if(Android&&AndroidVersion!=10&&AndroidVersion!=17) == 617242-1.html 617242-1-ref.html
 != 618071.html 618071-notref.html
-random-if(B2G&&browserIsRemote) == 619117-1.html 619117-1-ref.html
+== 619117-1.html 619117-1-ref.html
 HTTP(..) == 619511-1.html 619511-1-ref.html
 skip-if(Android||(B2G&&browserIsRemote)) HTTP(..) == 621253-1-externalFilter.html 621253-1-ref.html
 skip-if(Android||(B2G&&browserIsRemote)) == 621253-1-internalFilter.html 621253-1-ref.html
-random-if(B2G&&browserIsRemote) HTTP(..) == 621253-2-externalFilter.html 621253-2-ref.html
+HTTP(..) == 621253-2-externalFilter.html 621253-2-ref.html
 == 621253-2-internalFilter.html 621253-2-ref.html
 skip-if(B2G) random-if(winWidget) fuzzy-if(OSX==10.8,19,17) == 621918-1.svg 621918-1-ref.svg # 1-pixel diacritic positioning discrepancy in rotated text (may depend on platform fonts)
 random-if(winWidget) HTTP(..) == 621918-2.svg 621918-2-ref.svg # same 1px issue as above, and HTTP(..) for filters.svg, used to mask antialiasing issues where glyphs touch
 fuzzy-if(d2d,5,1) == 622585-1.html 622585-1-ref.html # bug 789402
 fuzzy-if(Android&&AndroidVersion>=15,8,300) == 625409-1.html 625409-1-ref.html
-random-if(B2G&&browserIsRemote) == 627393-1.html about:blank
-random-if(B2G&&browserIsRemote) == 630835-1.html about:blank
+== 627393-1.html about:blank
+== 630835-1.html about:blank
 == 631352-1.html 631352-1-ref.html
 skip-if(B2G) fails-if(Android) == 632423-1.html 632423-1-ref.html
 skip-if(Android||B2G) random-if(winWidget) == 632781-verybig.html 632781-ref.html
 == 632781-normalsize.html 632781-ref.html
 == 633344-1.html 633344-1-ref.html
 == 634232-1.html 634232-1-ref.html
 fails-if(Android&&AndroidVersion<17&&AndroidVersion!=10) == 635302-1.html 635302-1-ref.html
 skip-if(B2G) random-if(d2d) fails-if(Android) fuzzy-if(winWidget&&!d2d,1,11) == 635373-1.html 635373-1-ref.html
@@ -1658,17 +1658,17 @@ HTTP(..) == 635639-2.html 635639-2-ref.h
 random == 637597-1.html 637597-1-ref.html # bug 637597 was never really fixed!
 skip-if(B2G) fuzzy-if(Android&&AndroidVersion>=15,8,500) == 637852-1.html 637852-1-ref.html # bug 839735
 fuzzy-if(Android&&AndroidVersion>=15,8,500) == 637852-2.html 637852-2-ref.html
 fuzzy-if(Android&&AndroidVersion>=15,8,500) == 637852-3.html 637852-3-ref.html
 skip-if(B2G) == 641770-1.html 641770-1-ref.html
 == 641856-1.html 641856-1-ref.html
 == 645491-1.html 645491-1-ref.html
 == 645768-1.html 645768-1-ref.html
-fails-if(layersGPUAccelerated&&cocoaWidget) fails-if(Android&&AndroidVersion<15&&AndroidVersion!=10) random-if(B2G&&browserIsRemote) == 650228-1.html 650228-1-ref.html # Quartz alpha blending doesn't match GL alpha blending
+fails-if(layersGPUAccelerated&&cocoaWidget) fails-if(Android&&AndroidVersion<15&&AndroidVersion!=10) == 650228-1.html 650228-1-ref.html # Quartz alpha blending doesn't match GL alpha blending
 needs-focus == 652301-1a.html 652301-1-ref.html
 needs-focus == 652301-1b.html 652301-1-ref.html
 == 652775-1.html 652775-1-ref.html
 == 653930-1.html 653930-1-ref.html
 HTTP(..) == 654057-1.html 654057-1-ref.html
 fails-if(layersGPUAccelerated&&cocoaWidget) fails-if(Android&&AndroidVersion!=17&&AndroidVersion!=10) == 654950-1.html 654950-1-ref.html # Quartz alpha blending doesn't match GL alpha blending
 == 655549-1.html 655549-1-ref.html
 == 655836-1.html 655836-1-ref.html
@@ -1696,73 +1696,73 @@ needs-focus != 703186-1.html 703186-2.ht
 == 712849-1.html 712849-1-ref.html
 == 713856-static.html  713856-ref.html
 == 713856-dynamic.html 713856-ref.html
 == 714519-1-as.html 714519-1-ref.html
 == 714519-1-q.html 714519-1-ref.html
 == 714519-2-as.html 714519-2-ref.html
 == 714519-2-q.html 714519-2-ref.html
 skip-if(B2G) fuzzy-if(true,1,21) fuzzy-if(cocoaWidget,1,170) fuzzy-if(Android&&browserIsRemote,7,157) fails-if(Android&&!browserIsRemote&&AndroidVersion!=17&&AndroidVersion!=10) == 718521.html 718521-ref.html # bug 760270 # bug 773482
-random-if(B2G&&browserIsRemote) == 720987.html 720987-ref.html
-random-if(B2G&&browserIsRemote) == 722888-1.html 722888-1-ref.html
-random-if(B2G&&browserIsRemote) == 722923-1.html 722923-1-ref.html
-random-if(B2G&&browserIsRemote) == 723484-1.html 723484-1-ref.html
+== 720987.html 720987-ref.html
+== 722888-1.html 722888-1-ref.html
+== 722923-1.html 722923-1-ref.html
+== 723484-1.html 723484-1-ref.html
 random-if(Android||(B2G&&browserIsRemote)) == 728983-1.html 728983-1-ref.html
 skip-if(B2G) == 729143-1.html 729143-1-ref.html
 == 731521-1.html 731521-1-ref.html
 needs-focus == 731726-1.html 731726-1-ref.html
 == 735481-1.html 735481-1-ref.html
 == 745934-1.html 745934-1-ref.html
 == 748692-1a.html 748692-1-ref.html
 == 748692-1b.html 748692-1-ref.html
 skip-if(B2G) == 748803-1.html 748803-1-ref.html
 == 750551-1.html 750551-1-ref.html
 skip-if(B2G) == 751012-1a.html 751012-1-ref.html
 skip-if(B2G) == 751012-1b.html 751012-1-ref.html
-random-if(Android||(B2G&&browserIsRemote)) == 753329-1.html about:blank
+random-if(Android) == 753329-1.html about:blank
 == 758561-1.html 758561-1-ref.html
 fuzzy-if(true,1,90) random-if(Android&&AndroidVersion<15) == 759036-1.html 759036-1-ref.html
 fuzzy-if(true,17,5879) random-if(Android&&AndroidVersion<15) == 759036-2.html 759036-2-ref.html
 random-if(Android&&AndroidVersion<15) == 776265-1a.html 776265-1-ref.html
 == 776265-1b.html 776265-1-ref.html
 == 776265-1c.html 776265-1-ref.html
 == 776265-1d.html 776265-1-ref.html
 == 776265-2a.html 776265-2-ref.html
 == 776265-2b.html 776265-2-ref.html
 == 776265-2c.html 776265-2-ref.html
 == 776265-2d.html 776265-2-ref.html
 == 776443-1.html 776443-1-ref.html
 == 776443-2.html 776443-2-ref.html
 == 786254-1.html 786254-1-ref.html
 == 787947-1.html 787947-1-ref.html
-random-if(B2G&&browserIsRemote) == 796847-1.svg 796847-1-ref.svg
+== 796847-1.svg 796847-1-ref.svg
 fuzzy(40,850) fuzzy-if(azureQuartz,73,542) == 797797-1.html 797797-1-ref.html # 'opacity:N' and rgba(,,,N) text don't match precisely
 fuzzy(40,850) fuzzy-if(azureQuartz,68,586) == 797797-2.html 797797-2-ref.html # 'opacity:N' and rgba(,,,N) text don't match precisely
 == 801681-1.html 801681-1-ref.html
 == 801681-2.html 801681-2-ref.html
 == 801994-1.html 801994-1-ref.html
 == 804323-1.html 804323-1-ref.html
-fuzzy-if(Android,8,608) skip-if(B2G&&browserIsRemote) == 811301-1.html 811301-1-ref.html
+fuzzy-if(Android,8,608) == 811301-1.html 811301-1-ref.html
 == 812824-1.html 812824-1-ref.html
 == 814677.html 814677-ref.html
 skip-if(B2G) == 814952-1.html 814952-1-ref.html
 skip-if(B2G) fuzzy-if(Android,4,400) == 815593-1.html 815593-1-ref.html
 == 816359-1.html 816359-1-ref.html
-random-if(B2G&&browserIsRemote) == 816458-1.html 816458-1-ref.html
+== 816458-1.html 816458-1-ref.html
 == 816948-1.html 816948-1-ref.html
 == 817019-1.html about:blank
 skip-if(B2G) == 818276-1.html 818276-1-ref.html
 == 825999.html 825999-ref.html
 == 827577-1a.html 827577-1-ref.html
-random-if(B2G&&browserIsRemote) == 827577-1b.html 827577-1-ref.html
+== 827577-1b.html 827577-1-ref.html
 == 827799-1.html about:blank
 == 829958.html 829958-ref.html
 == 836844-1.html 836844-1-ref.html
 == 841192-1.html 841192-1-ref.html
-random-if(B2G&&browserIsRemote) == 844178.html 844178-ref.html
+== 844178.html 844178-ref.html
 == 846144-1.html 846144-1-ref.html
 == 847850-1.html 847850-1-ref.html
 == 848421-1.html 848421-1-ref.html
 random-if(B2G) == 849407-1.html 849407-1-ref.html
 == 849996-1.html 849996-1-ref.html
 skip-if(B2G&&browserIsRemote) == 858803-1.html 858803-1-ref.html # bug 974780
 == 860242-1.html 860242-1-ref.html
 != 860370.html 860370-notref.html
@@ -1770,45 +1770,45 @@ skip-if(B2G&&browserIsRemote) == 858803-
 == 875060-1.html 875060-1-ref.html
 == 883987-1a.html 883987-1-ref.html
 == 883987-1b.html 883987-1-ref.html
 == 883987-1c.html 883987-1-ref.html
 == 883987-1d.html 883987-1-ref.html
 == 883987-1e.html 883987-1-ref.html
 == 883987-1f.html 883987-1-ref.html
 == 890495-1.html 890495-1-ref.html
-random-if(B2G&&browserIsRemote) == 894931-1.html 894931-1-ref.html
+== 894931-1.html 894931-1-ref.html
 == 897491-1.html 897491-1-ref.html
 == 897491-2.html 897491-2-ref.html
 fuzzy(2,10000) fuzzy-if(Android&&AndroidVersion>=15,5,10000) == 902330-1.html 902330-1-ref.html
 fuzzy-if(Android,8,400) == 906199-1.html 906199-1-ref.html
 == 921716-1.html 921716-1-ref.html
-test-pref(layout.css.sticky.enabled,true) random-if(B2G&&browserIsRemote) == 926155-1.html 926155-1-ref.html
-fuzzy-if(cocoaWidget,1,40) random-if(B2G&&browserIsRemote) == 928607-1.html 928607-1-ref.html
-random-if(B2G&&browserIsRemote) == 931464-1.html 931464-1-ref.html
+test-pref(layout.css.sticky.enabled,true) == 926155-1.html 926155-1-ref.html
+fuzzy-if(cocoaWidget,1,40) == 928607-1.html 928607-1-ref.html
+== 931464-1.html 931464-1-ref.html
 == 931853.html 931853-ref.html
 == 931853-quirks.html 931853-quirks-ref.html
 fuzzy-if(OSX==10.6,2,30) skip-if(B2G&&browserIsRemote) == 933264-1.html 933264-1-ref.html
 == 936670-1.svg 936670-1-ref.svg
 == 941940-1.html 941940-1-ref.html
 fails == 942017.html 942017-ref.html # bug 942017
 == 942672-1.html 942672-1-ref.html
 == 953334-win32-clipping.html 953334-win32-clipping-ref.html
 == 956513-1.svg 956513-1-ref.svg
-random-if(B2G&&browserIsRemote) == 944291-1.html 944291-1-ref.html
+== 944291-1.html 944291-1-ref.html
 == 950436-1.html 950436-1-ref.html
 == 957770-1.svg 957770-1-ref.svg
 == 960277-1.html 960277-1-ref.html
 pref(layout.css.overflow-clip-box.enabled,true) fuzzy(50,31) == 966992-1.html 966992-1-ref.html
 skip-if(Android) == 966510-1.html 966510-1-ref.html # scrollable elements other than the root probably won't work well on android until bug 776030 is fixed
 skip-if(Android) == 966510-2.html 966510-2-ref.html # same as above
-random-if(B2G&&browserIsRemote) == 978911-1.svg 978911-1-ref.svg
+== 978911-1.svg 978911-1-ref.svg
 == 983084-1.html 983084-1-ref.html
-random-if(B2G&&browserIsRemote) == 983084-2.html 983084-2-ref.html
-random-if(B2G&&browserIsRemote) == 983084-3.html 983084-1-ref.html
+== 983084-2.html 983084-2-ref.html
+== 983084-3.html 983084-1-ref.html
 == 983691-1.html 983691-ref.html
 == 985303-1a.html 985303-1-ref.html
 == 985303-1b.html 985303-1-ref.html
 == 987680-1.html 987680-1-ref.html
 fuzzy-if(/^Windows\x20NT\x206\.2/.test(http.oscpu),1,24) == 991046-1.html 991046-1-ref.html
 pref(layout.css.overflow-clip-box.enabled,true) == 992447.html 992447-ref.html
 pref(layout.css.sticky.enabled,true) == 1005405-1.html 1005405-1-ref.html
 pref(browser.display.use_document_fonts,0) == 1022481-1.html 1022481-1-ref.html
--- a/layout/reftests/canvas/reftest.list
+++ b/layout/reftests/canvas/reftest.list
@@ -1,12 +1,12 @@
 == default-size.html default-size-ref.html
 skip-if(B2G) fuzzy-if(Android&&AndroidVersion>=15,8,1000) == size-1.html size-1-ref.html
 
-random-if(B2G&&browserIsRemote) == empty-transaction-1.html empty-transaction-1-ref.html
+== empty-transaction-1.html empty-transaction-1-ref.html
 
 == image-rendering-test.html image-rendering-ref.html
 == image-shadow.html image-shadow-ref.html
 
 skip-if(B2G) asserts-if(cocoaWidget,0-2) == size-change-1.html size-change-1-ref.html
 
 random-if(cocoaWidget) == subpixel-1.html about:blank
 
--- a/layout/reftests/columns/reftest.list
+++ b/layout/reftests/columns/reftest.list
@@ -14,18 +14,18 @@
 == column-balancing-000.html column-balancing-000.ref.html
 == column-balancing-001.html column-balancing-000.ref.html
 == column-balancing-002.html column-balancing-002.ref.html
 == column-balancing-003.html column-balancing-000.ref.html
 == column-balancing-004.html column-balancing-004.ref.html
 == column-box-alignment-rtl.html column-box-alignment-rtl-ref.html
 HTTP(..) == columnfill-balance.html columnfill-balance-ref.html
 HTTP(..) == columnfill-auto.html columnfill-auto-ref.html
-random-if(B2G&&browserIsRemote) HTTP(..) == columnfill-auto-2.html columnfill-auto-2-ref.html
-random-if(B2G&&browserIsRemote) HTTP(..) == columnfill-auto-3.html columnfill-auto-2-ref.html
+HTTP(..) == columnfill-auto-2.html columnfill-auto-2-ref.html
+HTTP(..) == columnfill-auto-3.html columnfill-auto-2-ref.html
 skip-if(B2G) == columnrule-basic.html columnrule-basic-ref.html # bug 773482
 skip-if(B2G) == columnrule-complex.html columnrule-complex-ref.html # bug 773482
 != columnrule-linestyles.html columnrule-linestyles-notref.html
 == columnrule-padding.html columnrule-padding-ref.html
 skip-if(B2G) == columnfill-overflow.html columnfill-overflow-ref.html # bug 773482
 == margin-collapsing-bug616722-1.html margin-collapsing-bug616722-1-ref.html
 == margin-collapsing-bug616722-2.html margin-collapsing-bug616722-2-ref.html
 == column-balancing-nested-000.html column-balancing-nested-000-ref.html
--- a/layout/reftests/counters/reftest.list
+++ b/layout/reftests/counters/reftest.list
@@ -33,26 +33,26 @@
 == t1202-counters-14-b-test.html t1202-counters-14-b-reference.html
 == t1202-counters-15-b-test.html t1202-counters-15-b-reference.html
 == t1202-counters-16-c-test.html t1202-counters-16-c-reference.html
 == t1202-counters-17-d-test.html t1202-counters-17-d-reference.html
 == t1202-counters-18-f-test.html t1202-counters-18-f-reference.html
 == t1204-implied-00-b-test.html t1204-implied-00-b-reference.html
 == t1204-implied-01-c-test.html t1204-implied-01-c-reference.html
 == t1204-implied-02-d-test.html t1204-implied-02-d-reference.html
-random-if(B2G&&browserIsRemote) == t1204-increment-00-c-o-test.html t1204-increment-00-c-o-reference.html
-random-if(B2G&&browserIsRemote) == t1204-increment-01-c-o-test.html t1204-increment-01-c-o-reference.html
-random-if(B2G&&browserIsRemote) == t1204-increment-02-c-o-test.html t1204-increment-02-c-o-reference.html
+== t1204-increment-00-c-o-test.html t1204-increment-00-c-o-reference.html
+== t1204-increment-01-c-o-test.html t1204-increment-01-c-o-reference.html
+== t1204-increment-02-c-o-test.html t1204-increment-02-c-o-reference.html
 == t1204-multiple-00-c-test.html t1204-multiple-00-c-reference.html
 == t1204-multiple-01-c-test.html t1204-multiple-01-c-reference.html
 == t1204-order-00-c-test.html t1204-order-00-c-reference.html
 == t1204-order-01-d-test.html t1204-order-01-d-reference.html
-random-if(B2G&&browserIsRemote) == t1204-reset-00-c-o-test.html t1204-reset-00-c-o-reference.html
-random-if(B2G&&browserIsRemote) == t1204-reset-01-c-o-test.html t1204-reset-01-c-o-reference.html
-random-if(B2G&&browserIsRemote) == t1204-reset-02-c-o-test.html t1204-reset-02-c-o-reference.html
+== t1204-reset-00-c-o-test.html t1204-reset-00-c-o-reference.html
+== t1204-reset-01-c-o-test.html t1204-reset-01-c-o-reference.html
+== t1204-reset-02-c-o-test.html t1204-reset-02-c-o-reference.html
 == t1204-root-e-test.html t1204-root-e-reference.html
 == t120401-scope-00-b-test.html t120401-scope-00-b-reference.html
 == t120401-scope-01-c-test.html t120401-scope-01-c-reference.html
 == t120401-scope-02-c-test.html t120401-scope-02-c-reference.html
 == t120401-scope-03-c-test.html t120401-scope-03-c-reference.html
 == t120401-scope-04-d-test.html t120401-scope-04-d-reference.html
 == t120403-content-none-00-c-test.html t120403-content-none-00-c-reference.html
 == t120403-display-none-00-c-test.html t120403-display-none-00-c-reference.html
--- a/layout/reftests/css-invalid/input/reftest.list
+++ b/layout/reftests/css-invalid/input/reftest.list
@@ -1,10 +1,10 @@
 == input-valid.html input-ref.html
-fuzzy(11,4) random-if(B2G&&browserIsRemote) == input-customerror.html input-ref.html
+fuzzy(11,4) == input-customerror.html input-ref.html
 skip-if(B2G) fails-if(Android) == input-disabled.html input-ref.html
 skip-if(B2G) fails-if(Android) == input-dyn-disabled.html input-ref.html
 == input-dyn-not-disabled.html input-ref.html
 == input-readonly.html input-ref.html
 == input-dyn-readonly.html input-ref.html
 == input-dyn-not-readonly.html input-ref.html
 == input-maxlength-valid.html input-ref.html
 == input-maxlength-invalid.html input-withtext-ref.html
@@ -14,17 +14,17 @@ skip-if(B2G) fails-if(Android) == input-
 == input-reset.html input-button-ref.html
 == input-email-invalid.html input-withtext-ref.html
 == input-email-valid.html input-email-ref.html
 == input-url-invalid.html input-withtext-ref.html
 == input-url-valid.html input-url-ref.html
 == input-pattern-valid.html input-withtext-ref.html
 == input-pattern-invalid.html input-withtext-ref.html
 == input-type-barred.html input-button-ref.html
-fuzzy(11,4) random-if(B2G&&browserIsRemote) == input-type-invalid.html input-ref.html
+fuzzy(11,4) == input-type-invalid.html input-ref.html
 == input-disabled-fieldset-1.html input-fieldset-ref.html
 == input-disabled-fieldset-2.html input-fieldset-ref.html
 == input-fieldset-legend.html input-fieldset-legend-ref.html
 == input-radio-required.html input-radio-ref.html
 == input-radio-customerror.html input-radio-ref.html
 == input-radio-dyn-valid-1.html input-radio-checked-ref.html
 == input-radio-dyn-valid-2.html input-radio-ref.html
 == input-radio-nogroup-required-valid.html input-radio-ref.html
--- a/layout/reftests/css-invalid/textarea/reftest.list
+++ b/layout/reftests/css-invalid/textarea/reftest.list
@@ -1,15 +1,15 @@
 == textarea-valid.html textarea-ref.html
-random-if(B2G&&browserIsRemote) == textarea-customerror.html textarea-ref.html
+== textarea-customerror.html textarea-ref.html
 fails-if(Android||B2G) == textarea-disabled.html textarea-ref.html
 fails-if(Android||B2G) == textarea-dyn-disabled.html textarea-ref.html
-random-if(B2G&&browserIsRemote) == textarea-dyn-not-disabled.html textarea-ref.html
+== textarea-dyn-not-disabled.html textarea-ref.html
 == textarea-readonly.html textarea-ref.html
-random-if(B2G&&browserIsRemote) == textarea-dyn-readonly.html textarea-ref.html
-random-if(B2G&&browserIsRemote) == textarea-dyn-not-readonly.html textarea-ref.html
+== textarea-dyn-readonly.html textarea-ref.html
+== textarea-dyn-not-readonly.html textarea-ref.html
 == textarea-maxlength-valid.html textarea-ref.html
 == textarea-maxlength-invalid.html textarea-withtext-ref.html
 == textarea-required-valid.html textarea-withtext-ref.html
 == textarea-required-invalid.html textarea-ref.html
 == textarea-disabled-fieldset-1.html textarea-fieldset-ref.html
 == textarea-disabled-fieldset-2.html textarea-fieldset-ref.html
 == textarea-fieldset-legend.html textarea-fieldset-legend-ref.html
--- a/layout/reftests/css-mediaqueries/reftest.list
+++ b/layout/reftests/css-mediaqueries/reftest.list
@@ -10,10 +10,10 @@ skip-if(B2G) == mq_print_orientation.xht
 skip-if(B2G) == mq_print_maxheight.xhtml mq_print-ref.xhtml # bug 773482
 skip-if(B2G) == mq_print_maxwidth.xhtml mq_print-ref.xhtml # bug 773482
 
 skip-if(B2G) == mq_print_maxwidth_updown.xhtml mq_print-ref.xhtml # bug 773482
 skip-if(B2G) == mq_print_maxheight_updown.xhtml mq_print-ref.xhtml # bug 773482
 skip-if(B2G) == mq_print_minheight_updown.xhtml mq_print-ref.xhtml # bug 773482
 skip-if(B2G) == mq_print_minwidth_updown.xhtml mq_print-ref.xhtml # bug 773482
 
-random-if(B2G&&browserIsRemote) == scoped-mq-update.html scoped-mq-update-ref.html
+== scoped-mq-update.html scoped-mq-update-ref.html
 == system-metrics-1.html system-metrics-1-ref.html
--- a/layout/reftests/css-ui-invalid/input/reftest.list
+++ b/layout/reftests/css-ui-invalid/input/reftest.list
@@ -1,10 +1,10 @@
 == input-valid.html input-ref.html
-fuzzy(64,4) random-if(B2G&&browserIsRemote) == input-customerror.html input-ref.html
+fuzzy(64,4) == input-customerror.html input-ref.html
 skip-if(B2G) fails-if(Android) == input-disabled.html input-ref.html
 skip-if(B2G) fails-if(Android) == input-dyn-disabled.html input-ref.html
 == input-dyn-not-disabled.html input-ref.html
 == input-readonly.html input-ref.html
 == input-dyn-readonly.html input-ref.html
 == input-dyn-not-readonly-not-changed.html input-ref.html
 == input-dyn-not-readonly-changed.html input-ref.html
 == input-maxlength-valid.html input-ref.html
@@ -20,17 +20,17 @@ skip-if(B2G) fails-if(Android) == input-
 == input-email-valid.html input-email-ref.html
 == input-url-invalid-changed.html input-withtext-ref.html
 == input-url-invalid-default.html input-withtext-ref.html
 == input-url-valid.html input-url-ref.html
 == input-pattern-valid.html input-withtext-ref.html
 == input-pattern-invalid-default.html input-withtext-ref.html
 == input-pattern-invalid-changed.html input-withtext-ref.html
 == input-type-barred.html input-button-ref.html
-fuzzy(64,4) random-if(B2G&&browserIsRemote) == input-type-invalid.html input-ref.html
+fuzzy(64,4) == input-type-invalid.html input-ref.html
 == input-disabled-fieldset-1.html input-fieldset-ref.html
 == input-disabled-fieldset-2.html input-fieldset-ref.html
 == input-fieldset-legend.html input-fieldset-legend-ref.html
 == input-checkbox-required-invalid-changed.html success-ref.html
 == input-checkbox-required-invalid-default.html success-ref.html
 == input-radio-required-invalid-changed.html success-ref.html
 == input-radio-required-invalid-default.html success-ref.html
 == input-file-required-invalid-changed.html input-file-ref.html
--- a/layout/reftests/css-ui-invalid/textarea/reftest.list
+++ b/layout/reftests/css-ui-invalid/textarea/reftest.list
@@ -1,18 +1,18 @@
 == textarea-valid.html textarea-ref.html
-random-if(B2G&&browserIsRemote) == textarea-customerror.html textarea-ref.html
+== textarea-customerror.html textarea-ref.html
 skip-if(B2G) fails-if(Android) == textarea-disabled.html textarea-ref.html
 fails-if(Android||B2G) == textarea-dyn-disabled.html textarea-ref.html
-random-if(B2G&&browserIsRemote) == textarea-dyn-not-disabled.html textarea-ref.html
+== textarea-dyn-not-disabled.html textarea-ref.html
 == textarea-readonly.html textarea-ref.html
 == textarea-dyn-readonly.html textarea-ref.html
 == textarea-dyn-not-readonly-not-changed.html textarea-ref.html
-random-if(B2G&&browserIsRemote) == textarea-dyn-not-readonly-changed.html textarea-ref.html
+== textarea-dyn-not-readonly-changed.html textarea-ref.html
 == textarea-maxlength-valid.html textarea-ref.html
 == textarea-maxlength-invalid.html textarea-withtext-ref.html
 == textarea-maxlength-default-value-invalid.html textarea-withtext-ref.html
 == textarea-required-valid.html textarea-withtext-ref.html
 == textarea-required-invalid.html textarea-ref.html
-random-if(B2G&&browserIsRemote) == textarea-required-invalid-changed.html textarea-ref.html
+== textarea-required-invalid-changed.html textarea-ref.html
 == textarea-disabled-fieldset-1.html textarea-fieldset-ref.html
 == textarea-disabled-fieldset-2.html textarea-fieldset-ref.html
 == textarea-novalidate.html textarea-ref.html
--- a/layout/reftests/css-ui-valid/input/reftest.list
+++ b/layout/reftests/css-ui-valid/input/reftest.list
@@ -21,17 +21,17 @@ fails-if(Android||B2G) == input-dyn-disa
 == input-email-valid-changed.html input-email-ref.html
 == input-url-invalid.html input-withtext-ref.html
 == input-url-valid.html input-url-ref.html
 == input-url-valid-changed.html input-url-ref.html
 == input-pattern-valid.html input-withtext-ref.html
 == input-pattern-valid-changed.html input-withtext-ref.html
 == input-pattern-invalid.html input-withtext-ref.html
 == input-type-barred.html input-button-ref.html
-fuzzy(64,4) random-if(B2G&&browserIsRemote) == input-type-invalid.html input-ref.html
+fuzzy(64,4) == input-type-invalid.html input-ref.html
 == input-disabled-fieldset-1.html input-fieldset-ref.html
 == input-disabled-fieldset-2.html input-fieldset-ref.html
 == input-fieldset-legend.html input-fieldset-legend-ref.html
 == input-checkbox-valid-changed.html success-ref.html
 == input-checkbox-valid-default.html success-ref.html
 == input-file-valid-changed.html input-file-ref.html
 == input-file-valid-default.html input-file-ref.html
 == input-radio-required.html success-ref.html
--- a/layout/reftests/css-ui-valid/select/reftest.list
+++ b/layout/reftests/css-ui-valid/select/reftest.list
@@ -6,13 +6,13 @@ needs-focus == select-dyn-disabled.html 
 needs-focus == select-dyn-not-disabled.html select-ref.html
 needs-focus == select-required-invalid.html select-required-ref.html
 needs-focus == select-required-valid-1.html select-required-ref.html
 needs-focus == select-required-valid-2.html select-required-ref.html
 needs-focus == select-required-valid-changed-1.html select-required-ref.html
 needs-focus == select-required-valid-changed-2.html select-required-ref.html
 needs-focus == select-required-multiple-invalid.html select-required-multiple-ref.html
 needs-focus == select-required-multiple-valid.html select-required-multiple-ref.html
-fuzzy(64,4) random-if(B2G&&browserIsRemote) needs-focus == select-required-multiple-valid-changed.html select-required-multiple-ref.html
+fuzzy(64,4) needs-focus == select-required-multiple-valid-changed.html select-required-multiple-ref.html
 fails-if(Android||B2G) needs-focus == select-disabled-fieldset-1.html select-fieldset-ref.html
 fails-if(Android||B2G) needs-focus == select-disabled-fieldset-2.html select-fieldset-ref.html
 needs-focus == select-fieldset-legend.html select-fieldset-legend-ref.html
 needs-focus == select-novalidate.html select-required-ref.html
--- a/layout/reftests/css-ui-valid/textarea/reftest.list
+++ b/layout/reftests/css-ui-valid/textarea/reftest.list
@@ -1,20 +1,20 @@
 == textarea-valid.html textarea-ref.html
 == textarea-customerror.html textarea-ref.html
 fails-if(Android||B2G) == textarea-disabled.html textarea-ref.html
 random-if(Android||B2G) == textarea-dyn-disabled.html textarea-ref.html
-random-if(B2G&&browserIsRemote) == textarea-dyn-not-disabled.html textarea-ref.html
-random-if(B2G&&browserIsRemote) == textarea-dyn-not-disabled-changed.html textarea-ref.html
+== textarea-dyn-not-disabled.html textarea-ref.html
+== textarea-dyn-not-disabled-changed.html textarea-ref.html
 == textarea-readonly.html textarea-ref.html
 == textarea-dyn-readonly.html textarea-ref.html
 == textarea-dyn-not-readonly.html textarea-ref.html
-random-if(B2G&&browserIsRemote) == textarea-dyn-not-readonly-changed.html textarea-ref.html
+== textarea-dyn-not-readonly-changed.html textarea-ref.html
 == textarea-maxlength-valid.html textarea-ref.html
-random-if(B2G&&browserIsRemote) == textarea-maxlength-valid-changed.html textarea-ref.html
+== textarea-maxlength-valid-changed.html textarea-ref.html
 == textarea-maxlength-invalid.html textarea-withtext-ref.html
 == textarea-required-valid.html textarea-withtext-ref.html
 == textarea-required-valid-changed.html textarea-withtext-ref.html
 == textarea-required-invalid.html textarea-ref.html
 == textarea-disabled-fieldset-1.html textarea-fieldset-ref.html
 == textarea-disabled-fieldset-2.html textarea-fieldset-ref.html
 == textarea-fieldset-legend.html textarea-fieldset-legend-ref.html
 == textarea-novalidate.html textarea-withtext-ref.html
--- a/layout/reftests/css-valid/input/reftest.list
+++ b/layout/reftests/css-valid/input/reftest.list
@@ -1,10 +1,10 @@
 == input-valid.html input-ref.html
-fuzzy(64,4) random-if(B2G&&browserIsRemote) == input-customerror.html input-ref.html
+fuzzy(64,4) == input-customerror.html input-ref.html
 fails-if(Android||B2G) == input-disabled.html input-ref.html
 fails-if(Android||B2G) == input-dyn-disabled.html input-ref.html
 == input-dyn-not-disabled.html input-ref.html
 == input-readonly.html input-ref.html
 == input-dyn-readonly.html input-ref.html
 == input-dyn-not-readonly.html input-ref.html
 == input-maxlength-valid.html input-ref.html
 == input-maxlength-invalid.html input-withtext-ref.html
@@ -14,17 +14,17 @@ fails-if(Android||B2G) == input-dyn-disa
 == input-reset.html input-button-ref.html
 == input-email-invalid.html input-withtext-ref.html
 == input-email-valid.html input-email-ref.html
 == input-url-invalid.html input-withtext-ref.html
 == input-url-valid.html input-url-ref.html
 == input-pattern-valid.html input-withtext-ref.html
 == input-pattern-invalid.html input-withtext-ref.html
 == input-type-barred.html input-button-ref.html
-fuzzy(64,4) random-if(B2G&&browserIsRemote) == input-type-invalid.html input-ref.html
+fuzzy(64,4) == input-type-invalid.html input-ref.html
 == input-disabled-fieldset-1.html input-fieldset-ref.html
 == input-disabled-fieldset-2.html input-fieldset-ref.html
 == input-fieldset-legend.html input-fieldset-legend-ref.html
 == input-radio-required.html success-ref.html
 == input-radio-customerror.html success-ref.html
 == input-radio-dyn-valid-1.html success-ref.html
 == input-radio-dyn-valid-2.html success-ref.html
 == input-radio-nogroup-required-valid.html success-ref.html
--- a/layout/reftests/css-valid/textarea/reftest.list
+++ b/layout/reftests/css-valid/textarea/reftest.list
@@ -1,15 +1,15 @@
 == textarea-valid.html textarea-ref.html
-random-if(B2G&&browserIsRemote) == textarea-customerror.html textarea-ref.html
+== textarea-customerror.html textarea-ref.html
 fails-if(Android||B2G) == textarea-disabled.html textarea-ref.html
 fails-if(Android||B2G) == textarea-dyn-disabled.html textarea-ref.html
-random-if(B2G&&browserIsRemote) == textarea-dyn-not-disabled.html textarea-ref.html
+== textarea-dyn-not-disabled.html textarea-ref.html
 == textarea-readonly.html textarea-ref.html
-random-if(B2G&&browserIsRemote) == textarea-dyn-readonly.html textarea-ref.html
-random-if(B2G&&browserIsRemote) == textarea-dyn-not-readonly.html textarea-ref.html
+== textarea-dyn-readonly.html textarea-ref.html
+== textarea-dyn-not-readonly.html textarea-ref.html
 == textarea-maxlength-valid.html textarea-ref.html
 == textarea-maxlength-invalid.html textarea-withtext-ref.html
 == textarea-required-valid.html textarea-withtext-ref.html
 == textarea-required-invalid.html textarea-ref.html
 == textarea-disabled-fieldset-1.html textarea-fieldset-ref.html
 == textarea-disabled-fieldset-2.html textarea-fieldset-ref.html
 == textarea-fieldset-legend.html textarea-fieldset-legend-ref.html
--- a/layout/reftests/dom/reftest.list
+++ b/layout/reftests/dom/reftest.list
@@ -26,17 +26,17 @@
 # multiple range inserts
 == insertmultiplemultiple-1.html insertmultiplemultiple-ref.html
 # a range insert and an append
 == insertmultiplemultiple-2.html insertmultiplemultiple-ref.html
 # multiple range inserts and an append
 == insertmultiplemultiple-2.html insertmultiplemultiple-ref.html
 
 # testing bindings that have multiple insertion points
-random-if(B2G&&browserIsRemote) == multipleinsertionpoints-ref2.xhtml multipleinsertionpoints-ref.xhtml #Bug 988759
+random-if(B2G&&browserIsRemote) == multipleinsertionpoints-ref2.xhtml multipleinsertionpoints-ref.xhtml # Bug 988759
 # append a single element
 skip-if(B2G) == multipleinsertionpoints-appendsingle-1.xhtml multipleinsertionpoints-ref.xhtml # bug 773482
 skip-if(B2G) == multipleinsertionpoints-appendsingle-2.xhtml multipleinsertionpoints-ref.xhtml # bug 773482
 # append several elements
 skip-if(B2G) == multipleinsertionpoints-appendmultiple.xhtml multipleinsertionpoints-ref.xhtml # bug 773482
 # insert a single element
 skip-if(B2G) == multipleinsertionpoints-insertsingle-1.xhtml multipleinsertionpoints-ref.xhtml # bug 773482
 skip-if(B2G) == multipleinsertionpoints-insertsingle-2.xhtml multipleinsertionpoints-ref.xhtml # bug 773482
--- a/layout/reftests/first-line/reftest.list
+++ b/layout/reftests/first-line/reftest.list
@@ -21,17 +21,17 @@ load stress-5.html # assertion/crash tes
 load stress-6.html # assertion/crash test
 load stress-7.html # assertion/crash test
 == stress-8.html stress-8-ref.html # assertion/crash test
 == stress-9.html stress-9-ref.html # assertion/crash test
 load stress-10.html # crash test
 == stress-11.xhtml stress-11-ref.xhtml
 
 == border-not-apply.html border-not-apply-ref.html
-skip-if(B2G&&browserIsRemote) == 287088-1.html 287088-1-ref.html # Bug 975254
+== 287088-1.html 287088-1-ref.html
 == 287088-2.html 287088-2-ref.html
 == 403177-1.html 403177-1-ref.html
 == 469227-2.html 469227-2-ref.html
 == 469227-3.html 469227-3-ref.html
 
 == restyle-inside-first-line.html restyle-inside-first-line-ref.html
 == font-styles.html font-styles-ref.html
 == font-styles-nooverflow.html font-styles-ref.html
--- a/layout/reftests/flexbox/reftest.list
+++ b/layout/reftests/flexbox/reftest.list
@@ -51,40 +51,40 @@ fuzzy-if(B2G,10,3) random-if(winWidget) 
 == flexbox-box-sizing-on-container-horiz-1.html flexbox-box-sizing-on-container-horiz-1-ref.html
 == flexbox-box-sizing-on-container-vert-1.html flexbox-box-sizing-on-container-vert-1-ref.html
 == flexbox-box-sizing-on-items-horiz-1a.html flexbox-box-sizing-on-items-horiz-1-ref.html
 == flexbox-box-sizing-on-items-horiz-1b.html flexbox-box-sizing-on-items-horiz-1-ref.html
 == flexbox-box-sizing-on-items-vert-1a.html flexbox-box-sizing-on-items-vert-1-ref.html
 == flexbox-box-sizing-on-items-vert-1b.html flexbox-box-sizing-on-items-vert-1-ref.html
 
 # Tests for dynamic modifications of content inside/around a flex container
-random-if(B2G&&browserIsRemote) == flexbox-dyn-changeFrameWidth-1.xhtml flexbox-dyn-changeFrameWidth-1-ref.xhtml
+== flexbox-dyn-changeFrameWidth-1.xhtml flexbox-dyn-changeFrameWidth-1-ref.xhtml
 == flexbox-dyn-changeFrameWidth-2.xhtml flexbox-dyn-changeFrameWidth-2-ref.xhtml
 == flexbox-dyn-changeFrameWidth-3.xhtml flexbox-dyn-changeFrameWidth-3-ref.xhtml
-random-if(B2G&&browserIsRemote) == flexbox-dyn-changeFrameWidth-4.xhtml flexbox-dyn-changeFrameWidth-4-ref.xhtml
-random-if(B2G&&browserIsRemote) == flexbox-dyn-changePadding-1a.xhtml flexbox-dyn-changePadding-1-ref.xhtml
-random-if(B2G&&browserIsRemote) == flexbox-dyn-changePadding-1b.xhtml flexbox-dyn-changePadding-1-ref.xhtml
+== flexbox-dyn-changeFrameWidth-4.xhtml flexbox-dyn-changeFrameWidth-4-ref.xhtml
+== flexbox-dyn-changePadding-1a.xhtml flexbox-dyn-changePadding-1-ref.xhtml
+== flexbox-dyn-changePadding-1b.xhtml flexbox-dyn-changePadding-1-ref.xhtml
 
 # Tests for dynamic insertions of content into a flex container
 # (with existing [div | span | text] inside the flexbox, and new content
 # inserted adjacent to that existing content.)
 == flexbox-dyn-insertAroundDiv-1.xhtml flexbox-dyn-insertAroundDiv-1-ref.xhtml
-random-if(B2G&&browserIsRemote) == flexbox-dyn-insertAroundDiv-2.xhtml flexbox-dyn-insertAroundDiv-2-ref.xhtml
-random-if(B2G&&browserIsRemote) == flexbox-dyn-insertAroundDiv-3.xhtml flexbox-dyn-insertAroundDiv-3-ref.xhtml
+== flexbox-dyn-insertAroundDiv-2.xhtml flexbox-dyn-insertAroundDiv-2-ref.xhtml
+== flexbox-dyn-insertAroundDiv-3.xhtml flexbox-dyn-insertAroundDiv-3-ref.xhtml
 
 == flexbox-dyn-insertAroundSpan-1.xhtml flexbox-dyn-insertAroundDiv-1-ref.xhtml
-random-if(B2G&&browserIsRemote) == flexbox-dyn-insertAroundSpan-2.xhtml flexbox-dyn-insertAroundDiv-2-ref.xhtml
-random-if(B2G&&browserIsRemote) == flexbox-dyn-insertAroundSpan-3.xhtml flexbox-dyn-insertAroundDiv-3-ref.xhtml
+== flexbox-dyn-insertAroundSpan-2.xhtml flexbox-dyn-insertAroundDiv-2-ref.xhtml
+== flexbox-dyn-insertAroundSpan-3.xhtml flexbox-dyn-insertAroundDiv-3-ref.xhtml
 
 == flexbox-dyn-insertAroundText-1.xhtml flexbox-dyn-insertAroundText-1-ref.xhtml
-random-if(B2G&&browserIsRemote) == flexbox-dyn-insertAroundText-2.xhtml flexbox-dyn-insertAroundText-2-ref.xhtml
-random-if(B2G&&browserIsRemote) == flexbox-dyn-insertAroundText-3.xhtml flexbox-dyn-insertAroundText-3-ref.xhtml
+== flexbox-dyn-insertAroundText-2.xhtml flexbox-dyn-insertAroundText-2-ref.xhtml
+== flexbox-dyn-insertAroundText-3.xhtml flexbox-dyn-insertAroundText-3-ref.xhtml
 
 # Variant of one of the above tests, to regression-test an invalidation issue
-random-if(B2G&&browserIsRemote) == flexbox-dyn-insertEmptySpan-1.xhtml flexbox-dyn-insertEmptySpan-1-ref.xhtml
+== flexbox-dyn-insertEmptySpan-1.xhtml flexbox-dyn-insertEmptySpan-1-ref.xhtml
 
 # Tests for empty flexboxes (with no flex items)
 == flexbox-empty-1a.xhtml  flexbox-empty-1-ref.xhtml
 == flexbox-empty-1b.xhtml  flexbox-empty-1-ref.xhtml
 
 # Tests for handling of floated elements inside a flexbox
 == flexbox-float-1a.xhtml  flexbox-float-1-ref.xhtml
 == flexbox-float-1b.xhtml  flexbox-float-1-ref.xhtml
@@ -109,31 +109,31 @@ fails == flexbox-paint-ordering-3.html  
 fuzzy-if(Android&&AndroidVersion>=15,16,400) == flexbox-position-fixed-1.xhtml     flexbox-position-fixed-1-ref.xhtml
 fuzzy-if(Android&&AndroidVersion>=15,16,400) == flexbox-position-fixed-2.xhtml     flexbox-position-fixed-2-ref.xhtml
 == flexbox-position-fixed-3.xhtml     flexbox-position-fixed-3-ref.xhtml
 == flexbox-position-fixed-4.xhtml     flexbox-position-fixed-4-ref.xhtml
 
 # Tests for inline content in a flexbox that gets wrapped in an anonymous block
 fails == flexbox-inlinecontent-horiz-1a.xhtml flexbox-inlinecontent-horiz-1-ref.xhtml # reference case rendering is incorrect; bug 858333
 fails == flexbox-inlinecontent-horiz-1b.xhtml flexbox-inlinecontent-horiz-1-ref.xhtml # reference case rendering is incorrect; bug 858333
-random-if(B2G&&browserIsRemote) == flexbox-inlinecontent-horiz-2.xhtml  flexbox-inlinecontent-horiz-2-ref.xhtml
+== flexbox-inlinecontent-horiz-2.xhtml  flexbox-inlinecontent-horiz-2-ref.xhtml
 == flexbox-inlinecontent-horiz-3a.xhtml flexbox-inlinecontent-horiz-3-ref.xhtml
-random-if(B2G&&browserIsRemote) == flexbox-inlinecontent-horiz-3b.xhtml flexbox-inlinecontent-horiz-3-ref.xhtml
-random-if(B2G&&browserIsRemote) == flexbox-inlinecontent-horiz-3c.xhtml flexbox-inlinecontent-horiz-3-ref.xhtml
+== flexbox-inlinecontent-horiz-3b.xhtml flexbox-inlinecontent-horiz-3-ref.xhtml
+== flexbox-inlinecontent-horiz-3c.xhtml flexbox-inlinecontent-horiz-3-ref.xhtml
 == flexbox-inlinecontent-horiz-4.xhtml  flexbox-inlinecontent-horiz-4-ref.xhtml
 == flexbox-inlinecontent-horiz-5.xhtml  flexbox-inlinecontent-horiz-5-ref.xhtml
 
 # Tests for intrinsic sizing of flexboxes
 == flexbox-intrinsic-sizing-horiz-1a.xhtml flexbox-intrinsic-sizing-horiz-1-ref.xhtml
 == flexbox-intrinsic-sizing-horiz-1b.xhtml flexbox-intrinsic-sizing-horiz-1-ref.xhtml
 == flexbox-intrinsic-sizing-horiz-2a.xhtml flexbox-intrinsic-sizing-horiz-2-ref.xhtml
 == flexbox-intrinsic-sizing-horiz-2b.xhtml flexbox-intrinsic-sizing-horiz-2-ref.xhtml
 
 # Tests for invalidation after dynamic modifications
-random-if(B2G&&browserIsRemote) == flexbox-invalidation-1.html flexbox-invalidation-1-ref.html
+== flexbox-invalidation-1.html flexbox-invalidation-1-ref.html
 
 # Tests for flexbox in an iframe that gets resized.
 skip-if(B2G) == flexbox-resizeviewport-1.xhtml flexbox-resizeviewport-1-ref.xhtml
 
 # Tests for flexbox styling on things that don't support it
 == flexbox-styling-on-svg-1.svg flexbox-styling-on-svg-1-ref.svg
 
 # Tests with widgets as flex items
--- a/layout/reftests/floats/reftest.list
+++ b/layout/reftests/floats/reftest.list
@@ -12,9 +12,9 @@ fuzzy-if(gtk2Widget,1,10) == float-outsi
 fails == zero-height-float.html zero-height-float-ref.html # bug 81710
 fails == 345369-1.html 345369-1-ref.html
 fails == 345369-2.html 345369-2-ref.html
 == 345369-3.html 345369-3-ref.html
 == 345369-4.html 345369-4-ref.html
 == 345369-5.html 345369-5-ref.html
 == 429974-1.html 429974-1-ref.html
 == 546048-1.html 546048-1-ref.html
-random-if(B2G&&browserIsRemote) == 775350-1.html 775350-1-ref.html
+== 775350-1.html 775350-1-ref.html
--- a/layout/reftests/forms/fieldset/reftest.list
+++ b/layout/reftests/forms/fieldset/reftest.list
@@ -1,13 +1,13 @@
-random-if(B2G&&browserIsRemote) == dynamic-legend-scroll-1.html dynamic-legend-scroll-1-ref.html
+== dynamic-legend-scroll-1.html dynamic-legend-scroll-1-ref.html
 == fieldset-hidden-1.html fieldset-hidden-1-ref.html
 == fieldset-intrinsic-width-1.html fieldset-intrinsic-width-1-ref.html
 == fieldset-percentage-padding-1.html fieldset-percentage-padding-1-ref.html
 == fieldset-scroll-1.html fieldset-scroll-1-ref.html
-random-if(B2G&&browserIsRemote) == fieldset-scrolled-1.html fieldset-scrolled-1-ref.html
+== fieldset-scrolled-1.html fieldset-scrolled-1-ref.html
 random-if(B2G) == fieldset-overflow-auto-1.html fieldset-overflow-auto-1-ref.html
 == positioned-container-1.html positioned-container-1-ref.html
 == relpos-legend-1.html relpos-legend-1-ref.html
 == relpos-legend-2.html relpos-legend-2-ref.html
 test-pref(layout.css.sticky.enabled,true) skip-if(B2G&&browserIsRemote) == sticky-legend-1.html sticky-legend-1-ref.html
 == abs-pos-child-sizing.html abs-pos-child-sizing-ref.html
 == overflow-hidden.html overflow-hidden-ref.html
--- a/layout/reftests/forms/input/number/reftest.list
+++ b/layout/reftests/forms/input/number/reftest.list
@@ -6,27 +6,27 @@ skip-if(Android||B2G) != not-other-type-
 skip-if(Android||B2G) != not-other-type-unthemed-1.html not-other-type-unthemed-1b-notref.html
 # only valid on Android/B2G where type=number looks the same as type=text
 skip-if(!Android&&!B2G) == number-same-as-text-unthemed.html number-same-as-text-unthemed-ref.html
 
 # should look the same as type=text, except for the spin box
 == number-similar-to-text-unthemed.html number-similar-to-text-unthemed-ref.html
 
 # dynamic type changes:
-fuzzy-if(/^Windows\x20NT\x205\.1/.test(http.oscpu),64,4) fuzzy-if(cocoaWidget,63,4) random-if(B2G&&browserIsRemote) == to-number-from-other-type-unthemed-1.html to-number-from-other-type-unthemed-1-ref.html
-random-if(B2G&&browserIsRemote) == from-number-to-other-type-unthemed-1.html from-number-to-other-type-unthemed-1-ref.html
+fuzzy-if(/^Windows\x20NT\x205\.1/.test(http.oscpu),64,4) fuzzy-if(cocoaWidget,63,4) == to-number-from-other-type-unthemed-1.html to-number-from-other-type-unthemed-1-ref.html
+== from-number-to-other-type-unthemed-1.html from-number-to-other-type-unthemed-1-ref.html
 
 # dynamic value changes:
 == show-value.html show-value-ref.html
 
 # disabled
 == number-disabled.html number-disabled-ref.html
 
 # auto width:
-random-if(B2G&&browserIsRemote) == number-auto-width-1.html number-auto-width-1-ref.html
+== number-auto-width-1.html number-auto-width-1-ref.html
 
 # min-height/max-height tests:
 skip-if(B2G||Android) == number-min-height-1.html number-min-height-1-ref.html
 skip-if(B2G||Android) == number-min-height-2.html number-min-height-2-ref.html
 skip-if(B2G||Android) == number-max-height-1.html number-max-height-1-ref.html
 skip-if(B2G||Android) == number-max-height-2.html number-max-height-2-ref.html
 
 # number of significant fractional digits:
--- a/layout/reftests/forms/input/range/reftest.list
+++ b/layout/reftests/forms/input/range/reftest.list
@@ -1,31 +1,32 @@
+
 # sanity checks:
 != not-other-type-unthemed-1.html not-other-type-unthemed-1a-notref.html
 != not-other-type-unthemed-1.html not-other-type-unthemed-1b-notref.html
 != not-other-type-unthemed-1.html not-other-type-unthemed-1c-notref.html
 
 # dynamic type changes:
-random-if(B2G&&browserIsRemote) == to-range-from-other-type-unthemed-1.html to-range-from-other-type-unthemed-1-ref.html
-random-if(B2G&&browserIsRemote) == from-range-to-other-type-unthemed-1.html from-range-to-other-type-unthemed-1-ref.html
+== to-range-from-other-type-unthemed-1.html to-range-from-other-type-unthemed-1-ref.html
+== from-range-to-other-type-unthemed-1.html from-range-to-other-type-unthemed-1-ref.html
 
 # for different values:
 != different-fraction-of-range-unthemed-1.html different-fraction-of-range-unthemed-1-notref.html
 == same-fraction-of-range-unthemed-1.html same-fraction-of-range-unthemed-1-ref.html
 
 # dynamic value changes:
-random-if(B2G&&browserIsRemote) == value-prop-unthemed.html 75pct-unthemed-common-ref.html
-random-if(B2G&&browserIsRemote) == value-prop.html 75pct-common-ref.html
-random-if(B2G&&browserIsRemote) == valueAsNumber-prop-unthemed.html 75pct-unthemed-common-ref.html
-random-if(B2G&&browserIsRemote) == valueAsNumber-prop.html 75pct-common-ref.html
-random-if(B2G&&browserIsRemote) == stepDown-unthemed.html 75pct-unthemed-common-ref.html # Bug 878916
-random-if(B2G&&browserIsRemote) == stepDown.html 75pct-common-ref.html # Bug 878916
-random-if(B2G&&browserIsRemote) == stepUp-unthemed.html 75pct-unthemed-common-ref.html # Bug 969256
-random-if(B2G&&browserIsRemote) == stepUp.html 75pct-common-ref.html # Bug 969256
-fuzzy-if(B2G,1,1) random-if(B2G&&browserIsRemote) == max-prop.html 100pct-common-ref.html
+== value-prop-unthemed.html 75pct-unthemed-common-ref.html
+== value-prop.html 75pct-common-ref.html
+== valueAsNumber-prop-unthemed.html 75pct-unthemed-common-ref.html
+== valueAsNumber-prop.html 75pct-common-ref.html
+== stepDown-unthemed.html 75pct-unthemed-common-ref.html
+== stepDown.html 75pct-common-ref.html
+== stepUp-unthemed.html 75pct-unthemed-common-ref.html
+== stepUp.html 75pct-common-ref.html
+fuzzy-if(B2G,1,1) == max-prop.html 100pct-common-ref.html
 
 # 'direction' property:
 == direction-unthemed-1.html direction-unthemed-1-ref.html
 
 # ::-moz-range-progress pseudo-element:
 fails-if(B2G||Android) == moz-range-progress-1.html moz-range-progress-1-ref.html
 == moz-range-progress-2.html moz-range-progress-2-ref.html
 == moz-range-progress-3.html moz-range-progress-3-ref.html
--- a/layout/reftests/forms/meter/reftest.list
+++ b/layout/reftests/forms/meter/reftest.list
@@ -17,11 +17,11 @@ skip-if(B2G) == bar-pseudo-element-verti
 # transformations will not behave exactly the same for <meter> and two divs.
 # However, it would be possible to manually check those.
 # == transformations.html transformations-ref.html
 
 # default style
 include default-style/reftest.list
 
 # Tests for bugs:
-random-if(B2G&&browserIsRemote) == block-invalidate.html block-invalidate-ref.html
+== block-invalidate.html block-invalidate-ref.html
 == in-cells.html in-cells-ref.html
 == max-height.html max-height-ref.html
--- a/layout/reftests/forms/textarea/reftest.list
+++ b/layout/reftests/forms/textarea/reftest.list
@@ -4,10 +4,10 @@ skip-if(B2G) fails-if(Android) skip-if(w
 skip-if(B2G) fails-if(Android) != ltr.html rtl.html
 skip-if(B2G) fails-if(Android) != ltr-scrollbar.html rtl-scrollbar.html
 skip-if(B2G) fails-if(Android) != in-ltr-doc-scrollbar.html in-rtl-doc-scrollbar.html
 skip-if(B2G) fails-if(Android) != ltr.html no-resize.html
 skip-if(B2G) fails-if(Android) fails-if(gtk2Widget) != rtl.html no-resize.html # bug 834724
 == rtl.html rtl-dynamic-attr.html
 == rtl.html rtl-dynamic-style.html
 == rtl.html in-dynamic-rtl-doc.html
-random-if(B2G&&browserIsRemote) == setvalue-framereconstruction-1.html setvalue-framereconstruction-ref.html
+== setvalue-framereconstruction-1.html setvalue-framereconstruction-ref.html
 == padding-scrollbar-placement.html padding-scrollbar-placement-ref.html
--- a/layout/reftests/ib-split/reftest.list
+++ b/layout/reftests/ib-split/reftest.list
@@ -59,17 +59,17 @@
 == insert-into-split-inline-13-ref.html insert-into-split-inline-13-noib-ref.html
 == insert-into-split-inline-14.html insert-into-split-inline-14-ref.html
 == insert-into-split-inline-14-ref.html insert-into-split-inline-14-noib-ref.html
 == insert-into-split-inline-15.html insert-into-split-inline-15-ref.html
 == insert-into-split-inline-15-ref.html insert-into-split-inline-15-noib-ref.html
 == insert-into-split-inline-16a.html insert-into-split-inline-16-ref.html
 == insert-into-split-inline-16b.html insert-into-split-inline-16-ref.html
 == insert-into-split-inline-16-ref.html insert-into-split-inline-16-noib-ref.html
-random-if(B2G&&browserIsRemote) == float-inside-inline-between-blocks-1.html float-inside-inline-between-blocks-1-ref.html
+== float-inside-inline-between-blocks-1.html float-inside-inline-between-blocks-1-ref.html
 == table-pseudo-in-part3-1.html table-pseudo-in-part3-1-ref.html
 == emptyspan-1.html emptyspan-1-ref.html
 == emptyspan-2.html emptyspan-2-ref.html
 == emptyspan-3.html emptyspan-3-ref.html
 == emptyspan-4.html emptyspan-4-ref.html
 == split-inner-inline-1.html split-inner-inline-1-ref.html
 == split-inner-inline-2.html split-inner-inline-2-ref.html
 == whitespace-present-1a.html whitespace-present-1-ref.html
--- a/layout/reftests/invalidation/reftest.list
+++ b/layout/reftests/invalidation/reftest.list
@@ -1,12 +1,12 @@
 == table-repaint-a.html table-repaint-a-ref.html
-random-if(B2G&&browserIsRemote) == table-repaint-b.html table-repaint-b-ref.html
+== table-repaint-b.html table-repaint-b-ref.html
 == table-repaint-c.html table-repaint-c-ref.html
-random-if(B2G&&browserIsRemote) == table-repaint-d.html table-repaint-d-ref.html
+== table-repaint-d.html table-repaint-d-ref.html
 skip-if(B2G&&browserIsRemote) == 540247-1.xul 540247-1-ref.xul  # bug 974780
 skip-if(B2G&&browserIsRemote) == 543681-1.html 543681-1-ref.html
 == test-image-layers.html test-image-layers-ref.html
 pref(layout.animated-image-layers.enabled,true) == test-animated-image-layers.html test-animated-image-layers-ref.html
 pref(layout.animated-image-layers.enabled,true) == test-animated-image-layers-background.html test-animated-image-layers-ref.html
 == box-shadow-border-radius.html box-shadow-border-radius-ref.html
 == filter-userspace-offset.svg?offsetContainer=rect filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=use filter-userspace-offset.svg
@@ -15,34 +15,34 @@ pref(layout.animated-image-layers.enable
 == filter-userspace-offset.svg?offsetContainer=rect&filter=flood-boundingBox filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=use&filter=flood-boundingBox filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=innerSVG&filter=flood-boundingBox filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=foreignObject&filter=flood-boundingBox filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=rect&filter=matrix-boundingBox filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=use&filter=matrix-boundingBox filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=innerSVG&filter=matrix-boundingBox filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=foreignObject&filter=matrix-boundingBox filter-userspace-offset.svg
-random-if(B2G&&browserIsRemote) == filter-userspace-offset.svg?offsetContainer=rect&filter=flood-userSpace-at100 filter-userspace-offset.svg
-random-if(B2G&&browserIsRemote) == filter-userspace-offset.svg?offsetContainer=use&filter=flood-userSpace-at100 filter-userspace-offset.svg
+== filter-userspace-offset.svg?offsetContainer=rect&filter=flood-userSpace-at100 filter-userspace-offset.svg
+== filter-userspace-offset.svg?offsetContainer=use&filter=flood-userSpace-at100 filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=innerSVG&filter=flood-userSpace-atZero filter-userspace-offset.svg
-random-if(B2G&&browserIsRemote) == filter-userspace-offset.svg?offsetContainer=foreignObject&filter=flood-userSpace-at100 filter-userspace-offset.svg
-random-if(B2G&&browserIsRemote) == filter-userspace-offset.svg?offsetContainer=rect&filter=matrix-userSpace-at100 filter-userspace-offset.svg
-random-if(B2G&&browserIsRemote) == filter-userspace-offset.svg?offsetContainer=use&filter=matrix-userSpace-at100 filter-userspace-offset.svg
+== filter-userspace-offset.svg?offsetContainer=foreignObject&filter=flood-userSpace-at100 filter-userspace-offset.svg
+== filter-userspace-offset.svg?offsetContainer=rect&filter=matrix-userSpace-at100 filter-userspace-offset.svg
+== filter-userspace-offset.svg?offsetContainer=use&filter=matrix-userSpace-at100 filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=innerSVG&filter=matrix-userSpace-atZero filter-userspace-offset.svg
-random-if(B2G&&browserIsRemote) == filter-userspace-offset.svg?offsetContainer=foreignObject&filter=matrix-userSpace-at100 filter-userspace-offset.svg
+== filter-userspace-offset.svg?offsetContainer=foreignObject&filter=matrix-userSpace-at100 filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=rect&mask=boundingBox filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=use&mask=boundingBox filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=innerSVG&mask=boundingBox filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=foreignObject&mask=boundingBox filter-userspace-offset.svg
-random-if(B2G&&browserIsRemote) == filter-userspace-offset.svg?offsetContainer=rect&mask=userSpace-at100 filter-userspace-offset.svg
-random-if(B2G&&browserIsRemote) == filter-userspace-offset.svg?offsetContainer=use&mask=userSpace-at100 filter-userspace-offset.svg
+== filter-userspace-offset.svg?offsetContainer=rect&mask=userSpace-at100 filter-userspace-offset.svg
+== filter-userspace-offset.svg?offsetContainer=use&mask=userSpace-at100 filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=innerSVG&mask=userSpace-atZero filter-userspace-offset.svg
-random-if(B2G&&browserIsRemote) == filter-userspace-offset.svg?offsetContainer=foreignObject&mask=userSpace-at100 filter-userspace-offset.svg
+== filter-userspace-offset.svg?offsetContainer=foreignObject&mask=userSpace-at100 filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=rect&filter=matrix-fillPaint-boundingBox filter-userspace-offset.svg
-random-if(B2G&&browserIsRemote) == filter-userspace-offset.svg?offsetContainer=rect&filter=matrix-fillPaint-userSpace-at100 filter-userspace-offset.svg
+== filter-userspace-offset.svg?offsetContainer=rect&filter=matrix-fillPaint-userSpace-at100 filter-userspace-offset.svg
 == scroll-inactive-layers.html scroll-inactive-layers.html
 == scroll-inactive-layers-2.html scroll-inactive-layers-2.html
 != inactive-layertree-visible-region-1.html about:blank
 != inactive-layertree-visible-region-2.html about:blank
 != transform-floating-point-invalidation.html about:blank
 != transform-floating-point-invalidation.html?reverse about:blank
 != nudge-to-integer-invalidation.html about:blank
 != nudge-to-integer-invalidation.html?reverse about:blank
--- a/layout/reftests/layers/reftest.list
+++ b/layout/reftests/layers/reftest.list
@@ -1,2 +1,2 @@
-random-if(B2G&&browserIsRemote) == move-to-background-1.html move-to-background-1-ref.html
-fuzzy-if(cocoaWidget,2,6) random-if((Android&&!browserIsRemote)||(B2G&&browserIsRemote)) == component-alpha-exit-1.html component-alpha-exit-1-ref.html # bug 760275
+== move-to-background-1.html move-to-background-1-ref.html
+fuzzy-if(cocoaWidget,2,6) random-if(Android&&!browserIsRemote) == component-alpha-exit-1.html component-alpha-exit-1-ref.html # bug 760275
--- a/layout/reftests/margin-collapsing/reftest.list
+++ b/layout/reftests/margin-collapsing/reftest.list
@@ -73,31 +73,31 @@ skip-if(B2G) == inline-table-horizontal-
 == block-sibling-1c.html block-sibling-1-ref2.html
 != block-sibling-1c.html block-sibling-1-noref2.html
 == block-sibling-2.html block-sibling-2-ref.html
 == block-sibling-2.html block-sibling-2-ref2.html
 != block-sibling-2.html block-sibling-2-noref.html
 == block-sibling-3.html block-sibling-1-ref.html
 == block-sibling-3.html block-sibling-1-ref2.html
 != block-sibling-3.html block-sibling-1-noref.html
-random-if(B2G&&browserIsRemote) == block-sibling-1a-dyn.html block-sibling-1-ref.html
-random-if(B2G&&browserIsRemote) == block-sibling-1a-dyn.html block-sibling-1-ref2.html
-random-if(B2G&&browserIsRemote) != block-sibling-1a-dyn.html block-sibling-1-noref.html
-random-if(B2G&&browserIsRemote) == block-sibling-1b-dyn.html block-sibling-1-ref.html
-random-if(B2G&&browserIsRemote) == block-sibling-1b-dyn.html block-sibling-1-ref2.html
-random-if(B2G&&browserIsRemote) != block-sibling-1b-dyn.html block-sibling-1-noref.html
-random-if(B2G&&browserIsRemote) == block-sibling-1c-dyn.html block-sibling-1-ref.html
-random-if(B2G&&browserIsRemote) == block-sibling-1c-dyn.html block-sibling-1-ref2.html
-random-if(B2G&&browserIsRemote) != block-sibling-1c-dyn.html block-sibling-1-noref2.html
+== block-sibling-1a-dyn.html block-sibling-1-ref.html
+== block-sibling-1a-dyn.html block-sibling-1-ref2.html
+!= block-sibling-1a-dyn.html block-sibling-1-noref.html
+== block-sibling-1b-dyn.html block-sibling-1-ref.html
+== block-sibling-1b-dyn.html block-sibling-1-ref2.html
+!= block-sibling-1b-dyn.html block-sibling-1-noref.html
+== block-sibling-1c-dyn.html block-sibling-1-ref.html
+== block-sibling-1c-dyn.html block-sibling-1-ref2.html
+!= block-sibling-1c-dyn.html block-sibling-1-noref2.html
 skip-if(B2G) == block-sibling-2-dyn.html block-sibling-2-ref.html # bug 773482
-random-if(B2G&&browserIsRemote) == block-sibling-2-dyn.html block-sibling-2-ref2.html
-random-if(B2G&&browserIsRemote) != block-sibling-2-dyn.html block-sibling-2-noref.html
-random-if(B2G&&browserIsRemote) == block-sibling-3-dyn.html block-sibling-1-ref.html
-random-if(B2G&&browserIsRemote) == block-sibling-3-dyn.html block-sibling-1-ref2.html
-random-if(B2G&&browserIsRemote) != block-sibling-3-dyn.html block-sibling-1-noref.html
+== block-sibling-2-dyn.html block-sibling-2-ref2.html
+!= block-sibling-2-dyn.html block-sibling-2-noref.html
+== block-sibling-3-dyn.html block-sibling-1-ref.html
+== block-sibling-3-dyn.html block-sibling-1-ref2.html
+!= block-sibling-3-dyn.html block-sibling-1-noref.html
 # "In the case of negative margins, the maximum of the absolute values of the
 #  negative adjoining margins is deducted from the maximum of the positive
 #  adjoining margins. If there are no positive margins, the maximum of the
 #  absolute values of the adjoining margins is deducted from zero."
 # These tests feature sibling block boxes where one or two margins are negative.
 # The norefs depict possible incorrect addition or subtraction of margins.
 == block-negative-1a.html block-negative-1-ref.html
 != block-negative-1a.html block-negative-1-noref1.html
@@ -126,80 +126,80 @@ random-if(B2G&&browserIsRemote) != block
 == block-negative-4b.html block-negative-4-ref.html
 == block-negative-4b.html block-negative-4-ref2.html
 != block-negative-4b.html block-negative-4-noref1.html
 != block-negative-4b.html block-negative-4-noref2.html
 == block-negative-5.html block-negative-5-ref.html
 == block-negative-5.html block-negative-5-ref2.html
 != block-negative-5.html block-negative-5-noref1.html
 != block-negative-5.html block-negative-5-noref2.html
-random-if(B2G&&browserIsRemote) == block-negative-1a-dyn1.html block-negative-1-ref.html
-random-if(B2G&&browserIsRemote) != block-negative-1a-dyn1.html block-negative-1-noref1.html
-random-if(B2G&&browserIsRemote) != block-negative-1a-dyn1.html block-negative-1-noref2.html
-random-if(B2G&&browserIsRemote) == block-negative-1a-dyn2.html block-negative-1-ref.html
-random-if(B2G&&browserIsRemote) != block-negative-1a-dyn2.html block-negative-1-noref1.html
-random-if(B2G&&browserIsRemote) != block-negative-1a-dyn2.html block-negative-1-noref2.html
-random-if(B2G&&browserIsRemote) == block-negative-1b-dyn1.html block-negative-1-ref.html
-random-if(B2G&&browserIsRemote) != block-negative-1b-dyn1.html block-negative-1-noref1.html
-random-if(B2G&&browserIsRemote) != block-negative-1b-dyn1.html block-negative-1-noref2.html
-random-if(B2G&&browserIsRemote) == block-negative-1b-dyn2.html block-negative-1-ref.html
-random-if(B2G&&browserIsRemote) != block-negative-1b-dyn2.html block-negative-1-noref1.html
-random-if(B2G&&browserIsRemote) != block-negative-1b-dyn2.html block-negative-1-noref2.html
-random-if(B2G&&browserIsRemote) == block-negative-2a-dyn1.html block-negative-2-ref.html
-random-if(B2G&&browserIsRemote) != block-negative-2a-dyn1.html block-negative-2-noref1.html
-random-if(B2G&&browserIsRemote) != block-negative-2a-dyn1.html block-negative-2-noref2.html
-random-if(B2G&&browserIsRemote) == block-negative-2a-dyn2.html block-negative-2-ref.html
-random-if(B2G&&browserIsRemote) != block-negative-2a-dyn2.html block-negative-2-noref1.html
-random-if(B2G&&browserIsRemote) != block-negative-2a-dyn2.html block-negative-2-noref2.html
-random-if(B2G&&browserIsRemote) == block-negative-2b-dyn1.html block-negative-2-ref.html
-random-if(B2G&&browserIsRemote) != block-negative-2b-dyn1.html block-negative-2-noref1.html
-random-if(B2G&&browserIsRemote) != block-negative-2b-dyn1.html block-negative-2-noref2.html
-random-if(B2G&&browserIsRemote) == block-negative-2b-dyn2.html block-negative-2-ref.html
-random-if(B2G&&browserIsRemote) != block-negative-2b-dyn2.html block-negative-2-noref1.html
-random-if(B2G&&browserIsRemote) != block-negative-2b-dyn2.html block-negative-2-noref2.html
-random-if(B2G&&browserIsRemote) == block-negative-3a-dyn1.html block-negative-3-ref.html
-random-if(B2G&&browserIsRemote) == block-negative-3a-dyn1.html block-negative-3-ref2.html
-random-if(B2G&&browserIsRemote) != block-negative-3a-dyn1.html block-negative-3-noref1.html
-random-if(B2G&&browserIsRemote) != block-negative-3a-dyn1.html block-negative-3-noref2.html
-random-if(B2G&&browserIsRemote) == block-negative-3a-dyn2.html block-negative-3-ref.html
-random-if(B2G&&browserIsRemote) == block-negative-3a-dyn2.html block-negative-3-ref2.html
-random-if(B2G&&browserIsRemote) != block-negative-3a-dyn2.html block-negative-3-noref1.html
-random-if(B2G&&browserIsRemote) != block-negative-3a-dyn2.html block-negative-3-noref2.html
-random-if(B2G&&browserIsRemote) == block-negative-3b-dyn1.html block-negative-3-ref.html
-random-if(B2G&&browserIsRemote) == block-negative-3b-dyn1.html block-negative-3-ref2.html
-random-if(B2G&&browserIsRemote) != block-negative-3b-dyn1.html block-negative-3-noref1.html
-random-if(B2G&&browserIsRemote) != block-negative-3b-dyn1.html block-negative-3-noref2.html
-random-if(B2G&&browserIsRemote) == block-negative-3b-dyn2.html block-negative-3-ref.html
-random-if(B2G&&browserIsRemote) == block-negative-3b-dyn2.html block-negative-3-ref2.html
-random-if(B2G&&browserIsRemote) != block-negative-3b-dyn2.html block-negative-3-noref1.html
-random-if(B2G&&browserIsRemote) != block-negative-3b-dyn2.html block-negative-3-noref2.html
-random-if(B2G&&browserIsRemote) == block-negative-4a-dyn1.html block-negative-4-ref.html
-random-if(B2G&&browserIsRemote) == block-negative-4a-dyn1.html block-negative-4-ref2.html
-random-if(B2G&&browserIsRemote) != block-negative-4a-dyn1.html block-negative-4-noref1.html
-random-if(B2G&&browserIsRemote) != block-negative-4a-dyn1.html block-negative-4-noref2.html
-random-if(B2G&&browserIsRemote) == block-negative-4a-dyn2.html block-negative-4-ref.html
-random-if(B2G&&browserIsRemote) == block-negative-4a-dyn2.html block-negative-4-ref2.html
-random-if(B2G&&browserIsRemote) != block-negative-4a-dyn2.html block-negative-4-noref1.html
-random-if(B2G&&browserIsRemote) != block-negative-4a-dyn2.html block-negative-4-noref2.html
-random-if(B2G&&browserIsRemote) == block-negative-4b-dyn1.html block-negative-4-ref.html
-random-if(B2G&&browserIsRemote) == block-negative-4b-dyn1.html block-negative-4-ref2.html
-random-if(B2G&&browserIsRemote) != block-negative-4b-dyn1.html block-negative-4-noref1.html
-random-if(B2G&&browserIsRemote) != block-negative-4b-dyn1.html block-negative-4-noref2.html
-random-if(B2G&&browserIsRemote) == block-negative-4b-dyn2.html block-negative-4-ref.html
-random-if(B2G&&browserIsRemote) == block-negative-4b-dyn2.html block-negative-4-ref2.html
-random-if(B2G&&browserIsRemote) != block-negative-4b-dyn2.html block-negative-4-noref1.html
-random-if(B2G&&browserIsRemote) != block-negative-4b-dyn2.html block-negative-4-noref2.html
-random-if(B2G&&browserIsRemote) == block-negative-5-dyn1.html block-negative-5-ref.html
-random-if(B2G&&browserIsRemote) == block-negative-5-dyn1.html block-negative-5-ref2.html
-random-if(B2G&&browserIsRemote) != block-negative-5-dyn1.html block-negative-5-noref1.html
-random-if(B2G&&browserIsRemote) != block-negative-5-dyn1.html block-negative-5-noref2.html
-random-if(B2G&&browserIsRemote) == block-negative-5-dyn2.html block-negative-5-ref.html
-random-if(B2G&&browserIsRemote) == block-negative-5-dyn2.html block-negative-5-ref2.html
-random-if(B2G&&browserIsRemote) != block-negative-5-dyn2.html block-negative-5-noref1.html
-random-if(B2G&&browserIsRemote) != block-negative-5-dyn2.html block-negative-5-noref2.html
+== block-negative-1a-dyn1.html block-negative-1-ref.html
+!= block-negative-1a-dyn1.html block-negative-1-noref1.html
+!= block-negative-1a-dyn1.html block-negative-1-noref2.html
+== block-negative-1a-dyn2.html block-negative-1-ref.html
+!= block-negative-1a-dyn2.html block-negative-1-noref1.html
+!= block-negative-1a-dyn2.html block-negative-1-noref2.html
+== block-negative-1b-dyn1.html block-negative-1-ref.html
+!= block-negative-1b-dyn1.html block-negative-1-noref1.html
+!= block-negative-1b-dyn1.html block-negative-1-noref2.html
+== block-negative-1b-dyn2.html block-negative-1-ref.html
+!= block-negative-1b-dyn2.html block-negative-1-noref1.html
+!= block-negative-1b-dyn2.html block-negative-1-noref2.html
+== block-negative-2a-dyn1.html block-negative-2-ref.html
+!= block-negative-2a-dyn1.html block-negative-2-noref1.html
+!= block-negative-2a-dyn1.html block-negative-2-noref2.html
+== block-negative-2a-dyn2.html block-negative-2-ref.html
+!= block-negative-2a-dyn2.html block-negative-2-noref1.html
+!= block-negative-2a-dyn2.html block-negative-2-noref2.html
+== block-negative-2b-dyn1.html block-negative-2-ref.html
+!= block-negative-2b-dyn1.html block-negative-2-noref1.html
+!= block-negative-2b-dyn1.html block-negative-2-noref2.html
+== block-negative-2b-dyn2.html block-negative-2-ref.html
+!= block-negative-2b-dyn2.html block-negative-2-noref1.html
+!= block-negative-2b-dyn2.html block-negative-2-noref2.html
+== block-negative-3a-dyn1.html block-negative-3-ref.html
+== block-negative-3a-dyn1.html block-negative-3-ref2.html
+!= block-negative-3a-dyn1.html block-negative-3-noref1.html
+!= block-negative-3a-dyn1.html block-negative-3-noref2.html
+== block-negative-3a-dyn2.html block-negative-3-ref.html
+== block-negative-3a-dyn2.html block-negative-3-ref2.html
+!= block-negative-3a-dyn2.html block-negative-3-noref1.html
+!= block-negative-3a-dyn2.html block-negative-3-noref2.html
+== block-negative-3b-dyn1.html block-negative-3-ref.html
+== block-negative-3b-dyn1.html block-negative-3-ref2.html
+!= block-negative-3b-dyn1.html block-negative-3-noref1.html
+!= block-negative-3b-dyn1.html block-negative-3-noref2.html
+== block-negative-3b-dyn2.html block-negative-3-ref.html
+== block-negative-3b-dyn2.html block-negative-3-ref2.html
+!= block-negative-3b-dyn2.html block-negative-3-noref1.html
+!= block-negative-3b-dyn2.html block-negative-3-noref2.html
+== block-negative-4a-dyn1.html block-negative-4-ref.html
+== block-negative-4a-dyn1.html block-negative-4-ref2.html
+!= block-negative-4a-dyn1.html block-negative-4-noref1.html
+!= block-negative-4a-dyn1.html block-negative-4-noref2.html
+== block-negative-4a-dyn2.html block-negative-4-ref.html
+== block-negative-4a-dyn2.html block-negative-4-ref2.html
+!= block-negative-4a-dyn2.html block-negative-4-noref1.html
+!= block-negative-4a-dyn2.html block-negative-4-noref2.html
+== block-negative-4b-dyn1.html block-negative-4-ref.html
+== block-negative-4b-dyn1.html block-negative-4-ref2.html
+!= block-negative-4b-dyn1.html block-negative-4-noref1.html
+!= block-negative-4b-dyn1.html block-negative-4-noref2.html
+== block-negative-4b-dyn2.html block-negative-4-ref.html
+== block-negative-4b-dyn2.html block-negative-4-ref2.html
+!= block-negative-4b-dyn2.html block-negative-4-noref1.html
+!= block-negative-4b-dyn2.html block-negative-4-noref2.html
+== block-negative-5-dyn1.html block-negative-5-ref.html
+== block-negative-5-dyn1.html block-negative-5-ref2.html
+!= block-negative-5-dyn1.html block-negative-5-noref1.html
+!= block-negative-5-dyn1.html block-negative-5-noref2.html
+== block-negative-5-dyn2.html block-negative-5-ref.html
+== block-negative-5-dyn2.html block-negative-5-ref2.html
+!= block-negative-5-dyn2.html block-negative-5-noref1.html
+!= block-negative-5-dyn2.html block-negative-5-noref2.html
 # "Two margins are adjoining if and only if:" [...]
 # "both belong to vertically-adjacent box edges,
 #  i.e. form one of the following pairs:" [...]
 # "top margin of a box and top margin of its first in-flow child"
 # "bottom margin of a last in-flow child and bottom margin of its parent
 #  if the parent has 'auto' computed height"
 # "A collapsed margin is considered adjoining to another margin if
 #  any of its component margins is adjoining to that margin."
@@ -237,61 +237,61 @@ random-if(B2G&&browserIsRemote) != block
 == block-non-sibling-3b.html block-non-sibling-3-ref.html
 == block-non-sibling-3b.html block-non-sibling-3-ref2.html
 == block-non-sibling-3c.html block-non-sibling-3-ref.html
 == block-non-sibling-3c.html block-non-sibling-3-ref2.html
 == block-non-sibling-3d.html block-non-sibling-3-ref.html
 == block-non-sibling-3d.html block-non-sibling-3-ref2.html
 == block-non-sibling-4.html block-non-sibling-4-ref.html
 == block-non-sibling-4.html block-non-sibling-4-ref2.html
-random-if(B2G&&browserIsRemote) == block-non-sibling-1a-dyn.html block-non-sibling-1-ref2.html
-random-if(B2G&&browserIsRemote) == block-non-sibling-1b-dyn.html block-non-sibling-1-ref2.html
-random-if(B2G&&browserIsRemote) == block-non-sibling-1c-dyn.html block-non-sibling-1-ref2.html
-random-if(B2G&&browserIsRemote) == block-non-sibling-1d-dyn.html block-non-sibling-1-ref2.html
-random-if(B2G&&browserIsRemote) == block-non-sibling-1e-dyn.html block-non-sibling-1-ref2.html
-random-if(B2G&&browserIsRemote) == block-non-sibling-1f-dyn.html block-non-sibling-1-ref2.html
-random-if(B2G&&browserIsRemote) == block-non-sibling-2a-dyn.html block-non-sibling-2-ref2.html
-random-if(B2G&&browserIsRemote) == block-non-sibling-2b-dyn.html block-non-sibling-2-ref2.html
-random-if(B2G&&browserIsRemote) == block-non-sibling-2c-dyn.html block-non-sibling-2-ref2.html
-random-if(B2G&&browserIsRemote) == block-non-sibling-2d-dyn.html block-non-sibling-2-ref2.html
-random-if(B2G&&browserIsRemote) == block-non-sibling-2e-dyn.html block-non-sibling-2-ref2.html
-random-if(B2G&&browserIsRemote) == block-non-sibling-2f-dyn.html block-non-sibling-2-ref2.html
-random-if(B2G&&browserIsRemote) == block-non-sibling-3a-dyn.html block-non-sibling-3-ref2.html
-random-if(B2G&&browserIsRemote) == block-non-sibling-3b-dyn.html block-non-sibling-3-ref2.html
-random-if(B2G&&browserIsRemote) == block-non-sibling-3c-dyn.html block-non-sibling-3-ref2.html
-random-if(B2G&&browserIsRemote) == block-non-sibling-3d-dyn.html block-non-sibling-3-ref2.html
-random-if(B2G&&browserIsRemote) == block-non-sibling-4-dyn.html block-non-sibling-4-ref2.html
+== block-non-sibling-1a-dyn.html block-non-sibling-1-ref2.html
+== block-non-sibling-1b-dyn.html block-non-sibling-1-ref2.html
+== block-non-sibling-1c-dyn.html block-non-sibling-1-ref2.html
+== block-non-sibling-1d-dyn.html block-non-sibling-1-ref2.html
+== block-non-sibling-1e-dyn.html block-non-sibling-1-ref2.html
+== block-non-sibling-1f-dyn.html block-non-sibling-1-ref2.html
+== block-non-sibling-2a-dyn.html block-non-sibling-2-ref2.html
+== block-non-sibling-2b-dyn.html block-non-sibling-2-ref2.html
+== block-non-sibling-2c-dyn.html block-non-sibling-2-ref2.html
+== block-non-sibling-2d-dyn.html block-non-sibling-2-ref2.html
+== block-non-sibling-2e-dyn.html block-non-sibling-2-ref2.html
+== block-non-sibling-2f-dyn.html block-non-sibling-2-ref2.html
+== block-non-sibling-3a-dyn.html block-non-sibling-3-ref2.html
+== block-non-sibling-3b-dyn.html block-non-sibling-3-ref2.html
+== block-non-sibling-3c-dyn.html block-non-sibling-3-ref2.html
+== block-non-sibling-3d-dyn.html block-non-sibling-3-ref2.html
+== block-non-sibling-4-dyn.html block-non-sibling-4-ref2.html
 # The first-child series tests cases where the top margin of a box collapses
 # with the top margin of its parent element.
 # This series is more extensive than the non-sibling series, because
 # various combinations of positive and negative margins are tested.
 == block-first-child-1a.html block-first-child-1-ref.html
 == block-first-child-1b.html block-first-child-1-ref.html
 == block-first-child-1c.html block-first-child-1-ref.html
 == block-first-child-2.html block-first-child-2-ref.html
 == block-first-child-3.html block-first-child-3-ref.html
 == block-first-child-4.html block-first-child-4-ref.html
 == block-first-child-5.html block-first-child-5-ref.html
 == block-first-child-6.html block-first-child-6-ref.html
 == block-first-child-7.html block-first-child-7-ref.html
 == block-first-child-8a.html block-first-child-8-ref.html
 == block-first-child-8b.html block-first-child-8-ref.html
 == block-first-child-8c.html block-first-child-8-ref.html
-random-if(B2G&&browserIsRemote) == block-first-child-1a-dyn.html block-first-child-1-ref.html
-random-if(B2G&&browserIsRemote) == block-first-child-1b-dyn.html block-first-child-1-ref.html
-random-if(B2G&&browserIsRemote) == block-first-child-1c-dyn.html block-first-child-1-ref.html
-random-if(B2G&&browserIsRemote) == block-first-child-2-dyn.html block-first-child-2-ref.html
-random-if(B2G&&browserIsRemote) == block-first-child-3-dyn.html block-first-child-3-ref.html
-random-if(B2G&&browserIsRemote) == block-first-child-4-dyn.html block-first-child-4-ref.html
-random-if(B2G&&browserIsRemote) == block-first-child-5-dyn.html block-first-child-5-ref.html
-random-if(B2G&&browserIsRemote) == block-first-child-6-dyn.html block-first-child-6-ref.html
-random-if(B2G&&browserIsRemote) == block-first-child-7-dyn.html block-first-child-7-ref.html
-random-if(B2G&&browserIsRemote) == block-first-child-8a-dyn.html block-first-child-8-ref.html
-random-if(B2G&&browserIsRemote) == block-first-child-8b-dyn.html block-first-child-8-ref.html
-random-if(B2G&&browserIsRemote) == block-first-child-8c-dyn.html block-first-child-8-ref.html
+== block-first-child-1a-dyn.html block-first-child-1-ref.html
+== block-first-child-1b-dyn.html block-first-child-1-ref.html
+== block-first-child-1c-dyn.html block-first-child-1-ref.html
+== block-first-child-2-dyn.html block-first-child-2-ref.html
+== block-first-child-3-dyn.html block-first-child-3-ref.html
+== block-first-child-4-dyn.html block-first-child-4-ref.html
+== block-first-child-5-dyn.html block-first-child-5-ref.html
+== block-first-child-6-dyn.html block-first-child-6-ref.html
+== block-first-child-7-dyn.html block-first-child-7-ref.html
+== block-first-child-8a-dyn.html block-first-child-8-ref.html
+== block-first-child-8b-dyn.html block-first-child-8-ref.html
+== block-first-child-8c-dyn.html block-first-child-8-ref.html
 # "The bottom margin of an in-flow block box with a 'height' of 'auto'
 #  collapses with its last in-flow block-level child's bottom margin"
 # Note: The block-auto-height-last-child series automatically covers
 # all cases where 'min-height' is '0' and 'max-height' is 'none' as
 # these are the default values of those properties.
 == block-auto-height-last-child-1a.html block-auto-height-last-child-1-ref.html
 == block-auto-height-last-child-1b.html block-auto-height-last-child-1-ref.html
 == block-auto-height-last-child-1c.html block-auto-height-last-child-1-ref.html
@@ -299,28 +299,28 @@ random-if(B2G&&browserIsRemote) == block
 == block-auto-height-last-child-3.html block-auto-height-last-child-3-ref.html
 == block-auto-height-last-child-4.html block-auto-height-last-child-4-ref.html
 == block-auto-height-last-child-5.html block-auto-height-last-child-5-ref.html
 == block-auto-height-last-child-6.html block-auto-height-last-child-6-ref.html
 == block-auto-height-last-child-7.html block-auto-height-last-child-7-ref.html
 == block-auto-height-last-child-8a.html block-auto-height-last-child-8-ref.html
 == block-auto-height-last-child-8b.html block-auto-height-last-child-8-ref.html
 == block-auto-height-last-child-8c.html block-auto-height-last-child-8-ref.html
-random-if(B2G&&browserIsRemote) == block-auto-height-last-child-1a-dyn.html block-auto-height-last-child-1-ref.html
-random-if(B2G&&browserIsRemote) == block-auto-height-last-child-1b-dyn.html block-auto-height-last-child-1-ref.html
-random-if(B2G&&browserIsRemote) == block-auto-height-last-child-1c-dyn.html block-auto-height-last-child-1-ref.html
-random-if(B2G&&browserIsRemote) == block-auto-height-last-child-2-dyn.html block-auto-height-last-child-2-ref.html
-random-if(B2G&&browserIsRemote) == block-auto-height-last-child-3-dyn.html block-auto-height-last-child-3-ref.html
-random-if(B2G&&browserIsRemote) == block-auto-height-last-child-4-dyn.html block-auto-height-last-child-4-ref.html
-random-if(B2G&&browserIsRemote) == block-auto-height-last-child-5-dyn.html block-auto-height-last-child-5-ref.html
-random-if(B2G&&browserIsRemote) == block-auto-height-last-child-6-dyn.html block-auto-height-last-child-6-ref.html
-random-if(B2G&&browserIsRemote) == block-auto-height-last-child-7-dyn.html block-auto-height-last-child-7-ref.html
-random-if(B2G&&browserIsRemote) == block-auto-height-last-child-8a-dyn.html block-auto-height-last-child-8-ref.html
-random-if(B2G&&browserIsRemote) == block-auto-height-last-child-8b-dyn.html block-auto-height-last-child-8-ref.html
-random-if(B2G&&browserIsRemote) == block-auto-height-last-child-8c-dyn.html block-auto-height-last-child-8-ref.html
+== block-auto-height-last-child-1a-dyn.html block-auto-height-last-child-1-ref.html
+== block-auto-height-last-child-1b-dyn.html block-auto-height-last-child-1-ref.html
+== block-auto-height-last-child-1c-dyn.html block-auto-height-last-child-1-ref.html
+== block-auto-height-last-child-2-dyn.html block-auto-height-last-child-2-ref.html
+== block-auto-height-last-child-3-dyn.html block-auto-height-last-child-3-ref.html
+== block-auto-height-last-child-4-dyn.html block-auto-height-last-child-4-ref.html
+== block-auto-height-last-child-5-dyn.html block-auto-height-last-child-5-ref.html
+== block-auto-height-last-child-6-dyn.html block-auto-height-last-child-6-ref.html
+== block-auto-height-last-child-7-dyn.html block-auto-height-last-child-7-ref.html
+== block-auto-height-last-child-8a-dyn.html block-auto-height-last-child-8-ref.html
+== block-auto-height-last-child-8b-dyn.html block-auto-height-last-child-8-ref.html
+== block-auto-height-last-child-8c-dyn.html block-auto-height-last-child-8-ref.html
 # The last-child series is an older variant of the
 # block-auto-height-last-child tests.
 == block-last-child-1a.html block-last-child-1-ref.html
 == block-last-child-1b.html block-last-child-1-ref.html
 == block-last-child-1c.html block-last-child-1-ref.html
 == block-last-child-2a.html block-last-child-2-ref.html
 == block-last-child-2b.html block-last-child-2-ref.html
 == block-last-child-2c.html block-last-child-2-ref.html
@@ -388,39 +388,39 @@ fails == block-min-height-last-child-3a.
 == block-min-height-last-child-7b.html block-min-height-last-child-7-ref.html
 == block-min-height-last-child-7c.html block-min-height-last-child-7-ref.html
 == block-min-height-last-child-8a.html block-min-height-last-child-8-ref.html
 == block-min-height-last-child-8b.html block-min-height-last-child-8-ref.html
 == block-min-height-last-child-9a.html block-min-height-last-child-9-ref.html
 == block-min-height-last-child-9b.html block-min-height-last-child-9-ref.html
 == block-min-height-last-child-9c.html block-min-height-last-child-9-ref.html
 fails == block-min-height-last-child-1a-dyn.html block-min-height-last-child-1-ref.html # Bug 616339
-random-if(B2G&&browserIsRemote) == block-min-height-last-child-1b-dyn.html block-min-height-last-child-1-ref.html
-random-if(B2G&&browserIsRemote) == block-min-height-last-child-1c-dyn.html block-min-height-last-child-1-ref.html
+== block-min-height-last-child-1b-dyn.html block-min-height-last-child-1-ref.html
+== block-min-height-last-child-1c-dyn.html block-min-height-last-child-1-ref.html
 fails == block-min-height-last-child-2a-dyn.html block-min-height-last-child-2-ref.html # Bug 616339
 fails == block-min-height-last-child-2b-dyn.html block-min-height-last-child-2-ref.html # Bug 616339
 fails == block-min-height-last-child-3a-dyn.html block-min-height-last-child-3-ref.html # Bug 616339
-random-if(B2G&&browserIsRemote) == block-min-height-last-child-3b-dyn.html block-min-height-last-child-3-ref.html
-random-if(B2G&&browserIsRemote) == block-min-height-last-child-3c-dyn.html block-min-height-last-child-3-ref.html
-random-if(B2G&&browserIsRemote) == block-min-height-last-child-4a-dyn.html block-min-height-last-child-4-ref.html
-random-if(B2G&&browserIsRemote) == block-min-height-last-child-4b-dyn.html block-min-height-last-child-4-ref.html
-random-if(B2G&&browserIsRemote) == block-min-height-last-child-4c-dyn.html block-min-height-last-child-4-ref.html
-random-if(B2G&&browserIsRemote) == block-min-height-last-child-5a-dyn.html block-min-height-last-child-5-ref.html
-random-if(B2G&&browserIsRemote) == block-min-height-last-child-5b-dyn.html block-min-height-last-child-5-ref.html
-random-if(B2G&&browserIsRemote) == block-min-height-last-child-6a-dyn.html block-min-height-last-child-6-ref.html
-random-if(B2G&&browserIsRemote) == block-min-height-last-child-6b-dyn.html block-min-height-last-child-6-ref.html
-random-if(B2G&&browserIsRemote) == block-min-height-last-child-6c-dyn.html block-min-height-last-child-6-ref.html
-random-if(B2G&&browserIsRemote) == block-min-height-last-child-7a-dyn.html block-min-height-last-child-7-ref.html
-random-if(B2G&&browserIsRemote) == block-min-height-last-child-7b-dyn.html block-min-height-last-child-7-ref.html
-random-if(B2G&&browserIsRemote) == block-min-height-last-child-7c-dyn.html block-min-height-last-child-7-ref.html
-random-if(B2G&&browserIsRemote) == block-min-height-last-child-8a-dyn.html block-min-height-last-child-8-ref.html
-random-if(B2G&&browserIsRemote) == block-min-height-last-child-8b-dyn.html block-min-height-last-child-8-ref.html
-random-if(B2G&&browserIsRemote) == block-min-height-last-child-9a-dyn.html block-min-height-last-child-9-ref.html
-random-if(B2G&&browserIsRemote) == block-min-height-last-child-9b-dyn.html block-min-height-last-child-9-ref.html
-random-if(B2G&&browserIsRemote) == block-min-height-last-child-9c-dyn.html block-min-height-last-child-9-ref.html
+== block-min-height-last-child-3b-dyn.html block-min-height-last-child-3-ref.html
+== block-min-height-last-child-3c-dyn.html block-min-height-last-child-3-ref.html
+== block-min-height-last-child-4a-dyn.html block-min-height-last-child-4-ref.html
+== block-min-height-last-child-4b-dyn.html block-min-height-last-child-4-ref.html
+== block-min-height-last-child-4c-dyn.html block-min-height-last-child-4-ref.html
+== block-min-height-last-child-5a-dyn.html block-min-height-last-child-5-ref.html
+== block-min-height-last-child-5b-dyn.html block-min-height-last-child-5-ref.html
+== block-min-height-last-child-6a-dyn.html block-min-height-last-child-6-ref.html
+== block-min-height-last-child-6b-dyn.html block-min-height-last-child-6-ref.html
+== block-min-height-last-child-6c-dyn.html block-min-height-last-child-6-ref.html
+== block-min-height-last-child-7a-dyn.html block-min-height-last-child-7-ref.html
+== block-min-height-last-child-7b-dyn.html block-min-height-last-child-7-ref.html
+== block-min-height-last-child-7c-dyn.html block-min-height-last-child-7-ref.html
+== block-min-height-last-child-8a-dyn.html block-min-height-last-child-8-ref.html
+== block-min-height-last-child-8b-dyn.html block-min-height-last-child-8-ref.html
+== block-min-height-last-child-9a-dyn.html block-min-height-last-child-9-ref.html
+== block-min-height-last-child-9b-dyn.html block-min-height-last-child-9-ref.html
+== block-min-height-last-child-9c-dyn.html block-min-height-last-child-9-ref.html
 # If a parent box's height is 'auto' and its 'max-height' is not 'none'
 # then its bottom margin collapses with its last-child's bottom margin.
 # According to CSS 2.1 §10.7 (Minimum and maximum heights) this is true,
 # even if the descendant's height is bigger than the defined max-height.
 == block-max-height-last-child-1a.html block-max-height-last-child-1-ref.html
 == block-max-height-last-child-1b.html block-max-height-last-child-1-ref.html
 == block-max-height-last-child-1c.html block-max-height-last-child-1-ref.html
 == block-max-height-last-child-2a.html block-max-height-last-child-2-ref.html
@@ -439,40 +439,40 @@ random-if(B2G&&browserIsRemote) == block
 fails == block-max-height-last-child-7a.html block-max-height-last-child-7-ref.html # Bug 616339
 == block-max-height-last-child-7b.html block-max-height-last-child-7-ref.html
 == block-max-height-last-child-7c.html block-max-height-last-child-7-ref.html
 fails == block-max-height-last-child-8a.html block-max-height-last-child-8-ref.html # Bug 616339
 fails == block-max-height-last-child-8b.html block-max-height-last-child-8-ref.html # Bug 616339
 fails == block-max-height-last-child-9a.html block-max-height-last-child-9-ref.html # Bug 616339
 == block-max-height-last-child-9b.html block-max-height-last-child-9-ref.html
 == block-max-height-last-child-9c.html block-max-height-last-child-9-ref.html
-random-if(B2G&&browserIsRemote) == block-max-height-last-child-1a-dyn.html block-max-height-last-child-1-ref.html
-random-if(B2G&&browserIsRemote) == block-max-height-last-child-1b-dyn.html block-max-height-last-child-1-ref.html
-random-if(B2G&&browserIsRemote) == block-max-height-last-child-1c-dyn.html block-max-height-last-child-1-ref.html
-random-if(B2G&&browserIsRemote) == block-max-height-last-child-2a-dyn.html block-max-height-last-child-2-ref.html
-random-if(B2G&&browserIsRemote) == block-max-height-last-child-2b-dyn.html block-max-height-last-child-2-ref.html
-random-if(B2G&&browserIsRemote) == block-max-height-last-child-3a-dyn.html block-max-height-last-child-3-ref.html
-random-if(B2G&&browserIsRemote) == block-max-height-last-child-3b-dyn.html block-max-height-last-child-3-ref.html
-random-if(B2G&&browserIsRemote) == block-max-height-last-child-3c-dyn.html block-max-height-last-child-3-ref.html
-random-if(B2G&&browserIsRemote) == block-max-height-last-child-4a-dyn.html block-max-height-last-child-4-ref.html
-random-if(B2G&&browserIsRemote) == block-max-height-last-child-4b-dyn.html block-max-height-last-child-4-ref.html
-random-if(B2G&&browserIsRemote) == block-max-height-last-child-4c-dyn.html block-max-height-last-child-4-ref.html
-random-if(B2G&&browserIsRemote) == block-max-height-last-child-5a-dyn.html block-max-height-last-child-5-ref.html
-random-if(B2G&&browserIsRemote) == block-max-height-last-child-5b-dyn.html block-max-height-last-child-5-ref.html
-random-if(B2G&&browserIsRemote) == block-max-height-last-child-6a-dyn.html block-max-height-last-child-6-ref.html
-random-if(B2G&&browserIsRemote) == block-max-height-last-child-6b-dyn.html block-max-height-last-child-6-ref.html
-random-if(B2G&&browserIsRemote) == block-max-height-last-child-6c-dyn.html block-max-height-last-child-6-ref.html
+== block-max-height-last-child-1a-dyn.html block-max-height-last-child-1-ref.html
+== block-max-height-last-child-1b-dyn.html block-max-height-last-child-1-ref.html
+== block-max-height-last-child-1c-dyn.html block-max-height-last-child-1-ref.html
+== block-max-height-last-child-2a-dyn.html block-max-height-last-child-2-ref.html
+== block-max-height-last-child-2b-dyn.html block-max-height-last-child-2-ref.html
+== block-max-height-last-child-3a-dyn.html block-max-height-last-child-3-ref.html
+== block-max-height-last-child-3b-dyn.html block-max-height-last-child-3-ref.html
+== block-max-height-last-child-3c-dyn.html block-max-height-last-child-3-ref.html
+== block-max-height-last-child-4a-dyn.html block-max-height-last-child-4-ref.html
+== block-max-height-last-child-4b-dyn.html block-max-height-last-child-4-ref.html
+== block-max-height-last-child-4c-dyn.html block-max-height-last-child-4-ref.html
+== block-max-height-last-child-5a-dyn.html block-max-height-last-child-5-ref.html
+== block-max-height-last-child-5b-dyn.html block-max-height-last-child-5-ref.html
+== block-max-height-last-child-6a-dyn.html block-max-height-last-child-6-ref.html
+== block-max-height-last-child-6b-dyn.html block-max-height-last-child-6-ref.html
+== block-max-height-last-child-6c-dyn.html block-max-height-last-child-6-ref.html
 fails == block-max-height-last-child-7a-dyn.html block-max-height-last-child-7-ref.html # Bug 616339
-random-if(B2G&&browserIsRemote) == block-max-height-last-child-7b-dyn.html block-max-height-last-child-7-ref.html
-random-if(B2G&&browserIsRemote) == block-max-height-last-child-7c-dyn.html block-max-height-last-child-7-ref.html
+== block-max-height-last-child-7b-dyn.html block-max-height-last-child-7-ref.html
+== block-max-height-last-child-7c-dyn.html block-max-height-last-child-7-ref.html
 fails == block-max-height-last-child-8a-dyn.html block-max-height-last-child-8-ref.html # Bug 616339
 fails == block-max-height-last-child-8b-dyn.html block-max-height-last-child-8-ref.html # Bug 616339
 fails == block-max-height-last-child-9a-dyn.html block-max-height-last-child-9-ref.html # Bug 616339
-random-if(B2G&&browserIsRemote) == block-max-height-last-child-9b-dyn.html block-max-height-last-child-9-ref.html
-random-if(B2G&&browserIsRemote) == block-max-height-last-child-9c-dyn.html block-max-height-last-child-9-ref.html
+== block-max-height-last-child-9b-dyn.html block-max-height-last-child-9-ref.html
+== block-max-height-last-child-9c-dyn.html block-max-height-last-child-9-ref.html
 # If a parent box's height is not 'auto' then its bottom margin
 # never collapses with its last-child's bottom margin,
 # as these margins are not considered 'adjoining'.
 # According to CSS 2.1 §10.7 (Minimum and maximum heights) this is true,
 # even if the value of min- or max-height is used instead.
 == block-fix-height-last-child-1a.html block-fix-height-last-child-1-ref.html
 == block-fix-height-last-child-1b.html block-fix-height-last-child-1-ref.html
 == block-fix-height-last-child-2a.html block-fix-height-last-child-2-ref.html
@@ -482,30 +482,30 @@ random-if(B2G&&browserIsRemote) == block
 == block-fix-height-last-child-4a.html block-fix-height-last-child-4-ref.html
 == block-fix-height-last-child-4b.html block-fix-height-last-child-4-ref.html
 == block-fix-height-last-child-4c.html block-fix-height-last-child-4-ref.html
 == block-fix-height-last-child-4d.html block-fix-height-last-child-4-ref.html
 == block-fix-height-last-child-4e.html block-fix-height-last-child-4-ref.html
 == block-fix-height-last-child-4f.html block-fix-height-last-child-4-ref.html
 == block-fix-height-last-child-4g.html block-fix-height-last-child-4-ref.html
 == block-fix-height-last-child-4h.html block-fix-height-last-child-4-ref.html
-random-if(B2G&&browserIsRemote) == block-fix-height-last-child-1a-dyn.html block-fix-height-last-child-1-ref.html
-random-if(B2G&&browserIsRemote) == block-fix-height-last-child-1b-dyn.html block-fix-height-last-child-1-ref.html
-random-if(B2G&&browserIsRemote) == block-fix-height-last-child-2a-dyn.html block-fix-height-last-child-2-ref.html
-random-if(B2G&&browserIsRemote) == block-fix-height-last-child-2b-dyn.html block-fix-height-last-child-2-ref.html
-random-if(B2G&&browserIsRemote) == block-fix-height-last-child-3a-dyn.html block-fix-height-last-child-3-ref.html
-random-if(B2G&&browserIsRemote) == block-fix-height-last-child-3b-dyn.html block-fix-height-last-child-3-ref.html
-random-if(B2G&&browserIsRemote) == block-fix-height-last-child-4a-dyn.html block-fix-height-last-child-4-ref.html
-random-if(B2G&&browserIsRemote) == block-fix-height-last-child-4b-dyn.html block-fix-height-last-child-4-ref.html
-random-if(B2G&&browserIsRemote) == block-fix-height-last-child-4c-dyn.html block-fix-height-last-child-4-ref.html
-random-if(B2G&&browserIsRemote) == block-fix-height-last-child-4d-dyn.html block-fix-height-last-child-4-ref.html
-random-if(B2G&&browserIsRemote) == block-fix-height-last-child-4e-dyn.html block-fix-height-last-child-4-ref.html
-random-if(B2G&&browserIsRemote) == block-fix-height-last-child-4f-dyn.html block-fix-height-last-child-4-ref.html
-random-if(B2G&&browserIsRemote) == block-fix-height-last-child-4g-dyn.html block-fix-height-last-child-4-ref.html
-random-if(B2G&&browserIsRemote) == block-fix-height-last-child-4h-dyn.html block-fix-height-last-child-4-ref.html
+== block-fix-height-last-child-1a-dyn.html block-fix-height-last-child-1-ref.html
+== block-fix-height-last-child-1b-dyn.html block-fix-height-last-child-1-ref.html
+== block-fix-height-last-child-2a-dyn.html block-fix-height-last-child-2-ref.html
+== block-fix-height-last-child-2b-dyn.html block-fix-height-last-child-2-ref.html
+== block-fix-height-last-child-3a-dyn.html block-fix-height-last-child-3-ref.html
+== block-fix-height-last-child-3b-dyn.html block-fix-height-last-child-3-ref.html
+== block-fix-height-last-child-4a-dyn.html block-fix-height-last-child-4-ref.html
+== block-fix-height-last-child-4b-dyn.html block-fix-height-last-child-4-ref.html
+== block-fix-height-last-child-4c-dyn.html block-fix-height-last-child-4-ref.html
+== block-fix-height-last-child-4d-dyn.html block-fix-height-last-child-4-ref.html
+== block-fix-height-last-child-4e-dyn.html block-fix-height-last-child-4-ref.html
+== block-fix-height-last-child-4f-dyn.html block-fix-height-last-child-4-ref.html
+== block-fix-height-last-child-4g-dyn.html block-fix-height-last-child-4-ref.html
+== block-fix-height-last-child-4h-dyn.html block-fix-height-last-child-4-ref.html
 # "Two margins are adjoining if and only if:" [...]
 # "both belong to vertically-adjacent box edges,
 #  i.e. form one of the following pairs:" [...]
 # "top and bottom margins of a box that does not establish a new block
 #  formatting context and that has zero computed 'min-height', zero or
 #  'auto' computed 'height', and no in-flow children"
 # Note that "if the top and bottom margins of a box are adjoining, then it is
 # possible for margins to collapse through it."
@@ -530,36 +530,36 @@ random-if(B2G&&browserIsRemote) == block
 == block-no-content-5b.html block-no-content-5-ref.html
 == block-no-content-6.html block-no-content-6-ref.html
 == block-no-content-7.html block-no-content-7-ref.html
 # "If the top margin of a box with non-zero computed 'min-height' and 'auto'
 #  computed 'height' collapses with the bottom margin of its last in-flow
 #  child, then the child's bottom margin does not collapse with the parent's
 #  bottom margin."
 == block-no-content-8.html block-no-content-8-ref.html
-random-if(B2G&&browserIsRemote) == block-no-content-1a-dyn.html block-no-content-1-ref.html
-random-if(B2G&&browserIsRemote) == block-no-content-1b-dyn.html block-no-content-1-ref.html
-random-if(B2G&&browserIsRemote) == block-no-content-1c-dyn.html block-no-content-1-ref.html
-random-if(B2G&&browserIsRemote) == block-no-content-1d-dyn.html block-no-content-1-ref.html
-random-if(B2G&&browserIsRemote) == block-no-content-2a-dyn.html block-no-content-2-ref.html
-random-if(B2G&&browserIsRemote) == block-no-content-2b-dyn.html block-no-content-2-ref.html
-random-if(B2G&&browserIsRemote) == block-no-content-2c-dyn.html block-no-content-2-ref.html
-random-if(B2G&&browserIsRemote) == block-no-content-2d-dyn.html block-no-content-2-ref.html
-random-if(B2G&&browserIsRemote) == block-no-content-2e-dyn.html block-no-content-2-ref.html
-random-if(B2G&&browserIsRemote) == block-no-content-3a-dyn.html block-no-content-3-ref.html
-random-if(B2G&&browserIsRemote) == block-no-content-3b-dyn.html block-no-content-3-ref.html
-random-if(B2G&&browserIsRemote) == block-no-content-3c-dyn.html block-no-content-3-ref.html
-random-if(B2G&&browserIsRemote) == block-no-content-4a-dyn.html block-no-content-4-ref.html
-random-if(B2G&&browserIsRemote) == block-no-content-4b-dyn.html block-no-content-4-ref.html
-random-if(B2G&&browserIsRemote) == block-no-content-4c-dyn.html block-no-content-4-ref.html
-random-if(B2G&&browserIsRemote) == block-no-content-5a-dyn.html block-no-content-5-ref.html
-random-if(B2G&&browserIsRemote) == block-no-content-5b-dyn.html block-no-content-5-ref.html
-random-if(B2G&&browserIsRemote) == block-no-content-6-dyn.html block-no-content-6-ref.html
-random-if(B2G&&browserIsRemote) == block-no-content-7-dyn.html block-no-content-7-ref.html
-random-if(B2G&&browserIsRemote) == block-no-content-8-dyn.html block-no-content-8-ref.html
+== block-no-content-1a-dyn.html block-no-content-1-ref.html
+== block-no-content-1b-dyn.html block-no-content-1-ref.html
+== block-no-content-1c-dyn.html block-no-content-1-ref.html
+== block-no-content-1d-dyn.html block-no-content-1-ref.html
+== block-no-content-2a-dyn.html block-no-content-2-ref.html
+== block-no-content-2b-dyn.html block-no-content-2-ref.html
+== block-no-content-2c-dyn.html block-no-content-2-ref.html
+== block-no-content-2d-dyn.html block-no-content-2-ref.html
+== block-no-content-2e-dyn.html block-no-content-2-ref.html
+== block-no-content-3a-dyn.html block-no-content-3-ref.html
+== block-no-content-3b-dyn.html block-no-content-3-ref.html
+== block-no-content-3c-dyn.html block-no-content-3-ref.html
+== block-no-content-4a-dyn.html block-no-content-4-ref.html
+== block-no-content-4b-dyn.html block-no-content-4-ref.html
+== block-no-content-4c-dyn.html block-no-content-4-ref.html
+== block-no-content-5a-dyn.html block-no-content-5-ref.html
+== block-no-content-5b-dyn.html block-no-content-5-ref.html
+== block-no-content-6-dyn.html block-no-content-6-ref.html
+== block-no-content-7-dyn.html block-no-content-7-ref.html
+== block-no-content-8-dyn.html block-no-content-8-ref.html
 # These tests are similar to the no-content ones, except that some boxes
 # have height: 0; declared on them.
 == block-zero-height-1a.html block-zero-height-1a-ref.html
 == block-zero-height-1b.html block-zero-height-1b-ref.html
 == block-zero-height-2a.html block-zero-height-2a-ref.html
 == block-zero-height-2b.html block-zero-height-2b-ref.html
 == block-zero-height-2c.html block-zero-height-2c-ref.html
 == block-zero-height-3a.html block-zero-height-3-ref.html
@@ -582,44 +582,44 @@ skip-if(B2G) == block-overflow-4.html bl
 == block-overflow-5a.html block-overflow-5-ref.html
 == block-overflow-5a.html block-overflow-5-ref2.html
 == block-overflow-5b.html block-overflow-5-ref.html
 == block-overflow-5b.html block-overflow-5-ref2.html
 == block-overflow-5c.html block-overflow-5c-ref.html
 == block-overflow-5c.html block-overflow-5c-ref2.html
 == block-overflow-5d.html block-overflow-5-ref.html
 == block-overflow-5d.html block-overflow-5-ref2.html
-random-if(B2G&&browserIsRemote) == block-overflow-1-dyn.html block-overflow-1-ref2.html
-random-if(B2G&&browserIsRemote) == block-overflow-2-dyn.html block-overflow-2-ref2.html
+== block-overflow-1-dyn.html block-overflow-1-ref2.html
+== block-overflow-2-dyn.html block-overflow-2-ref2.html
 skip-if(B2G) == block-overflow-3-dyn.html block-overflow-3-ref2.html # bug 773482
 skip-if(B2G) == block-overflow-4-dyn.html block-overflow-4-ref2.html
 == block-overflow-5a-dyn.html block-overflow-5-ref2.html
 == block-overflow-5b-dyn.html block-overflow-5-ref2.html
 == block-overflow-5c-dyn.html block-overflow-5c-ref2.html
 == block-overflow-5d-dyn.html block-overflow-5-ref2.html
 # * 'fieldset' elements, per HTML5 (Candidate Recommendation 6 August 2013):
 # §10.3.13 (The fieldset and legend elements): "The fieldset element is
 # expected to establish a new block formatting context."
-random-if(B2G&&browserIsRemote) == fieldset-sibling-1a.html fieldset-sibling-1-ref.html
-random-if(B2G&&browserIsRemote) == fieldset-sibling-1b.html fieldset-sibling-1-ref.html
-random-if(B2G&&browserIsRemote) == fieldset-sibling-1c.html fieldset-sibling-1-ref.html
-random-if(B2G&&browserIsRemote) == fieldset-sibling-2a.html fieldset-sibling-2-ref1.html
-random-if(B2G&&browserIsRemote) == fieldset-sibling-2b.html fieldset-sibling-2-ref1.html
-random-if(B2G&&browserIsRemote) == fieldset-sibling-2c.html fieldset-sibling-2-ref1.html
-random-if(B2G&&browserIsRemote) == fieldset-sibling-2a.html fieldset-sibling-2-ref2.html
-random-if(B2G&&browserIsRemote) == fieldset-sibling-2b.html fieldset-sibling-2-ref2.html
-random-if(B2G&&browserIsRemote) == fieldset-sibling-2c.html fieldset-sibling-2-ref2.html
-random-if(B2G&&browserIsRemote) == fieldset-sibling-1a-dyn.html fieldset-sibling-1-ref.html
-random-if(B2G&&browserIsRemote) == fieldset-sibling-1b-dyn.html fieldset-sibling-1-ref.html
-random-if(B2G&&browserIsRemote) == fieldset-sibling-1c-dyn.html fieldset-sibling-1-ref.html
-random-if(B2G&&browserIsRemote) == fieldset-sibling-2a-dyn.html fieldset-sibling-2-ref2.html
-random-if(B2G&&browserIsRemote) == fieldset-sibling-2b-dyn.html fieldset-sibling-2-ref2.html
-random-if(B2G&&browserIsRemote) == fieldset-sibling-2c-dyn.html fieldset-sibling-2-ref2.html
-random-if(B2G&&browserIsRemote) == fieldset-child-1.html fieldset-child-1-ref.html
-random-if(B2G&&browserIsRemote) == fieldset-child-1-dyn.html fieldset-child-1-ref.html
+== fieldset-sibling-1a.html fieldset-sibling-1-ref.html
+== fieldset-sibling-1b.html fieldset-sibling-1-ref.html
+== fieldset-sibling-1c.html fieldset-sibling-1-ref.html
+== fieldset-sibling-2a.html fieldset-sibling-2-ref1.html
+== fieldset-sibling-2b.html fieldset-sibling-2-ref1.html
+== fieldset-sibling-2c.html fieldset-sibling-2-ref1.html
+== fieldset-sibling-2a.html fieldset-sibling-2-ref2.html
+== fieldset-sibling-2b.html fieldset-sibling-2-ref2.html
+== fieldset-sibling-2c.html fieldset-sibling-2-ref2.html
+== fieldset-sibling-1a-dyn.html fieldset-sibling-1-ref.html
+== fieldset-sibling-1b-dyn.html fieldset-sibling-1-ref.html
+== fieldset-sibling-1c-dyn.html fieldset-sibling-1-ref.html
+== fieldset-sibling-2a-dyn.html fieldset-sibling-2-ref2.html
+== fieldset-sibling-2b-dyn.html fieldset-sibling-2-ref2.html
+== fieldset-sibling-2c-dyn.html fieldset-sibling-2-ref2.html
+== fieldset-child-1.html fieldset-child-1-ref.html
+== fieldset-child-1-dyn.html fieldset-child-1-ref.html
 # * Tables, per CSS 2.1 §17.4 (Tables in the visual formatting model):
 # "The table wrapper box establishes a block formatting context."
 # "The table wrapper box is a 'block' box if the table is block-level [...]"
 == table-sibling-1a.html table-sibling-1-ref.html
 != table-sibling-1a.html table-sibling-1-noref.html
 == table-sibling-1b.html table-sibling-1-ref.html
 != table-sibling-1b.html table-sibling-1-noref.html
 == table-sibling-1c.html table-sibling-1-ref.html
@@ -651,43 +651,43 @@ skip-if(B2G) == table-sibling-3-dyn.html
 # of the table wrapper box. They can collapse with the margins of other
 # table-captions, though, if they share the same caption-side.
 == table-caption-1a.html table-caption-1-ref.html
 == table-caption-1b.html table-caption-1-ref.html
 == table-caption-1c.html table-caption-1-ref.html
 == table-caption-2a.html table-caption-2-ref.html
 == table-caption-2b.html table-caption-2-ref.html
 == table-caption-2c.html table-caption-2-ref.html
-random-if(B2G&&browserIsRemote) == table-caption-1a-dyn.html table-caption-1-ref.html
-random-if(B2G&&browserIsRemote) == table-caption-1b-dyn.html table-caption-1-ref.html
-random-if(B2G&&browserIsRemote) == table-caption-1c-dyn.html table-caption-1-ref.html
-random-if(B2G&&browserIsRemote) == table-caption-2a-dyn.html table-caption-2-ref.html
-random-if(B2G&&browserIsRemote) == table-caption-2b-dyn.html table-caption-2-ref.html
-random-if(B2G&&browserIsRemote) == table-caption-2c-dyn.html table-caption-2-ref.html
+== table-caption-1a-dyn.html table-caption-1-ref.html
+== table-caption-1b-dyn.html table-caption-1-ref.html
+== table-caption-1c-dyn.html table-caption-1-ref.html
+== table-caption-2a-dyn.html table-caption-2-ref.html
+== table-caption-2b-dyn.html table-caption-2-ref.html
+== table-caption-2c-dyn.html table-caption-2-ref.html
 # Note: CSS 2.1 suggests that the 'caption-side' values 'top-outside' and
 # 'bottom-outside' will be used in a future CSS Module to restore the
 # CSS 2 definition of 'top' and 'bottom' (which is different from CSS 2.1's).
 # Since Bug #659828 was fixed, 'top-outside' and 'bottom-outside' act as an 
 # alias for the CSS 2.1 values 'top' and 'bottom' respectively.
 == table-caption-top-1.html table-caption-top-1-ref.html
 == table-caption-top-2.html table-caption-top-2-ref.html
 == table-caption-top-outside-1.html table-caption-top-1-ref.html
 == table-caption-top-outside-2.html table-caption-top-1-ref.html
 == table-caption-bottom-1.html table-caption-bottom-1-ref.html
 == table-caption-bottom-2.html table-caption-bottom-2-ref.html
 == table-caption-bottom-outside-1.html table-caption-bottom-1-ref.html
 == table-caption-bottom-outside-2.html table-caption-bottom-1-ref.html
-random-if(B2G&&browserIsRemote) == table-caption-top-1-dyn.html table-caption-top-1-ref.html
-random-if(B2G&&browserIsRemote) == table-caption-top-2-dyn.html table-caption-top-1-ref.html
-random-if(B2G&&browserIsRemote) == table-caption-top-outside-1-dyn.html table-caption-top-1-ref.html
-random-if(B2G&&browserIsRemote) == table-caption-top-outside-2-dyn.html table-caption-top-2-ref.html
-random-if(B2G&&browserIsRemote) == table-caption-bottom-1-dyn.html table-caption-bottom-1-ref.html
-random-if(B2G&&browserIsRemote) == table-caption-bottom-2-dyn.html table-caption-bottom-1-ref.html
-random-if(B2G&&browserIsRemote) == table-caption-bottom-outside-1-dyn.html table-caption-bottom-1-ref.html
-random-if(B2G&&browserIsRemote) == table-caption-bottom-outside-2-dyn.html table-caption-bottom-1-ref.html
+== table-caption-top-1-dyn.html table-caption-top-1-ref.html
+== table-caption-top-2-dyn.html table-caption-top-1-ref.html
+== table-caption-top-outside-1-dyn.html table-caption-top-1-ref.html
+== table-caption-top-outside-2-dyn.html table-caption-top-2-ref.html
+== table-caption-bottom-1-dyn.html table-caption-bottom-1-ref.html
+== table-caption-bottom-2-dyn.html table-caption-bottom-1-ref.html
+== table-caption-bottom-outside-1-dyn.html table-caption-bottom-1-ref.html
+== table-caption-bottom-outside-2-dyn.html table-caption-bottom-1-ref.html
 fails == caption-sibling-1a.html caption-sibling-1-ref.html # Bug 144517
 != caption-sibling-1a.html caption-sibling-1-noref.html
 fails == caption-sibling-1b.html caption-sibling-1-ref.html # Bug 144517
 != caption-sibling-1b.html caption-sibling-1-noref.html
 fails == caption-sibling-1c.html caption-sibling-1-ref.html # Bug 144517
 != caption-sibling-1c.html caption-sibling-1-noref2.html
 fails == caption-sibling-1a-dyn.html caption-sibling-1-ref.html # Bug 144517
 != caption-sibling-1a-dyn.html caption-sibling-1-noref.html
@@ -700,75 +700,75 @@ fails == caption-sibling-2-dyn.html capt
 == caption-child-1.html caption-child-1-ref.html
 == caption-child-1-dyn.html caption-child-1-ref.html
 # * Multi-column elements, per CSS Multi-column Layout Module
 # (Candidate Recommendation 12 April 2011):
 # "A multi-column element establishes a new block formatting context [...]"
 == column-sibling-1a.html column-sibling-1-ref.html
 == column-sibling-1b.html column-sibling-1-ref.html
 == column-sibling-1c.html column-sibling-1-ref.html
-random-if(B2G&&browserIsRemote) == column-sibling-1a-dyn.html column-sibling-1-ref.html
-random-if(B2G&&browserIsRemote) == column-sibling-1b-dyn.html column-sibling-1-ref.html
-random-if(B2G&&browserIsRemote) == column-sibling-1c-dyn.html column-sibling-1-ref.html
-random-if(B2G&&browserIsRemote) == column-sibling-2a.html column-sibling-2-ref.html
-random-if(B2G&&browserIsRemote) == column-sibling-2b.html column-sibling-2-ref.html
-random-if(B2G&&browserIsRemote) == column-sibling-2c.html column-sibling-2-ref.html
-random-if(B2G&&browserIsRemote) == column-sibling-2a-dyn.html column-sibling-2-ref.html
-random-if(B2G&&browserIsRemote) == column-sibling-2b-dyn.html column-sibling-2-ref.html
-random-if(B2G&&browserIsRemote) == column-sibling-2c-dyn.html column-sibling-2-ref.html
-random-if(B2G&&browserIsRemote) == column-child-1.html column-child-1-ref.html
-random-if(B2G&&browserIsRemote) == column-child-1-dyn.html column-child-1-ref.html
+== column-sibling-1a-dyn.html column-sibling-1-ref.html
+== column-sibling-1b-dyn.html column-sibling-1-ref.html
+== column-sibling-1c-dyn.html column-sibling-1-ref.html
+== column-sibling-2a.html column-sibling-2-ref.html
+== column-sibling-2b.html column-sibling-2-ref.html
+== column-sibling-2c.html column-sibling-2-ref.html
+== column-sibling-2a-dyn.html column-sibling-2-ref.html
+== column-sibling-2b-dyn.html column-sibling-2-ref.html
+== column-sibling-2c-dyn.html column-sibling-2-ref.html
+== column-child-1.html column-child-1-ref.html
+== column-child-1-dyn.html column-child-1-ref.html
 # * inline-block boxes
 # "Margins of inline-block boxes do not collapse
 #  (not even with their in-flow children)."
 == inline-block-sibling-1a.html inline-block-sibling-1-ref.html
 == inline-block-sibling-1b.html inline-block-sibling-1-ref.html
 == inline-block-sibling-1c.html inline-block-sibling-1-ref.html
 == inline-block-sibling-2.html inline-block-sibling-2-ref.html
 != inline-block-sibling-2.html inline-block-sibling-2-noref.html
-random-if(B2G&&browserIsRemote) == inline-block-sibling-1a-dyn.html inline-block-sibling-1-ref.html
-random-if(B2G&&browserIsRemote) == inline-block-sibling-1b-dyn.html inline-block-sibling-1-ref.html
-random-if(B2G&&browserIsRemote) == inline-block-sibling-1c-dyn.html inline-block-sibling-1-ref.html
-random-if(B2G&&browserIsRemote) == inline-block-sibling-2-dyn.html inline-block-sibling-2-ref.html
+== inline-block-sibling-1a-dyn.html inline-block-sibling-1-ref.html
+== inline-block-sibling-1b-dyn.html inline-block-sibling-1-ref.html
+== inline-block-sibling-1c-dyn.html inline-block-sibling-1-ref.html
+== inline-block-sibling-2-dyn.html inline-block-sibling-2-ref.html
 == inline-block-child-1.html inline-block-child-1-ref.html
 == inline-block-child-2.html inline-block-child-2-ref.html
 != inline-block-child-2.html inline-block-child-2-noref.html
 == inline-block-child-3.html inline-block-child-3-ref.html
 == inline-block-child-1-dyn.html inline-block-child-1-ref.html
-random-if(B2G&&browserIsRemote) == inline-block-child-2-dyn.html inline-block-child-2-ref.html
-random-if(B2G&&browserIsRemote) == inline-block-child-3-dyn.html inline-block-child-3-ref.html
+== inline-block-child-2-dyn.html inline-block-child-2-ref.html
+== inline-block-child-3-dyn.html inline-block-child-3-ref.html
 # * absolutely positioned elements
 # "Margins of absolutely positioned boxes do not collapse
 #  (not even with their in-flow children)."
 == block-abs-pos-1.html block-abs-pos-1-ref.html
 == block-abs-pos-2.html block-abs-pos-2-ref.html
 == block-abs-pos-2.html block-abs-pos-2-ref2.html
-random-if(B2G&&browserIsRemote) == block-abs-pos-1-dyn.html block-abs-pos-1-ref.html
-random-if(B2G&&browserIsRemote) == block-abs-pos-2-dyn.html block-abs-pos-2-ref2.html
+== block-abs-pos-1-dyn.html block-abs-pos-1-ref.html
+== block-abs-pos-2-dyn.html block-abs-pos-2-ref2.html
 # * Floats
 # "Margins between a floated box and any other box do not collapse
 #  (not even between a float and its in-flow children)."
 == block-float-1a.html block-float-1a-ref.html
 == block-float-1a.html block-float-1a-ref2.html
 != block-float-1a.html block-float-1a-noref.html
 == block-float-1b.html block-float-1b-ref.html
 == block-float-1b.html block-float-1b-ref2.html
 != block-float-1b.html block-float-1b-noref.html
 == block-float-2a.html block-float-2a-ref.html
 != block-float-2a.html block-float-2a-noref.html
 == block-float-2b.html block-float-2b-ref.html
 != block-float-2b.html block-float-2b-noref.html
 == block-float-3a.html block-float-3a-ref.html
 == block-float-3b.html block-float-3b-ref.html
-random-if(B2G&&browserIsRemote) == block-float-1a-dyn.html block-float-1a-ref.html
-random-if(B2G&&browserIsRemote) == block-float-1b-dyn.html block-float-1b-ref.html
-random-if(B2G&&browserIsRemote) == block-float-2a-dyn.html block-float-2a-ref.html
-random-if(B2G&&browserIsRemote) == block-float-2b-dyn.html block-float-2b-ref.html
-random-if(B2G&&browserIsRemote) == block-float-3a-dyn.html block-float-3a-ref.html
-random-if(B2G&&browserIsRemote) == block-float-3b-dyn.html block-float-3b-ref.html
+== block-float-1a-dyn.html block-float-1a-ref.html
+== block-float-1b-dyn.html block-float-1b-ref.html
+== block-float-2a-dyn.html block-float-2a-ref.html
+== block-float-2b-dyn.html block-float-2b-ref.html
+== block-float-3a-dyn.html block-float-3a-ref.html
+== block-float-3b-dyn.html block-float-3b-ref.html
 # Tests for various cases where clearance is applied and collapsing is
 # prevented or only allows for certain margins.
 fails == block-clear-1a.html block-clear-1a-ref.html # Bug 451791
 fails == block-clear-1b.html block-clear-1b-ref.html # Bug 451791
 == block-clear-2.html block-clear-2-ref.html
 != block-clear-2.html block-clear-2-noref.html
 == block-clear-3a.html block-clear-3-ref-left.html
 == block-clear-3b.html block-clear-3-ref-right.html
@@ -848,17 +848,17 @@ fails == block-clear-7g-left.html block-
 != block-root-1a.html block-root-1a-noref2.html
 == block-root-1b.html block-root-1b-ref.html
 == block-root-1b.html block-root-1b-ref2.html
 == block-html-body-1.html block-html-body-1-ref.html
 == block-html-body-1.html block-html-body-1-ref2.html
 != block-html-body-1.html block-html-body-1-noref.html
 # Some basic tests for margins given in percent and em.
 == block-percent-1.html block-percent-1-ref.html
-random-if(B2G&&browserIsRemote) == block-percent-1-dyn.html block-percent-1-ref.html
-random-if(B2G&&browserIsRemote) == block-percent-2.html block-percent-2-ref.html
-random-if(B2G&&browserIsRemote) == block-percent-2-dyn.html block-percent-2-ref.html
+== block-percent-1-dyn.html block-percent-1-ref.html
+== block-percent-2.html block-percent-2-ref.html
+== block-percent-2-dyn.html block-percent-2-ref.html
 == block-em-length-1.html block-em-length-1-ref.html
-random-if(B2G&&browserIsRemote) == block-em-length-1-dyn.html block-em-length-1-ref.html
+== block-em-length-1-dyn.html block-em-length-1-ref.html
 # Other tests.
 == dynamic-add-text-1.html dynamic-add-text-1-ref.html # Bug 467321
 == scrollable-vertical-margin.html scrollable-vertical-margin-ref.html
 == scrollable-horizontal-margin.html scrollable-horizontal-margin-ref.html
--- a/layout/reftests/mathml/reftest.list
+++ b/layout/reftests/mathml/reftest.list
@@ -38,17 +38,17 @@ skip-if(B2G&&browserIsRemote) random-if(
 == mfenced-9.html mfenced-9-ref.html
 fails-if(/^Windows\x20NT\x205\.1/.test(http.oscpu)) == mfenced-10.html mfenced-10-ref.html # Windows versions without Cambria Math, see bug 670592
 == mi-mathvariant-1.xhtml mi-mathvariant-1-ref.xhtml
 == mi-mathvariant-2.xhtml mi-mathvariant-2-ref.xhtml
 != mi-mathvariant-3.html mi-mathvariant-3-ref.html
 != non-spacing-accent-1.xhtml non-spacing-accent-1-ref.xhtml
 == overbar-width-1.xhtml overbar-width-1-ref.xhtml
 skip-if(B2G) == quotes-1.xhtml quotes-1-ref.xhtml
-!= stretchy-underbar-1.xhtml stretchy-underbar-1-ref.xhtml 
+!= stretchy-underbar-1.xhtml stretchy-underbar-1-ref.xhtml
 == table-width-1.xhtml table-width-1-ref.xhtml
 == table-width-2.html table-width-2-ref.html
 == table-width-3.html table-width-3-ref.html
 == table-width-4.html table-width-4-ref.html
 == underbar-width-1.xhtml underbar-width-1-ref.xhtml
 == mathml-type-supported.xhtml mathml-type-supported-ref.xml
 == mtable-align-negative-rownumber.html mtable-align-negative-rownumber-ref.html
 != embellished-op-1-1.html embellished-op-1-1-ref.html
@@ -95,19 +95,19 @@ random-if(winWidget&&!/^Windows\x20NT\x2
 == mspace-1.html mspace-1-ref.html
 == mpadded-1.html mpadded-1-ref.html
 == mpadded-2.html mpadded-2-ref.html
 == mpadded-3.html mpadded-3-ref.html
 == mpadded-4.html mpadded-4-ref.html
 == mpadded-5.html mpadded-5-ref.html
 == mpadded-1-2.html mpadded-1-2-ref.html
 == mpadded-6.html mpadded-6-ref.html
-random-if(B2G&&browserIsRemote) == mpadded-7.html mpadded-7-ref.html # B2G: slight character width variation
-random-if(B2G&&browserIsRemote) == mpadded-8.html mpadded-8-ref.html # B2G: slight character width variation
-random-if(B2G&&browserIsRemote) == mpadded-9.html mpadded-9-ref.html # B2G: slight character width variation
+fails-if(B2G) == mpadded-7.html mpadded-7-ref.html # B2G: slight character width variation
+fails-if(B2G) == mpadded-8.html mpadded-8-ref.html # B2G: slight character width variation
+fails-if(B2G) == mpadded-9.html mpadded-9-ref.html # B2G: slight character width variation
 == math-display.html math-display-ref.html
 == scriptlevel-1.html scriptlevel-1-ref.html
 == scriptlevel-movablelimits-1.html scriptlevel-movablelimits-1-ref.html
 == munderover-align-accent-false.html munderover-align-accent-false-ref.html
 == munderover-align-accent-true.html munderover-align-accent-true-ref.html
 == munder-mover-align-accent-true.html munder-mover-align-accent-true-ref.html
 == munder-mover-align-accent-false.html munder-mover-align-accent-false-ref.html
 == mfrac-linethickness-1.xhtml mfrac-linethickness-1-ref.xhtml
@@ -115,34 +115,34 @@ random-if(B2G&&browserIsRemote) == mpadd
 == mfrac-linethickness-3.xhtml mfrac-linethickness-3-ref.xhtml
 == mathml-negativespace.html mathml-negativespace-ref.html
 == negative-mspace-1.html negative-mspace-1-ref.html
 != link-1.xhtml link-ref.xhtml
 == munderover-empty-scripts.html munderover-empty-scripts-ref.html
 == positive-namedspace.html positive-namedspace-ref.html
 == mtable-align-whitespace.html mtable-align-whitespace-ref.html
 == mtable-width.html mtable-width-ref.html
-random-if(B2G&&browserIsRemote) == mtable-rowlines-single-mtable-dynamic.html mtable-rowlines-single-ref.html
-random-if(B2G&&browserIsRemote) == mtable-rowlines-multi-mtable-dynamic.html mtable-rowlines-multi-ref.html
-random-if(B2G&&browserIsRemote) == mtable-rowalign-single-mtr.html mtable-rowalign-single-ref.html
-random-if(B2G&&browserIsRemote) == mtable-rowalign-single-mtr-dynamic.html mtable-rowalign-single-ref.html
-random-if(B2G&&browserIsRemote) == mtable-rowalign-single-mtable.html mtable-rowalign-single-ref.html
-random-if(B2G&&browserIsRemote) == mtable-rowalign-single-mtable-dynamic.html mtable-rowalign-single-ref.html
-random-if(B2G&&browserIsRemote) == mtable-rowalign-multi-mtable.html mtable-rowalign-multi-ref.html
-random-if(B2G&&browserIsRemote) == mtable-rowalign-multi-mtable-dynamic.html mtable-rowalign-multi-ref.html
-random-if(B2G&&browserIsRemote) == mtable-columnlines-single-mtable-dynamic.html mtable-columnlines-single-ref.html
-random-if(B2G&&browserIsRemote) == mtable-columnlines-multi-mtable-dynamic.html mtable-columnlines-multi-ref.html
+== mtable-rowlines-single-mtable-dynamic.html mtable-rowlines-single-ref.html
+== mtable-rowlines-multi-mtable-dynamic.html mtable-rowlines-multi-ref.html
+== mtable-rowalign-single-mtr.html mtable-rowalign-single-ref.html
+== mtable-rowalign-single-mtr-dynamic.html mtable-rowalign-single-ref.html
+== mtable-rowalign-single-mtable.html mtable-rowalign-single-ref.html
+== mtable-rowalign-single-mtable-dynamic.html mtable-rowalign-single-ref.html
+== mtable-rowalign-multi-mtable.html mtable-rowalign-multi-ref.html
+== mtable-rowalign-multi-mtable-dynamic.html mtable-rowalign-multi-ref.html
+== mtable-columnlines-single-mtable-dynamic.html mtable-columnlines-single-ref.html
+== mtable-columnlines-multi-mtable-dynamic.html mtable-columnlines-multi-ref.html
 == mtable-columnalign-single-mtr.html mtable-columnalign-single-ref.html
-random-if(B2G&&browserIsRemote) == mtable-columnalign-single-mtr-dynamic.html mtable-columnalign-single-ref.html
+== mtable-columnalign-single-mtr-dynamic.html mtable-columnalign-single-ref.html
 == mtable-columnalign-single-mtable.html mtable-columnalign-single-ref.html
-random-if(B2G&&browserIsRemote) == mtable-columnalign-single-mtable-dynamic.html mtable-columnalign-single-ref.html
-random-if(B2G&&browserIsRemote) == mtable-columnalign-multi-mtr.html mtable-columnalign-multi-ref.html
-random-if(B2G&&browserIsRemote) == mtable-columnalign-multi-mtr-dynamic.html mtable-columnalign-multi-ref.html
-random-if(B2G&&browserIsRemote) == mtable-columnalign-multi-mtable.html mtable-columnalign-multi-ref.html
-random-if(B2G&&browserIsRemote) == mtable-columnalign-multi-mtable-dynamic.html mtable-columnalign-multi-ref.html
+== mtable-columnalign-single-mtable-dynamic.html mtable-columnalign-single-ref.html
+== mtable-columnalign-multi-mtr.html mtable-columnalign-multi-ref.html
+== mtable-columnalign-multi-mtr-dynamic.html mtable-columnalign-multi-ref.html
+== mtable-columnalign-multi-mtable.html mtable-columnalign-multi-ref.html
+== mtable-columnalign-multi-mtable-dynamic.html mtable-columnalign-multi-ref.html
 == maction-selection.html maction-selection-ref.html
 == maction-dynamic-embellished-op.html maction-dynamic-embellished-op-ref.html
 skip-if(B2G) == maction-dynamic-1.html maction-dynamic-1-ref.html # bug 773482
 == maction-dynamic-2.html maction-dynamic-2-ref.html
 == mo-lspace-rspace.html mo-lspace-rspace-ref.html
 == mo-lspace-rspace-2.html mo-lspace-rspace-2-ref.html
 == mo-lspace-rspace-3.html mo-lspace-rspace-3-ref.html
 == mo-lspace-rspace-4.html mo-lspace-rspace-4-ref.html
@@ -176,17 +176,17 @@ random-if(B2G&&browserIsRemote) == multi
 != menclose-1m.html menclose-1-ref.html
 != menclose-1n.html menclose-1-ref.html
 != menclose-1o.html menclose-1-ref.html
 != menclose-1p.html menclose-1-ref.html
 != menclose-1q.html menclose-1-ref.html
 fails-if(B2G) == menclose-2-actuarial.html menclose-2-actuarial-ref.html # B2G slight thickness variation
 == menclose-2-bottom.html menclose-2-bottom-ref.html
 fails-if(B2G) == menclose-2-box.html menclose-2-box-ref.html # B2G slight thickness variation
-fails-if(B2G) == menclose-2-circle.html menclose-2-circle-ref.html
+== menclose-2-circle.html menclose-2-circle-ref.html
 == menclose-2-downdiagonalstrike.html menclose-2-downdiagonalstrike-ref.html
 == menclose-2-horizontalstrike.html menclose-2-horizontalstrike-ref.html
 fails-if(B2G) == menclose-2-left.html menclose-2-left-ref.html # B2G slight thickness variation
 == menclose-2-longdiv.html menclose-2-longdiv-ref.html
 == menclose-2-right.html menclose-2-right-ref.html
 fails-if(B2G) == menclose-2-roundedbox.html menclose-2-roundedbox-ref.html # B2G slight thickness variation
 fails-if(B2G) == menclose-2-top.html menclose-2-top-ref.html # B2G slight thickness variation
 fails-if(B2G) == menclose-2-updiagonalarrow.html menclose-2-updiagonalarrow-ref.html # B2G slight thickness variation
@@ -196,71 +196,71 @@ fails-if(B2G) == menclose-2-roundedbox.h
 == menclose-2-phasorangle.html menclose-2-phasorangle-ref.html
 == menclose-3-box.html menclose-3-box-ref.html
 == menclose-3-madruwb.html menclose-3-madruwb-ref.html
 fails-if(B2G||Android||OSX==10.6) == menclose-3-radical.html menclose-3-radical-ref.html # Bug 973917
 == menclose-3-default.html menclose-3-default-ref.html
 == menclose-3-invalid.html menclose-3-invalid-ref.html
 == menclose-3-multiple.html menclose-3-multiple-ref.html
 == menclose-3-unknown.html menclose-3-unknown.html
-random-if(B2G&&browserIsRemote) == menclose-4.html data:text/html,<body>Pass
-random-if(B2G&&browserIsRemote) == menclose-5-actuarial.html menclose-5-actuarial-ref.html
-random-if(B2G&&browserIsRemote) == menclose-5-bottom.html menclose-5-bottom-ref.html
-random-if(B2G&&browserIsRemote) == menclose-5-box.html menclose-5-box-ref.html
-fuzzy-if(OSX,1,100) random-if(B2G&&browserIsRemote) == menclose-5-circle.html menclose-5-circle-ref.html
-random-if(B2G&&browserIsRemote) == menclose-5-downdiagonalstrike.html menclose-5-downdiagonalstrike-ref.html
-random-if(B2G&&browserIsRemote) == menclose-5-horizontalstrike.html menclose-5-horizontalstrike-ref.html
-random-if(B2G&&browserIsRemote) == menclose-5-left.html menclose-5-left-ref.html
+== menclose-4.html data:text/html,<body>Pass
+== menclose-5-actuarial.html menclose-5-actuarial-ref.html
+== menclose-5-bottom.html menclose-5-bottom-ref.html
+== menclose-5-box.html menclose-5-box-ref.html
+fuzzy-if(OSX,1,100) == menclose-5-circle.html menclose-5-circle-ref.html
+== menclose-5-downdiagonalstrike.html menclose-5-downdiagonalstrike-ref.html
+== menclose-5-horizontalstrike.html menclose-5-horizontalstrike-ref.html
+== menclose-5-left.html menclose-5-left-ref.html
 == menclose-5-longdiv.html menclose-5-longdiv-ref.html
-random-if(B2G&&browserIsRemote) == menclose-5-madruwb.html menclose-5-madruwb-ref.html
-random-if(B2G&&browserIsRemote) == menclose-5-radical.html menclose-5-radical-ref.html
-random-if(B2G&&browserIsRemote) == menclose-5-right.html menclose-5-right-ref.html
-random-if(B2G&&browserIsRemote) == menclose-5-roundedbox.html menclose-5-roundedbox-ref.html
-random-if(B2G&&browserIsRemote) == menclose-5-top.html menclose-5-top-ref.html
-random-if(B2G&&browserIsRemote) == menclose-5-updiagonalarrow.html menclose-5-updiagonalarrow-ref.html
-random-if(B2G&&browserIsRemote) == menclose-5-updiagonalstrike.html menclose-5-updiagonalstrike-ref.html
-random-if(B2G&&browserIsRemote) == menclose-5-verticalstrike.html menclose-5-verticalstrike-ref.html
-random-if(B2G&&browserIsRemote) == menclose-5-phasorangle.html menclose-5-phasorangle-ref.html
-random-if(B2G&&browserIsRemote) == menclose-6-actuarial.html menclose-6-ref.html
-random-if(B2G&&browserIsRemote) == menclose-6-bottom.html menclose-6-ref.html
-random-if(B2G&&browserIsRemote) == menclose-6-box.html menclose-6-ref.html
-random-if(B2G&&browserIsRemote) == menclose-6-circle.html menclose-6-ref.html
-random-if(B2G&&browserIsRemote) == menclose-6-downdiagonalstrike.html menclose-6-ref.html
-random-if(B2G&&browserIsRemote) == menclose-6-horizontalstrike.html menclose-6-ref.html
-random-if(B2G&&browserIsRemote) == menclose-6-left.html menclose-6-ref.html
-random-if(B2G&&browserIsRemote) == menclose-6-longdiv.html menclose-6-ref.html
-random-if(B2G&&browserIsRemote) == menclose-6-madruwb.html menclose-6-ref.html
-random-if(B2G&&browserIsRemote) == menclose-6-radical.html menclose-6-ref.html
-random-if(B2G&&browserIsRemote) == menclose-6-right.html menclose-6-ref.html
-random-if(B2G&&browserIsRemote) == menclose-6-roundedbox.html menclose-6-ref.html
-random-if(B2G&&browserIsRemote) == menclose-6-top.html menclose-6-ref.html
-random-if(B2G&&browserIsRemote) == menclose-6-updiagonalarrow.html menclose-6-ref.html
-random-if(B2G&&browserIsRemote) == menclose-6-updiagonalstrike.html menclose-6-ref.html
-random-if(B2G&&browserIsRemote) == menclose-6-verticalstrike.html menclose-6-ref.html
-random-if(B2G&&browserIsRemote) == menclose-6-phasorangle.html menclose-6-ref.html
+== menclose-5-madruwb.html menclose-5-madruwb-ref.html
+== menclose-5-radical.html menclose-5-radical-ref.html
+== menclose-5-right.html menclose-5-right-ref.html
+== menclose-5-roundedbox.html menclose-5-roundedbox-ref.html
+== menclose-5-top.html menclose-5-top-ref.html
+== menclose-5-updiagonalarrow.html menclose-5-updiagonalarrow-ref.html
+== menclose-5-updiagonalstrike.html menclose-5-updiagonalstrike-ref.html
+== menclose-5-verticalstrike.html menclose-5-verticalstrike-ref.html
+== menclose-5-phasorangle.html menclose-5-phasorangle-ref.html
+== menclose-6-actuarial.html menclose-6-ref.html
+== menclose-6-bottom.html menclose-6-ref.html
+== menclose-6-box.html menclose-6-ref.html
+== menclose-6-circle.html menclose-6-ref.html
+== menclose-6-downdiagonalstrike.html menclose-6-ref.html
+== menclose-6-horizontalstrike.html menclose-6-ref.html
+== menclose-6-left.html menclose-6-ref.html
+== menclose-6-longdiv.html menclose-6-ref.html
+== menclose-6-madruwb.html menclose-6-ref.html
+== menclose-6-radical.html menclose-6-ref.html
+== menclose-6-right.html menclose-6-ref.html
+== menclose-6-roundedbox.html menclose-6-ref.html
+== menclose-6-top.html menclose-6-ref.html
+== menclose-6-updiagonalarrow.html menclose-6-ref.html
+== menclose-6-updiagonalstrike.html menclose-6-ref.html
+== menclose-6-verticalstrike.html menclose-6-ref.html
+== menclose-6-phasorangle.html menclose-6-ref.html
 == mmultiscript-align.html mmultiscript-align-ref.html
 fails-if(winWidget&&!/^Windows\x20NT\x205\.1/.test(http.oscpu)) == subscript-italic-correction.html subscript-italic-correction-ref.html # Windows versions with Cambria Math, bug 961482
 fails-if(B2G||Android||/^Windows\x20NT\x205\.1/.test(http.oscpu)||OSX==10.6) == mathvariant-1a.html mathvariant-1a-ref.html # Bug 1010679
 fails-if(B2G||Android||/^Windows\x20NT\x205\.1/.test(http.oscpu)||OSX==10.6) == mathvariant-1b.html mathvariant-1b-ref.html # Bug 1010679
 fails-if(B2G||Android||/^Windows\x20NT\x205\.1/.test(http.oscpu)||OSX==10.6) == mathvariant-1c.html mathvariant-1c-ref.html # Bug 1010679
 == mathvariant-1d.html mathvariant-1d-ref.html
 fails-if(B2G||Android||/^Windows\x20NT\x205\.1/.test(http.oscpu)||OSX) == mathvariant-2.html mathvariant-2-ref.html # Bugs 1010678, 1010679
 == mathvariant-3.html mathvariant-3-ref.html
 == mathvariant-4.html mathvariant-4-ref.html
-random-if(B2G&&browserIsRemote) == mathvariant-5.html mathvariant-5-ref.html
+== mathvariant-5.html mathvariant-5-ref.html
 == ssty-1.html ssty-1-ref.html
 == ssty-2.html ssty-2-ref.html
 == ssty-3.html ssty-3-ref.html
-random-if(B2G&&browserIsRemote) == ssty-4.html ssty-4-ref.html
+== ssty-4.html ssty-4-ref.html
 == mathscript-1.html mathscript-1-ref.html
 == mathscript-2.html mathscript-2-ref.html
-random-if(B2G&&browserIsRemote) == mo-accent-dynamic.html mo-accent-dynamic-ref.html
-random-if(B2G&&browserIsRemote) == mo-movablelimits-dynamic.html mo-movablelimits-dynamic-ref.html
-random-if(B2G&&browserIsRemote) == munderover-accent-dynamic.html munderover-accent-dynamic-ref.html
-random-if(B2G&&browserIsRemote) == munderover-accentunder-dynamic.html munderover-accentunder-dynamic-ref.html
+== mo-accent-dynamic.html mo-accent-dynamic-ref.html
+== mo-movablelimits-dynamic.html mo-movablelimits-dynamic-ref.html
+== munderover-accent-dynamic.html munderover-accent-dynamic-ref.html
+== munderover-accentunder-dynamic.html munderover-accentunder-dynamic-ref.html
 == columnlines-1a.html columnlines-1-ref.html
 != columnlines-1b.html columnlines-1-ref.html
 != columnlines-1c.html columnlines-1-ref.html
 == columnlines-2a.html columnlines-2-ref.html
 == columnlines-2b.html columnlines-2-ref.html
 != columnlines-3-1.html columnlines-3-1-ref.html
 == columnlines-3-2.html columnlines-3-2-ref.html
 == rowlines-1a.html rowlines-1-ref.html
@@ -268,20 +268,20 @@ random-if(B2G&&browserIsRemote) == munde
 != rowlines-1c.html rowlines-1-ref.html
 == rowlines-2a.html rowlines-2-ref.html
 == rowlines-2b.html rowlines-2-ref.html
 != rowlines-3-1.html rowlines-3-1-ref.html
 == rowlines-3-2.html rowlines-3-2-ref.html
 == tablespacing-1.html tablespacing-1-ref.html
 == tablespacing-2.html tablespacing-2-ref.html
 == tablespacing-3.html tablespacing-3-ref.html
-fails-if(B2G&&browserIsRemote) == tablespacing-4.html tablespacing-4-ref.html
-fails-if(B2G&&browserIsRemote) == tablespacing-5.html tablespacing-5-ref.html
-fails-if(B2G&&browserIsRemote) == tablespacing-5a.html tablespacing-5a-ref.html
-fails-if(B2G&&browserIsRemote) == tablespacing-6.html tablespacing-6-ref.html
+== tablespacing-4.html tablespacing-4-ref.html
+== tablespacing-5.html tablespacing-5-ref.html
+== tablespacing-5a.html tablespacing-5a-ref.html
+== tablespacing-6.html tablespacing-6-ref.html
 == tablespacing-7.html tablespacing-7-ref.html
 != tablespacing-8a.html tablespacing-8-ref.html
 != tablespacing-8b.html tablespacing-8-ref.html
 != op-dict-1.html op-dict-1-ref.html
 == op-dict-2.html op-dict-2-ref.html
 != op-dict-3.html op-dict-3-ref.html
 == op-dict-4.html op-dict-4-ref.html
 != op-dict-5.html op-dict-5-ref.html
@@ -296,24 +296,24 @@ fails-if(B2G&&browserIsRemote) == tables
 == mfrac-A-1.html mfrac-A-1-ref.html
 == mfrac-A-2.html mfrac-A-2-ref.html
 == mfrac-A-3.html mfrac-A-3-ref.html
 == mfrac-A-4.html mfrac-A-4-ref.html
 == mfrac-A-5.html mfrac-A-5-ref.html
 == mfrac-A-6.html mfrac-A-6-ref.html
 == mfrac-A-7.html mfrac-A-7-ref.html
 == mfrac-A-8.html mfrac-A-8-ref.html
-random-if(B2G&&browserIsRemote) == mfrac-B-1.html mfrac-B-1-ref.html
-random-if(B2G&&browserIsRemote) == mfrac-B-2.html mfrac-B-2-3-ref.html
-random-if(B2G&&browserIsRemote) == mfrac-B-3.html mfrac-B-2-3-ref.html
-random-if(B2G&&browserIsRemote) == mfrac-B-4.html mfrac-B-4-5-ref.html
-random-if(B2G&&browserIsRemote) == mfrac-B-5.html mfrac-B-4-5-ref.html
-random-if(B2G&&browserIsRemote) == mfrac-B-6.html mfrac-B-6-7-ref.html
-random-if(B2G&&browserIsRemote) == mfrac-B-7.html mfrac-B-6-7-ref.html
-fuzzy-if(OSX,1,100) random-if(B2G&&browserIsRemote) == mfrac-C-1.html mfrac-C-1-ref.html
-random-if(B2G&&browserIsRemote) == mfrac-C-2.html mfrac-C-2-ref.html
-random-if(B2G&&browserIsRemote) == mfrac-C-3.html mfrac-C-3-ref.html
-random-if(B2G&&browserIsRemote) == mfrac-C-4.html mfrac-C-4-ref.html
-fuzzy-if(OSX,1,100) random-if(B2G&&browserIsRemote) == mfrac-D-1.html mfrac-D-1-ref.html
-random-if(B2G&&browserIsRemote) == mfrac-D-2.html mfrac-D-2-ref.html
-random-if(B2G&&browserIsRemote) == mfrac-D-3.html mfrac-D-3-ref.html
-random-if(B2G&&browserIsRemote) == mfrac-D-4.html mfrac-D-4-ref.html
-random-if(B2G&&browserIsRemote) == mfrac-E-1.html mfrac-E-1-ref.html
+== mfrac-B-1.html mfrac-B-1-ref.html
+== mfrac-B-2.html mfrac-B-2-3-ref.html
+== mfrac-B-3.html mfrac-B-2-3-ref.html
+== mfrac-B-4.html mfrac-B-4-5-ref.html
+== mfrac-B-5.html mfrac-B-4-5-ref.html
+== mfrac-B-6.html mfrac-B-6-7-ref.html
+== mfrac-B-7.html mfrac-B-6-7-ref.html
+fuzzy-if(OSX,1,100) == mfrac-C-1.html mfrac-C-1-ref.html
+== mfrac-C-2.html mfrac-C-2-ref.html
+== mfrac-C-3.html mfrac-C-3-ref.html
+== mfrac-C-4.html mfrac-C-4-ref.html
+fuzzy-if(OSX,1,100) == mfrac-D-1.html mfrac-D-1-ref.html
+== mfrac-D-2.html mfrac-D-2-ref.html
+== mfrac-D-3.html mfrac-D-3-ref.html
+== mfrac-D-4.html mfrac-D-4-ref.html
+== mfrac-E-1.html mfrac-E-1-ref.html
--- a/layout/reftests/object/reftest.list
+++ b/layout/reftests/object/reftest.list
@@ -49,9 +49,9 @@ fails == svg-with-type.html svg-with-typ
 #
 # XXX missing test 033 from http://biesi.damowmow.com/object/ here; not sure
 #     how nullplugin testing should work
 #
 #
 # XXX missing test 034 from http://biesi.damowmow.com/object/ here; would
 #     need to require Flash on the test machine to run them
 #
-random-if(B2G&&browserIsRemote) == malformed-uri.html malformed-uri-ref.html
+== malformed-uri.html malformed-uri-ref.html
--- a/layout/reftests/position-dynamic-changes/horizontal/reftest_border_abspos.list
+++ b/layout/reftests/position-dynamic-changes/horizontal/reftest_border_abspos.list
@@ -1,17 +1,17 @@
 # Please see the comment at the beginning of reftest.list
-random-if(B2G&&browserIsRemote) == leftN-widthA-rightA.html?border_abspos leftN-widthA-rightA-ref.html?border_abspos
-random-if(B2G&&browserIsRemote) == leftN-widthA-rightA-2.html?border_abspos leftN-widthA-rightA-2-ref.html?border_abspos
-random-if(B2G&&browserIsRemote) == leftN-widthA-rightN.html?border_abspos leftN-widthA-rightN-ref.html?border_abspos
-random-if(B2G&&browserIsRemote) == leftN-widthA-rightN-2.html?border_abspos leftN-widthA-rightN-2-ref.html?border_abspos
-random-if(B2G&&browserIsRemote) == leftA-widthN-rightA.html?border_abspos leftA-widthN-rightA-ref.html?border_abspos
-random-if(B2G&&browserIsRemote) == leftN-widthN-rightA.html?border_abspos leftN-widthN-rightA-ref.html?border_abspos
-random-if(B2G&&browserIsRemote) == leftA-widthN-rightN.html?border_abspos leftA-widthN-rightN-ref.html?border_abspos
-random-if(B2G&&browserIsRemote) == leftA-widthA-rightN.html?border_abspos leftA-widthA-rightN-ref.html?border_abspos
+== leftN-widthA-rightA.html?border_abspos leftN-widthA-rightA-ref.html?border_abspos
+== leftN-widthA-rightA-2.html?border_abspos leftN-widthA-rightA-2-ref.html?border_abspos
+== leftN-widthA-rightN.html?border_abspos leftN-widthA-rightN-ref.html?border_abspos
+== leftN-widthA-rightN-2.html?border_abspos leftN-widthA-rightN-2-ref.html?border_abspos
+== leftA-widthN-rightA.html?border_abspos leftA-widthN-rightA-ref.html?border_abspos
+== leftN-widthN-rightA.html?border_abspos leftN-widthN-rightA-ref.html?border_abspos
+== leftA-widthN-rightN.html?border_abspos leftA-widthN-rightN-ref.html?border_abspos
+== leftA-widthA-rightN.html?border_abspos leftA-widthA-rightN-ref.html?border_abspos
 == toauto-leftN-widthA-rightA.html?border_abspos toauto-leftN-widthA-rightA-ref.html?border_abspos
 == toauto-leftN-widthA-rightA-2.html?border_abspos toauto-leftN-widthA-rightA-2-ref.html?border_abspos
 == toauto-leftN-widthA-rightN.html?border_abspos toauto-leftN-widthA-rightN-ref.html?border_abspos
 == toauto-leftN-widthA-rightN-2.html?border_abspos toauto-leftN-widthA-rightN-2-ref.html?border_abspos
 == toauto-leftA-widthN-rightA.html?border_abspos toauto-leftA-widthN-rightA-ref.html?border_abspos
 == toauto-leftN-widthN-rightA.html?border_abspos toauto-leftN-widthN-rightA-ref.html?border_abspos
 == toauto-leftA-widthN-rightN.html?border_abspos toauto-leftA-widthN-rightN-ref.html?border_abspos
 == toauto-leftA-widthA-rightN.html?border_abspos toauto-leftA-widthA-rightN-ref.html?border_abspos
--- a/layout/reftests/position-dynamic-changes/horizontal/reftest_border_parent.list
+++ b/layout/reftests/position-dynamic-changes/horizontal/reftest_border_parent.list
@@ -1,18 +1,18 @@
 # Please see the comment at the beginning of reftest.list
 
-random-if(B2G&&browserIsRemote) == leftN-widthA-rightA.html?border_parent leftN-widthA-rightA-ref.html?border_parent
-random-if(B2G&&browserIsRemote) == leftN-widthA-rightA-2.html?border_parent leftN-widthA-rightA-2-ref.html?border_parent
-random-if(B2G&&browserIsRemote) == leftN-widthA-rightN.html?border_parent leftN-widthA-rightN-ref.html?border_parent
-random-if(B2G&&browserIsRemote) == leftN-widthA-rightN-2.html?border_parent leftN-widthA-rightN-2-ref.html?border_parent
-random-if(B2G&&browserIsRemote) == leftA-widthN-rightA.html?border_parent leftA-widthN-rightA-ref.html?border_parent
-random-if(B2G&&browserIsRemote) == leftN-widthN-rightA.html?border_parent leftN-widthN-rightA-ref.html?border_parent
-random-if(B2G&&browserIsRemote) == leftA-widthN-rightN.html?border_parent leftA-widthN-rightN-ref.html?border_parent
-random-if(B2G&&browserIsRemote) == leftA-widthA-rightN.html?border_parent leftA-widthA-rightN-ref.html?border_parent
+== leftN-widthA-rightA.html?border_parent leftN-widthA-rightA-ref.html?border_parent
+== leftN-widthA-rightA-2.html?border_parent leftN-widthA-rightA-2-ref.html?border_parent
+== leftN-widthA-rightN.html?border_parent leftN-widthA-rightN-ref.html?border_parent
+== leftN-widthA-rightN-2.html?border_parent leftN-widthA-rightN-2-ref.html?border_parent
+== leftA-widthN-rightA.html?border_parent leftA-widthN-rightA-ref.html?border_parent
+== leftN-widthN-rightA.html?border_parent leftN-widthN-rightA-ref.html?border_parent
+== leftA-widthN-rightN.html?border_parent leftA-widthN-rightN-ref.html?border_parent
+== leftA-widthA-rightN.html?border_parent leftA-widthA-rightN-ref.html?border_parent
 == toauto-leftN-widthA-rightA.html?border_parent toauto-leftN-widthA-rightA-ref.html?border_parent
 == toauto-leftN-widthA-rightA-2.html?border_parent toauto-leftN-widthA-rightA-2-ref.html?border_parent
 == toauto-leftN-widthA-rightN.html?border_parent toauto-leftN-widthA-rightN-ref.html?border_parent
 == toauto-leftN-widthA-rightN-2.html?border_parent toauto-leftN-widthA-rightN-2-ref.html?border_parent
 == toauto-leftA-widthN-rightA.html?border_parent toauto-leftA-widthN-rightA-ref.html?border_parent
 == toauto-leftN-widthN-rightA.html?border_parent toauto-leftN-widthN-rightA-ref.html?border_parent
 == toauto-leftA-widthN-rightN.html?border_parent toauto-leftA-widthN-rightN-ref.html?border_parent
 == toauto-leftA-widthA-rightN.html?border_parent toauto-leftA-widthA-rightN-ref.html?border_parent
--- a/layout/reftests/position-dynamic-changes/horizontal/reftest_margin_abspos.list
+++ b/layout/reftests/position-dynamic-changes/horizontal/reftest_margin_abspos.list
@@ -1,18 +1,18 @@
 # Please see the comment at the beginning of reftest.list
 
-random-if(B2G&&browserIsRemote) == leftN-widthA-rightA.html?margin_abspos leftN-widthA-rightA-ref.html?margin_abspos
-random-if(B2G&&browserIsRemote) == leftN-widthA-rightA-2.html?margin_abspos leftN-widthA-rightA-2-ref.html?margin_abspos
-random-if(B2G&&browserIsRemote) == leftN-widthA-rightN.html?margin_abspos leftN-widthA-rightN-ref.html?margin_abspos
-random-if(B2G&&browserIsRemote) == leftN-widthA-rightN-2.html?margin_abspos leftN-widthA-rightN-2-ref.html?margin_abspos
-random-if(B2G&&browserIsRemote) == leftA-widthN-rightA.html?margin_abspos leftA-widthN-rightA-ref.html?margin_abspos
-random-if(B2G&&browserIsRemote) == leftN-widthN-rightA.html?margin_abspos leftN-widthN-rightA-ref.html?margin_abspos
-random-if(B2G&&browserIsRemote) == leftA-widthN-rightN.html?margin_abspos leftA-widthN-rightN-ref.html?margin_abspos
-random-if(B2G&&browserIsRemote) == leftA-widthA-rightN.html?margin_abspos leftA-widthA-rightN-ref.html?margin_abspos
+== leftN-widthA-rightA.html?margin_abspos leftN-widthA-rightA-ref.html?margin_abspos
+== leftN-widthA-rightA-2.html?margin_abspos leftN-widthA-rightA-2-ref.html?margin_abspos
+== leftN-widthA-rightN.html?margin_abspos leftN-widthA-rightN-ref.html?margin_abspos
+== leftN-widthA-rightN-2.html?margin_abspos leftN-widthA-rightN-2-ref.html?margin_abspos
+== leftA-widthN-rightA.html?margin_abspos leftA-widthN-rightA-ref.html?margin_abspos
+== leftN-widthN-rightA.html?margin_abspos leftN-widthN-rightA-ref.html?margin_abspos
+== leftA-widthN-rightN.html?margin_abspos leftA-widthN-rightN-ref.html?margin_abspos
+== leftA-widthA-rightN.html?margin_abspos leftA-widthA-rightN-ref.html?margin_abspos
 == toauto-leftN-widthA-rightA.html?margin_abspos toauto-leftN-widthA-rightA-ref.html?margin_abspos
 == toauto-leftN-widthA-rightA-2.html?margin_abspos toauto-leftN-widthA-rightA-2-ref.html?margin_abspos
 == toauto-leftN-widthA-rightN.html?margin_abspos toauto-leftN-widthA-rightN-ref.html?margin_abspos
 == toauto-leftN-widthA-rightN-2.html?margin_abspos toauto-leftN-widthA-rightN-2-ref.html?margin_abspos
 == toauto-leftA-widthN-rightA.html?margin_abspos toauto-leftA-widthN-rightA-ref.html?margin_abspos
 == toauto-leftN-widthN-rightA.html?margin_abspos toauto-leftN-widthN-rightA-ref.html?margin_abspos
 == toauto-leftA-widthN-rightN.html?margin_abspos toauto-leftA-widthN-rightN-ref.html?margin_abspos
 == toauto-leftA-widthA-rightN.html?margin_abspos toauto-leftA-widthA-rightN-ref.html?margin_abspos
--- a/layout/reftests/position-dynamic-changes/horizontal/reftest_margin_parent.list
+++ b/layout/reftests/position-dynamic-changes/horizontal/reftest_margin_parent.list
@@ -1,18 +1,18 @@
 # Please see the comment at the beginning of reftest.list
 
-random-if(B2G&&browserIsRemote) == leftN-widthA-rightA.html?margin_parent leftN-widthA-rightA-ref.html?margin_parent
-random-if(B2G&&browserIsRemote) == leftN-widthA-rightA-2.html?margin_parent leftN-widthA-rightA-2-ref.html?margin_parent
-random-if(B2G&&browserIsRemote) == leftN-widthA-rightN.html?margin_parent leftN-widthA-rightN-ref.html?margin_parent
-random-if(B2G&&browserIsRemote) == leftN-widthA-rightN-2.html?margin_parent leftN-widthA-rightN-2-ref.html?margin_parent
-random-if(B2G&&browserIsRemote) == leftA-widthN-rightA.html?margin_parent leftA-widthN-rightA-ref.html?margin_parent
-random-if(B2G&&browserIsRemote) == leftN-widthN-rightA.html?margin_parent leftN-widthN-rightA-ref.html?margin_parent
-random-if(B2G&&browserIsRemote) == leftA-widthN-rightN.html?margin_parent leftA-widthN-rightN-ref.html?margin_parent
-random-if(B2G&&browserIsRemote) == leftA-widthA-rightN.html?margin_parent leftA-widthA-rightN-ref.html?margin_parent
+== leftN-widthA-rightA.html?margin_parent leftN-widthA-rightA-ref.html?margin_parent
+== leftN-widthA-rightA-2.html?margin_parent leftN-widthA-rightA-2-ref.html?margin_parent
+== leftN-widthA-rightN.html?margin_parent leftN-widthA-rightN-ref.html?margin_parent
+== leftN-widthA-rightN-2.html?margin_parent leftN-widthA-rightN-2-ref.html?margin_parent
+== leftA-widthN-rightA.html?margin_parent leftA-widthN-rightA-ref.html?margin_parent
+== leftN-widthN-rightA.html?margin_parent leftN-widthN-rightA-ref.html?margin_parent
+== leftA-widthN-rightN.html?margin_parent leftA-widthN-rightN-ref.html?margin_parent
+== leftA-widthA-rightN.html?margin_parent leftA-widthA-rightN-ref.html?margin_parent
 == toauto-leftN-widthA-rightA.html?margin_parent toauto-leftN-widthA-rightA-ref.html?margin_parent
 == toauto-leftN-widthA-rightA-2.html?margin_parent toauto-leftN-widthA-rightA-2-ref.html?margin_parent
 == toauto-leftN-widthA-rightN.html?margin_parent toauto-leftN-widthA-rightN-ref.html?margin_parent
 == toauto-leftN-widthA-rightN-2.html?margin_parent toauto-leftN-widthA-rightN-2-ref.html?margin_parent
 == toauto-leftA-widthN-rightA.html?margin_parent toauto-leftA-widthN-rightA-ref.html?margin_parent
 == toauto-leftN-widthN-rightA.html?margin_parent toauto-leftN-widthN-rightA-ref.html?margin_parent
 == toauto-leftA-widthN-rightN.html?margin_parent toauto-leftA-widthN-rightN-ref.html?margin_parent
 == toauto-leftA-widthA-rightN.html?margin_parent toauto-leftA-widthA-rightN-ref.html?margin_parent
--- a/layout/reftests/position-dynamic-changes/horizontal/reftest_padding_abspos.list
+++ b/layout/reftests/position-dynamic-changes/horizontal/reftest_padding_abspos.list
@@ -1,18 +1,18 @@
 # Please see the comment at the beginning of reftest.list
 
-random-if(B2G&&browserIsRemote) == leftN-widthA-rightA.html?padding_abspos leftN-widthA-rightA-ref.html?padding_abspos
-random-if(B2G&&browserIsRemote) == leftN-widthA-rightA-2.html?padding_abspos leftN-widthA-rightA-2-ref.html?padding_abspos
-random-if(B2G&&browserIsRemote) == leftN-widthA-rightN.html?padding_abspos leftN-widthA-rightN-ref.html?padding_abspos
-random-if(B2G&&browserIsRemote) == leftN-widthA-rightN-2.html?padding_abspos leftN-widthA-rightN-2-ref.html?padding_abspos
-random-if(B2G&&browserIsRemote) == leftA-widthN-rightA.html?padding_abspos leftA-widthN-rightA-ref.html?padding_abspos
-random-if(B2G&&browserIsRemote) == leftN-widthN-rightA.html?padding_abspos leftN-widthN-rightA-ref.html?padding_abspos
-random-if(B2G&&browserIsRemote) == leftA-widthN-rightN.html?padding_abspos leftA-widthN-rightN-ref.html?padding_abspos
-random-if(B2G&&browserIsRemote) == leftA-widthA-rightN.html?padding_abspos leftA-widthA-rightN-ref.html?padding_abspos
+== leftN-widthA-rightA.html?padding_abspos leftN-widthA-rightA-ref.html?padding_abspos
+== leftN-widthA-rightA-2.html?padding_abspos leftN-widthA-rightA-2-ref.html?padding_abspos
+== leftN-widthA-rightN.html?padding_abspos leftN-widthA-rightN-ref.html?padding_abspos
+== leftN-widthA-rightN-2.html?padding_abspos leftN-widthA-rightN-2-ref.html?padding_abspos
+== leftA-widthN-rightA.html?padding_abspos leftA-widthN-rightA-ref.html?padding_abspos
+== leftN-widthN-rightA.html?padding_abspos leftN-widthN-rightA-ref.html?padding_abspos
+== leftA-widthN-rightN.html?padding_abspos leftA-widthN-rightN-ref.html?padding_abspos
+== leftA-widthA-rightN.html?padding_abspos leftA-widthA-rightN-ref.html?padding_abspos
 == toauto-leftN-widthA-rightA.html?padding_abspos toauto-leftN-widthA-rightA-ref.html?padding_abspos
 == toauto-leftN-widthA-rightA-2.html?padding_abspos toauto-leftN-widthA-rightA-2-ref.html?padding_abspos
 == toauto-leftN-widthA-rightN.html?padding_abspos toauto-leftN-widthA-rightN-ref.html?padding_abspos
 == toauto-leftN-widthA-rightN-2.html?padding_abspos toauto-leftN-widthA-rightN-2-ref.html?padding_abspos
 == toauto-leftA-widthN-rightA.html?padding_abspos toauto-leftA-widthN-rightA-ref.html?padding_abspos
 == toauto-leftN-widthN-rightA.html?padding_abspos toauto-leftN-widthN-rightA-ref.html?padding_abspos
 == toauto-leftA-widthN-rightN.html?padding_abspos toauto-leftA-widthN-rightN-ref.html?padding_abspos
 == toauto-leftA-widthA-rightN.html?padding_abspos toauto-leftA-widthA-rightN-ref.html?padding_abspos
--- a/layout/reftests/position-dynamic-changes/horizontal/reftest_padding_parent.list
+++ b/layout/reftests/position-dynamic-changes/horizontal/reftest_padding_parent.list
@@ -1,18 +1,18 @@
 # Please see the comment at the beginning of reftest.list
 
-random-if(B2G&&browserIsRemote) == leftN-widthA-rightA.html?padding_parent leftN-widthA-rightA-ref.html?padding_parent
-random-if(B2G&&browserIsRemote) == leftN-widthA-rightA-2.html?padding_parent leftN-widthA-rightA-2-ref.html?padding_parent
-random-if(B2G&&browserIsRemote) == leftN-widthA-rightN.html?padding_parent leftN-widthA-rightN-ref.html?padding_parent
-random-if(B2G&&browserIsRemote) == leftN-widthA-rightN-2.html?padding_parent leftN-widthA-rightN-2-ref.html?padding_parent
-random-if(B2G&&browserIsRemote) == leftA-widthN-rightA.html?padding_parent leftA-widthN-rightA-ref.html?padding_parent
-random-if(B2G&&browserIsRemote) == leftN-widthN-rightA.html?padding_parent leftN-widthN-rightA-ref.html?padding_parent
-random-if(B2G&&browserIsRemote) == leftA-widthN-rightN.html?padding_parent leftA-widthN-rightN-ref.html?padding_parent
-random-if(B2G&&browserIsRemote) == leftA-widthA-rightN.html?padding_parent leftA-widthA-rightN-ref.html?padding_parent
+== leftN-widthA-rightA.html?padding_parent leftN-widthA-rightA-ref.html?padding_parent
+== leftN-widthA-rightA-2.html?padding_parent leftN-widthA-rightA-2-ref.html?padding_parent
+== leftN-widthA-rightN.html?padding_parent leftN-widthA-rightN-ref.html?padding_parent
+== leftN-widthA-rightN-2.html?padding_parent leftN-widthA-rightN-2-ref.html?padding_parent
+== leftA-widthN-rightA.html?padding_parent leftA-widthN-rightA-ref.html?padding_parent
+== leftN-widthN-rightA.html?padding_parent leftN-widthN-rightA-ref.html?padding_parent
+== leftA-widthN-rightN.html?padding_parent leftA-widthN-rightN-ref.html?padding_parent
+== leftA-widthA-rightN.html?padding_parent leftA-widthA-rightN-ref.html?padding_parent
 == toauto-leftN-widthA-rightA.html?padding_parent toauto-leftN-widthA-rightA-ref.html?padding_parent
 == toauto-leftN-widthA-rightA-2.html?padding_parent toauto-leftN-widthA-rightA-2-ref.html?padding_parent
 == toauto-leftN-widthA-rightN.html?padding_parent toauto-leftN-widthA-rightN-ref.html?padding_parent
 == toauto-leftN-widthA-rightN-2.html?padding_parent toauto-leftN-widthA-rightN-2-ref.html?padding_parent
 == toauto-leftA-widthN-rightA.html?padding_parent toauto-leftA-widthN-rightA-ref.html?padding_parent
 == toauto-leftN-widthN-rightA.html?padding_parent toauto-leftN-widthN-rightA-ref.html?padding_parent
 == toauto-leftA-widthN-rightN.html?padding_parent toauto-leftA-widthN-rightN-ref.html?padding_parent
 == toauto-leftA-widthA-rightN.html?padding_parent toauto-leftA-widthA-rightN-ref.html?padding_parent
--- a/layout/reftests/position-dynamic-changes/horizontal/reftest_plain.list
+++ b/layout/reftests/position-dynamic-changes/horizontal/reftest_plain.list
@@ -1,18 +1,18 @@
 # Please see the comment at the beginning of reftest.list
 
-random-if(B2G&&browserIsRemote) == leftN-widthA-rightA.html leftN-widthA-rightA-ref.html
-random-if(B2G&&browserIsRemote) == leftN-widthA-rightA-2.html leftN-widthA-rightA-2-ref.html
-random-if(B2G&&browserIsRemote) == leftN-widthA-rightN.html leftN-widthA-rightN-ref.html
-random-if(B2G&&browserIsRemote) == leftN-widthA-rightN-2.html leftN-widthA-rightN-2-ref.html
-random-if(B2G&&browserIsRemote) == leftA-widthN-rightA.html leftA-widthN-rightA-ref.html
-random-if(B2G&&browserIsRemote) == leftN-widthN-rightA.html leftN-widthN-rightA-ref.html
-random-if(B2G&&browserIsRemote) == leftA-widthN-rightN.html leftA-widthN-rightN-ref.html
-random-if(B2G&&browserIsRemote) == leftA-widthA-rightN.html leftA-widthA-rightN-ref.html
+== leftN-widthA-rightA.html leftN-widthA-rightA-ref.html
+== leftN-widthA-rightA-2.html leftN-widthA-rightA-2-ref.html
+== leftN-widthA-rightN.html leftN-widthA-rightN-ref.html
+== leftN-widthA-rightN-2.html leftN-widthA-rightN-2-ref.html
+== leftA-widthN-rightA.html leftA-widthN-rightA-ref.html
+== leftN-widthN-rightA.html leftN-widthN-rightA-ref.html
+== leftA-widthN-rightN.html leftA-widthN-rightN-ref.html
+== leftA-widthA-rightN.html leftA-widthA-rightN-ref.html
 == toauto-leftN-widthA-rightA.html toauto-leftN-widthA-rightA-ref.html
 == toauto-leftN-widthA-rightA-2.html toauto-leftN-widthA-rightA-2-ref.html
 == toauto-leftN-widthA-rightN.html toauto-leftN-widthA-rightN-ref.html
 == toauto-leftN-widthA-rightN-2.html toauto-leftN-widthA-rightN-2-ref.html
 == toauto-leftA-widthN-rightA.html toauto-leftA-widthN-rightA-ref.html
 == toauto-leftN-widthN-rightA.html toauto-leftN-widthN-rightA-ref.html
 == toauto-leftA-widthN-rightN.html toauto-leftA-widthN-rightN-ref.html
 == toauto-leftA-widthA-rightN.html toauto-leftA-widthA-rightN-ref.html
--- a/layout/reftests/position-dynamic-changes/reftest.list
+++ b/layout/reftests/position-dynamic-changes/reftest.list
@@ -1,10 +1,10 @@
 include horizontal/reftest.list
-skip-if(B2G&&browserIsRemote) include vertical/reftest.list
-skip-if(B2G&&browserIsRemote) include mixed/reftest.list
-skip-if(B2G&&browserIsRemote) include mixed-abspos-root/reftest.list
-skip-if(B2G&&browserIsRemote) include relative/reftest.list
+include vertical/reftest.list
+include mixed/reftest.list
+include mixed-abspos-root/reftest.list
+include relative/reftest.list
 
-random-if(B2G&&browserIsRemote) == multiple-changes.html multiple-changes-ref.html
-random-if(B2G&&browserIsRemote) == shrink-wrap.html shrink-wrap-ref.html
-random-if(B2G&&browserIsRemote) == max-width.html max-width-ref.html
-fuzzy-if(cocoaWidget&&layersGPUAccelerated,1,2) random-if(B2G&&browserIsRemote) == min-width.html min-width-ref.html # Bug 761770
+== multiple-changes.html multiple-changes-ref.html
+== shrink-wrap.html shrink-wrap-ref.html
+== max-width.html max-width-ref.html
+fuzzy-if(cocoaWidget&&layersGPUAccelerated,1,2) == min-width.html min-width-ref.html # Bug 761770
--- a/layout/reftests/position-sticky/reftest.list
+++ b/layout/reftests/position-sticky/reftest.list
@@ -37,17 +37,17 @@ fuzzy-if(Android,2,3) == stacking-contex
 == left-right-1.html left-right-1-ref.html
 == left-right-2.html left-right-2-ref.html
 == left-right-3.html left-right-3-ref.html
 fuzzy-if(Android,4,810) == containing-block-1.html containing-block-1-ref.html
 == overconstrained-1.html overconstrained-1-ref.html
 == overconstrained-2.html overconstrained-2-ref.html
 == overconstrained-3.html overconstrained-3-ref.html
 == inline-1.html inline-1-ref.html
-random-if(B2G&&browserIsRemote) == inline-2.html inline-2-ref.html
+== inline-2.html inline-2-ref.html
 fuzzy-if(OSX==10.6||OSX==10.7,64,100) fuzzy-if(OSX==10.8,99,210) == inline-3.html inline-3-ref.html
 fails == column-contain-1a.html column-contain-1-ref.html
 == column-contain-1b.html column-contain-1-ref.html
 == column-contain-2.html column-contain-2-ref.html
 == block-in-inline-1.html block-in-inline-1-ref.html
 fuzzy-if(Android,8,1533) skip-if(B2G&&browserIsRemote) == block-in-inline-2.html block-in-inline-2-ref.html
 fuzzy-if(Android,8,630) fuzzy-if(OSX==10.8,1,11) skip-if(B2G&&browserIsRemote) == block-in-inline-3.html block-in-inline-3-ref.html
 == block-in-inline-continuations.html block-in-inline-continuations-ref.html
--- a/layout/reftests/printing/reftest.list
+++ b/layout/reftests/printing/reftest.list
@@ -15,19 +15,19 @@ fails-if(B2G) == 609227-2b.html 609227-2
 == 577450-1.html 577450-1-ref.html
 == 626395-1a.html 626395-1-ref.html
 == 626395-1b.html 626395-1-ref.html
 == 626395-2a.html 626395-2-ref.html
 == 626395-2b.html 626395-2-ref.html
 == 626395-2c.html 626395-2-ref.html
 == 626395-2d.html 626395-2-ref.html
 == 652178-1.html 652178-1-ref.html
-random-if(B2G&&browserIsRemote) == 115199-1.html 115199-1-ref.html # reftest-print doesn't work on B2G
-random-if(B2G&&browserIsRemote) == 115199-2a.html 115199-2-ref.html
-random-if(B2G&&browserIsRemote) == 115199-2b.html 115199-2-ref.html
+fails-if(B2G) == 115199-1.html 115199-1-ref.html # reftest-print doesn't work on B2G
+== 115199-2a.html 115199-2-ref.html
+== 115199-2b.html 115199-2-ref.html
 == 652178-1.html 652178-1-ref2.html
 skip-if(B2G) fuzzy-if(cocoaWidget,1,5000) == 745025-1.html 745025-1-ref.html # reftest-print doesn't work on B2G
 == 820496-1.html 820496-1-ref.html
 
 # NOTE: These tests don't yet rigorously test what they're
 # trying to test (shrink-to-fit behavior), due to bug 967311.
 random-if(B2G&&browserIsRemote) == 960822.html 960822-ref.html # reftest-print doesn't work on B2G (scrollbar difference only)
 == 966419-1.html 966419-1-ref.html
--- a/layout/reftests/reftest.list
+++ b/layout/reftests/reftest.list
@@ -262,21 +262,21 @@ include position-dynamic-changes/reftest
 
 # printing
 include printing/reftest.list
 include pagination/reftest.list
 
 # <style scoped>
 include scoped-style/reftest.list
 
-# scrolling 
+# scrolling
 include scrolling/reftest.list
 
 # selection
-skip-if(B2G&&browserIsRemote) include selection/reftest.list
+include selection/reftest.list
 
 # sticky positioning
 include position-sticky/reftest.list
 
 # svg/
 include svg/reftest.list
 
 # tab-size/
--- a/layout/reftests/scrolling/reftest.list
+++ b/layout/reftests/scrolling/reftest.list
@@ -1,24 +1,24 @@
 skip-if(B2G&&browserIsRemote) HTTP == deferred-anchor.xhtml#d deferred-anchor-ref.xhtml#d
 HTTP == fixed-1.html fixed-1.html?ref
 HTTP == fixed-opacity-1.html fixed-opacity-1.html?ref
 skip-if(B2G) HTTP == fixed-opacity-2.html fixed-opacity-2.html?ref
 skip-if(B2G) random-if(gtk2Widget) fuzzy-if(Android,3,60) HTTP == fixed-text-1.html fixed-text-1.html?ref
 HTTP == fixed-text-2.html fixed-text-2.html?ref
 random-if(Android&&!browserIsRemote) skip-if(B2G&&browserIsRemote) == iframe-border-radius.html iframe-border-radius-ref.html # bug 760269
-random-if(Android||(B2G&&browserIsRemote)) HTTP == image-1.html image-1.html?ref
-random-if((Android&&!browserIsRemote)||(B2G&&browserIsRemote)) HTTP == opacity-mixed-scrolling-1.html opacity-mixed-scrolling-1.html?ref # bug 760269
+random-if(Android) HTTP == image-1.html image-1.html?ref
+random-if(Android&&!browserIsRemote) HTTP == opacity-mixed-scrolling-1.html opacity-mixed-scrolling-1.html?ref # bug 760269
 skip-if(B2G) random-if(cocoaWidget) HTTP == opacity-mixed-scrolling-2.html opacity-mixed-scrolling-2.html?ref # see bug 625357
 skip-if(B2G&&browserIsRemote) HTTP == simple-1.html simple-1.html?ref
 skip-if(B2G) HTTP == subpixel-1.html#d subpixel-1-ref.html#d
-fuzzy-if(Android,4,120) random-if(B2G&&browserIsRemote) HTTP == text-1.html text-1.html?ref
-fuzzy-if(Android,4,120) random-if(B2G&&browserIsRemote) HTTP == text-2.html?up text-2.html?ref
+fuzzy-if(Android,4,120) HTTP == text-1.html text-1.html?ref
+fuzzy-if(Android,4,120) HTTP == text-2.html?up text-2.html?ref
 skip-if(B2G) fuzzy-if(Android&&AndroidVersion<15,251,722) HTTP == transformed-1.html transformed-1.html?ref
-random-if(B2G&&browserIsRemote) HTTP == transformed-1.html?up transformed-1.html?ref
+HTTP == transformed-1.html?up transformed-1.html?ref
 fuzzy-if(Android,5,20000) == uncovering-1.html uncovering-1-ref.html
 fuzzy-if(Android,5,20000) == uncovering-2.html uncovering-2-ref.html
 skip-if(B2G) == less-than-scrollbar-height.html less-than-scrollbar-height-ref.html
 skip-if(B2G) == huge-horizontal-overflow.html huge-horizontal-overflow-ref.html
 skip-if(B2G) == huge-vertical-overflow.html huge-vertical-overflow-ref.html
 == iframe-scrolling-attr-1.html iframe-scrolling-attr-ref.html
 skip-if(B2G&&browserIsRemote) == iframe-scrolling-attr-2.html iframe-scrolling-attr-ref.html
 == frame-scrolling-attr-1.html frame-scrolling-attr-ref.html
--- a/layout/reftests/svg/as-image/reftest.list
+++ b/layout/reftests/svg/as-image/reftest.list
@@ -7,20 +7,20 @@ include zoom/reftest.list
 == background-display-none-1.html  about:blank
 skip-if(B2G) == background-simple-1.html  lime100x100-ref.html # bug 773482
 == background-simple-2.html  lime100x100-ref.html
 
 # Sightly trickier background-image test
 == background-viewBox-1.html  lime100x100-ref.html
 
 # background tests with the background area getting resized
-random-if(B2G&&browserIsRemote) == background-resize-1.html  lime100x100-ref.html
-random-if(B2G&&browserIsRemote) == background-resize-2.html  lime100x100-ref.html
-random-if(B2G&&browserIsRemote) == background-resize-3.html  lime100x100-ref.html