Bug 784841 - Part 18k: Convert /dom; f=Ms2ger rs=khuey
authorGregory Szorc <gps@mozilla.com>
Mon, 25 Feb 2013 12:47:20 -0800
changeset 123025 18c0e3805925e3347de14b28c250a89c4ebd81fd
parent 123024 f1c891577cefbeca72e58293a57b6a632daaeb9c
child 123026 f58efdc21e14cc784045fd6d173f746cea0fcc45
push id1390
push userMs2ger@gmail.com
push dateThu, 28 Feb 2013 17:40:16 +0000
treeherderfx-team@c65d59d33aa8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs784841
milestone22.0a1
Bug 784841 - Part 18k: Convert /dom; f=Ms2ger rs=khuey
dom/Makefile.in
dom/activities/Makefile.in
dom/activities/interfaces/moz.build
dom/activities/moz.build
dom/activities/src/moz.build
dom/activities/tests/moz.build
dom/alarm/Makefile.in
dom/alarm/moz.build
dom/alarm/test/Makefile.in
dom/alarm/test/moz.build
dom/apps/Makefile.in
dom/apps/moz.build
dom/apps/src/moz.build
dom/apps/tests/Makefile.in
dom/apps/tests/moz.build
dom/audiochannel/Makefile.in
dom/audiochannel/moz.build
dom/audiochannel/tests/moz.build
dom/base/Makefile.in
dom/base/moz.build
dom/base/test/moz.build
dom/battery/Makefile.in
dom/battery/moz.build
dom/battery/test/Makefile.in
dom/battery/test/moz.build
dom/bindings/moz.build
dom/bindings/test/moz.build
dom/bluetooth/moz.build
dom/browser-element/Makefile.in
dom/browser-element/mochitest/moz.build
dom/browser-element/moz.build
dom/camera/moz.build
dom/cellbroadcast/Makefile.in
dom/cellbroadcast/interfaces/moz.build
dom/cellbroadcast/moz.build
dom/cellbroadcast/src/moz.build
dom/cellbroadcast/tests/Makefile.in
dom/cellbroadcast/tests/moz.build
dom/contacts/Makefile.in
dom/contacts/moz.build
dom/contacts/tests/Makefile.in
dom/contacts/tests/moz.build
dom/devicestorage/Makefile.in
dom/devicestorage/ipc/moz.build
dom/devicestorage/moz.build
dom/devicestorage/test/moz.build
dom/encoding/Makefile.in
dom/encoding/moz.build
dom/encoding/test/Makefile.in
dom/encoding/test/moz.build
dom/encoding/test/unit/moz.build
dom/file/Makefile.in
dom/file/moz.build
dom/file/test/moz.build
dom/fm/moz.build
dom/icc/Makefile.in
dom/icc/interfaces/moz.build
dom/icc/moz.build
dom/icc/src/moz.build
dom/icc/tests/moz.build
dom/identity/Makefile.in
dom/identity/moz.build
dom/identity/tests/moz.build
dom/indexedDB/Makefile.in
dom/indexedDB/ipc/moz.build
dom/indexedDB/moz.build
dom/indexedDB/test/Makefile.in
dom/indexedDB/test/moz.build
dom/indexedDB/test/unit/moz.build
dom/interfaces/apps/moz.build
dom/interfaces/base/moz.build
dom/interfaces/canvas/moz.build
dom/interfaces/contacts/moz.build
dom/interfaces/core/moz.build
dom/interfaces/css/moz.build
dom/interfaces/devicestorage/moz.build
dom/interfaces/events/moz.build
dom/interfaces/geolocation/moz.build
dom/interfaces/html/moz.build
dom/interfaces/json/moz.build
dom/interfaces/load-save/moz.build
dom/interfaces/notification/moz.build
dom/interfaces/offline/moz.build
dom/interfaces/permission/moz.build
dom/interfaces/range/moz.build
dom/interfaces/settings/moz.build
dom/interfaces/sidebar/moz.build
dom/interfaces/smil/moz.build
dom/interfaces/storage/moz.build
dom/interfaces/stylesheets/moz.build
dom/interfaces/svg/moz.build
dom/interfaces/traversal/moz.build
dom/interfaces/xbl/moz.build
dom/interfaces/xpath/moz.build
dom/interfaces/xul/moz.build
dom/ipc/Makefile.in
dom/ipc/moz.build
dom/ipc/tests/moz.build
dom/locales/moz.build
dom/media/Makefile.in
dom/media/bridge/moz.build
dom/media/moz.build
dom/media/tests/mochitest/moz.build
dom/messages/Makefile.in
dom/messages/interfaces/moz.build
dom/messages/moz.build
dom/mms/Makefile.in
dom/mms/interfaces/moz.build
dom/mms/moz.build
dom/mms/src/moz.build
dom/mobilemessage/Makefile.in
dom/mobilemessage/interfaces/moz.build
dom/mobilemessage/moz.build
dom/mobilemessage/src/moz.build
dom/moz.build
dom/network/Makefile.in
dom/network/interfaces/moz.build
dom/network/moz.build
dom/network/src/moz.build
dom/network/tests/Makefile.in
dom/network/tests/moz.build
dom/payment/Makefile.in
dom/payment/interfaces/moz.build
dom/payment/moz.build
dom/permission/Makefile.in
dom/permission/moz.build
dom/permission/tests/Makefile.in
dom/permission/tests/moz.build
dom/phonenumberutils/Makefile.in
dom/phonenumberutils/moz.build
dom/phonenumberutils/tests/Makefile.in
dom/phonenumberutils/tests/moz.build
dom/plugins/base/Makefile.in
dom/plugins/base/android/moz.build
dom/plugins/base/moz.build
dom/plugins/ipc/Makefile.in
dom/plugins/ipc/hangui/moz.build
dom/plugins/ipc/interpose/moz.build
dom/plugins/ipc/moz.build
dom/plugins/test/Makefile.in
dom/plugins/test/mochitest/moz.build
dom/plugins/test/moz.build
dom/plugins/test/testplugin/Makefile.in
dom/plugins/test/testplugin/moz.build
dom/plugins/test/testplugin/secondplugin/moz.build
dom/power/Makefile.in
dom/power/moz.build
dom/power/test/Makefile.in
dom/power/test/moz.build
dom/quota/moz.build
dom/settings/Makefile.in
dom/settings/moz.build
dom/settings/tests/moz.build
dom/sms/Makefile.in
dom/sms/interfaces/moz.build
dom/sms/moz.build
dom/sms/src/moz.build
dom/sms/tests/Makefile.in
dom/sms/tests/moz.build
dom/src/Makefile.in
dom/src/events/moz.build
dom/src/foo/moz.build
dom/src/geolocation/moz.build
dom/src/json/Makefile.in
dom/src/json/moz.build
dom/src/json/test/moz.build
dom/src/jsurl/Makefile.in
dom/src/jsurl/moz.build
dom/src/jsurl/test/moz.build
dom/src/moz.build
dom/src/notification/moz.build
dom/src/offline/moz.build
dom/src/storage/moz.build
dom/system/Makefile.in
dom/system/android/moz.build
dom/system/gonk/moz.build
dom/system/moz.build
dom/system/tests/moz.build
dom/system/unix/moz.build
dom/system/windows/moz.build
dom/telephony/moz.build
dom/tests/Makefile.in
dom/tests/browser/moz.build
dom/tests/mochitest/Makefile.in
dom/tests/mochitest/ajax/Makefile.in
dom/tests/mochitest/ajax/jquery/Makefile.in
dom/tests/mochitest/ajax/jquery/dist/Makefile.in
dom/tests/mochitest/ajax/jquery/dist/moz.build
dom/tests/mochitest/ajax/jquery/moz.build
dom/tests/mochitest/ajax/jquery/test/Makefile.in
dom/tests/mochitest/ajax/jquery/test/data/Makefile.in
dom/tests/mochitest/ajax/jquery/test/data/moz.build
dom/tests/mochitest/ajax/jquery/test/data/offset/Makefile.in
dom/tests/mochitest/ajax/jquery/test/data/offset/moz.build
dom/tests/mochitest/ajax/jquery/test/moz.build
dom/tests/mochitest/ajax/jquery/test/unit/Makefile.in
dom/tests/mochitest/ajax/jquery/test/unit/moz.build
dom/tests/mochitest/ajax/lib/moz.build
dom/tests/mochitest/ajax/mochikit/Makefile.in
dom/tests/mochitest/ajax/mochikit/MochiKit/moz.build
dom/tests/mochitest/ajax/mochikit/moz.build
dom/tests/mochitest/ajax/mochikit/tests/Makefile.in
dom/tests/mochitest/ajax/mochikit/tests/SimpleTest/Makefile.in
dom/tests/mochitest/ajax/mochikit/tests/SimpleTest/moz.build
dom/tests/mochitest/ajax/mochikit/tests/moz.build
dom/tests/mochitest/ajax/moz.build
dom/tests/mochitest/ajax/offline/Makefile.in
dom/tests/mochitest/ajax/offline/moz.build
dom/tests/mochitest/ajax/offline/namespace1/Makefile.in
dom/tests/mochitest/ajax/offline/namespace1/moz.build
dom/tests/mochitest/ajax/offline/namespace1/sub/moz.build
dom/tests/mochitest/ajax/offline/namespace1/sub2/moz.build
dom/tests/mochitest/ajax/offline/namespace2/moz.build
dom/tests/mochitest/ajax/prototype/Makefile.in
dom/tests/mochitest/ajax/prototype/dist/moz.build
dom/tests/mochitest/ajax/prototype/moz.build
dom/tests/mochitest/ajax/prototype/test/Makefile.in
dom/tests/mochitest/ajax/prototype/test/functional/moz.build
dom/tests/mochitest/ajax/prototype/test/lib/moz.build
dom/tests/mochitest/ajax/prototype/test/moz.build
dom/tests/mochitest/ajax/prototype/test/unit/Makefile.in
dom/tests/mochitest/ajax/prototype/test/unit/fixtures/moz.build
dom/tests/mochitest/ajax/prototype/test/unit/moz.build
dom/tests/mochitest/ajax/prototype/test/unit/tmp/moz.build
dom/tests/mochitest/ajax/scriptaculous/Makefile.in
dom/tests/mochitest/ajax/scriptaculous/lib/Makefile.in
dom/tests/mochitest/ajax/scriptaculous/lib/moz.build
dom/tests/mochitest/ajax/scriptaculous/moz.build
dom/tests/mochitest/ajax/scriptaculous/src/Makefile.in
dom/tests/mochitest/ajax/scriptaculous/src/moz.build
dom/tests/mochitest/ajax/scriptaculous/test/unit/Makefile.in
dom/tests/mochitest/ajax/scriptaculous/test/unit/moz.build
dom/tests/mochitest/bugs/moz.build
dom/tests/mochitest/chrome/moz.build
dom/tests/mochitest/crypto/moz.build
dom/tests/mochitest/dom-level0/moz.build
dom/tests/mochitest/dom-level1-core/Makefile.in
dom/tests/mochitest/dom-level1-core/files/moz.build
dom/tests/mochitest/dom-level1-core/moz.build
dom/tests/mochitest/dom-level2-core/Makefile.in
dom/tests/mochitest/dom-level2-core/files/moz.build
dom/tests/mochitest/dom-level2-core/moz.build
dom/tests/mochitest/dom-level2-html/Makefile.in
dom/tests/mochitest/dom-level2-html/files/moz.build
dom/tests/mochitest/dom-level2-html/moz.build
dom/tests/mochitest/general/moz.build
dom/tests/mochitest/geolocation/moz.build
dom/tests/mochitest/localstorage/moz.build
dom/tests/mochitest/moz.build
dom/tests/mochitest/notification/moz.build
dom/tests/mochitest/orientation/moz.build
dom/tests/mochitest/pointerlock/moz.build
dom/tests/mochitest/sessionstorage/moz.build
dom/tests/mochitest/storageevent/moz.build
dom/tests/mochitest/webapps/Makefile.in
dom/tests/mochitest/webapps/apps/moz.build
dom/tests/mochitest/webapps/moz.build
dom/tests/mochitest/whatwg/moz.build
dom/tests/moz.build
dom/time/moz.build
dom/voicemail/moz.build
dom/wifi/moz.build
dom/workers/Makefile.in
dom/workers/moz.build
dom/workers/test/Makefile.in
dom/workers/test/extensions/Makefile.in
dom/workers/test/extensions/bootstrap/moz.build
dom/workers/test/extensions/moz.build
dom/workers/test/extensions/traditional/moz.build
dom/workers/test/moz.build
--- a/dom/Makefile.in
+++ b/dom/Makefile.in
@@ -1,120 +1,14 @@
-#
 # 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/.
 
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= dom
 
-PARALLEL_DIRS = \
-  interfaces/base \
-  interfaces/canvas \
-  interfaces/core \
-  interfaces/html \
-  interfaces/events \
-  interfaces/devicestorage \
-  interfaces/contacts \
-  interfaces/settings \
-  interfaces/stylesheets \
-  interfaces/sidebar \
-  interfaces/css \
-  interfaces/traversal \
-  interfaces/range \
-  interfaces/xbl \
-  interfaces/xpath \
-  interfaces/load-save \
-  interfaces/xul \
-  interfaces/storage \
-  interfaces/json \
-  interfaces/offline \
-  interfaces/geolocation \
-  interfaces/notification \
-  interfaces/permission \
-  interfaces/svg \
-  interfaces/smil \
-  interfaces/apps \
-  $(NULL)
-
-PARALLEL_DIRS += \
-  apps \
-  base \
-  activities \
-  bindings \
-  battery \
-  bluetooth \
-  browser-element \
-  contacts \
-  phonenumberutils \
-  alarm \
-  devicestorage \
-  encoding \
-  file \
-  media \
-  messages \
-  power \
-  quota \
-  settings \
-  mobilemessage \
-  sms \
-  mms \
-  src \
-  time \
-  locales \
-  network \
-  permission \
-  plugins/base \
-  plugins/ipc \
-  indexedDB \
-  system \
-  ipc \
-  identity \
-  workers \
-  camera \
-  audiochannel \
-  $(NULL)
-
-ifeq (WINNT,$(OS_ARCH))
-PARALLEL_DIRS += \
-  plugins/ipc/hangui \
-  $(NULL)
-endif
-
-ifdef MOZ_B2G_RIL
-PARALLEL_DIRS += \
-  telephony \
-  wifi \
-  icc \
-  cellbroadcast \
-  voicemail \
-  $(NULL)
-endif
-
-ifdef MOZ_B2G_FM
-PARALLEL_DIRS += fm
-endif
-
-ifdef MOZ_PAY
-PARALLEL_DIRS += \
-  payment \
-  $(NULL)
-endif
-
-# bindings/test is here, because it needs to build after bindings/, and
-# we build subdirectories before ourselves.
-TEST_DIRS += \
-  tests \
-  imptests \
-  bindings/test \
-  $(NULL)
-
-ifneq (,$(filter gtk2 cocoa windows android qt os2,$(MOZ_WIDGET_TOOLKIT)))
-TEST_DIRS += plugins/test
-endif
-
 include $(topsrcdir)/config/rules.mk
--- a/dom/activities/Makefile.in
+++ b/dom/activities/Makefile.in
@@ -5,13 +5,9 @@
 DEPTH     = @DEPTH@
 topsrcdir = @top_srcdir@
 srcdir    = @srcdir@
 VPATH     = @srcdir@
 relativesrcdir = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-PARALLEL_DIRS = interfaces src
-
-TEST_DIRS += tests
-
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/activities/interfaces/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/activities/moz.build
@@ -0,0 +1,8 @@
+# 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/.
+
+PARALLEL_DIRS += ['interfaces', 'src']
+
+TEST_DIRS += ['tests']
new file mode 100644
--- /dev/null
+++ b/dom/activities/src/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/activities/tests/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/alarm/Makefile.in
+++ b/dom/alarm/Makefile.in
@@ -39,19 +39,15 @@ XPIDLSRCS =               \
 EXPORTS_mozilla/dom/alarm = \
   AlarmHalService.h         \
   $(NULL)
 
 CPPSRCS =             \
   AlarmHalService.cpp \
   $(NULL)
 
-ifdef ENABLE_TESTS
-DIRS += test
-endif
-
 include $(topsrcdir)/config/config.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
 include $(topsrcdir)/config/rules.mk
 
 XPIDL_FLAGS += \
   -I$(topsrcdir)/dom/interfaces/base \
   $(NULL)
new file mode 100644
--- /dev/null
+++ b/dom/alarm/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+TEST_DIRS += ['test']
--- a/dom/alarm/test/Makefile.in
+++ b/dom/alarm/test/Makefile.in
@@ -6,17 +6,14 @@ DEPTH            = @DEPTH@
 topsrcdir        = @top_srcdir@
 srcdir           = @srcdir@
 VPATH            = @srcdir@
 
 relativesrcdir   = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS = \
-  $(NULL)
-
 MOCHITEST_FILES = \
   test_alarm_permitted_app.html \
   test_alarm_non_permitted_app.html \
   $(NULL)
 
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/alarm/test/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/apps/Makefile.in
+++ b/dom/apps/Makefile.in
@@ -5,14 +5,9 @@
 DEPTH            = @DEPTH@
 topsrcdir        = @top_srcdir@
 srcdir           = @srcdir@
 VPATH            = @srcdir@
 
 relativesrcdir   = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
-
-PARALLEL_DIRS = src
-
-TEST_DIRS += tests
-
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/apps/moz.build
@@ -0,0 +1,7 @@
+# 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/.
+
+PARALLEL_DIRS += ['src']
+TEST_DIRS += ['tests']
new file mode 100644
--- /dev/null
+++ b/dom/apps/src/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/apps/tests/Makefile.in
+++ b/dom/apps/tests/Makefile.in
@@ -6,16 +6,13 @@ DEPTH            = @DEPTH@
 topsrcdir        = @top_srcdir@
 srcdir           = @srcdir@
 VPATH            = @srcdir@
 
 relativesrcdir   = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS = \
-  $(NULL)
-
 MOCHITEST_CHROME_FILES = \
   test_apps_service.xul \
   $(NULL)
 
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/apps/tests/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/audiochannel/Makefile.in
+++ b/dom/audiochannel/Makefile.in
@@ -44,16 +44,12 @@ CPPSRCS += \
   AudioChannelAgent.cpp \
   $(NULL)
 
 XPIDLSRCS = \
   nsIAudioChannelAgent.idl \
   $(NULL)
 
 
-ifdef ENABLE_TESTS
-TOOL_DIRS += tests
-endif
-
 include $(topsrcdir)/config/config.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
 include $(topsrcdir)/config/rules.mk
 
new file mode 100644
--- /dev/null
+++ b/dom/audiochannel/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+TEST_TOOL_DIRS += ['tests']
new file mode 100644
--- /dev/null
+++ b/dom/audiochannel/tests/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/base/Makefile.in
+++ b/dom/base/Makefile.in
@@ -1,9 +1,8 @@
-#
 # 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/.
 
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
@@ -13,20 +12,16 @@ include $(DEPTH)/config/autoconf.mk
 MODULE		= dom
 LIBRARY_NAME	= jsdombase_s
 LIBXUL_LIBRARY	= 1
 FORCE_STATIC_LIB = 1
 ifndef _MSC_VER
 FAIL_ON_WARNINGS := 1
 endif # !_MSC_VER
 
-DIRS = \
-  test \
-  $(NULL)
-
 EXTRA_COMPONENTS = \
   SiteSpecificUserAgent.js \
   SiteSpecificUserAgent.manifest \
   ConsoleAPI.js \
   ConsoleAPI.manifest \
   $(NULL)
 
 EXTRA_JS_MODULES = ConsoleAPIStorage.jsm \
new file mode 100644
--- /dev/null
+++ b/dom/base/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+TEST_DIRS += ['test']
new file mode 100644
--- /dev/null
+++ b/dom/base/test/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/battery/Makefile.in
+++ b/dom/battery/Makefile.in
@@ -31,18 +31,16 @@ CPPSRCS = \
 LOCAL_INCLUDES = \
   -I$(topsrcdir)/content/events/src \
   $(NULL)
 
 XPIDLSRCS = \
   nsINavigatorBattery.idl \
   $(NULL)
 
-TEST_DIRS += test
-
 include $(topsrcdir)/config/config.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
 include $(topsrcdir)/config/rules.mk
 
 XPIDL_FLAGS += \
   -I$(topsrcdir)/dom/interfaces/base \
   -I$(topsrcdir)/dom/interfaces/events \
   $(NULL)
new file mode 100644
--- /dev/null
+++ b/dom/battery/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+TEST_DIRS += ['test']
--- a/dom/battery/test/Makefile.in
+++ b/dom/battery/test/Makefile.in
@@ -6,17 +6,13 @@ DEPTH            = @DEPTH@
 topsrcdir        = @top_srcdir@
 srcdir           = @srcdir@
 VPATH            = @srcdir@
 
 relativesrcdir   = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS = \
-  $(NULL)
-
-
 MOCHITEST_FILES = \
   test_battery_basics.html \
   $(NULL)
 
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/battery/test/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/bindings/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/bindings/test/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/bluetooth/moz.build
@@ -0,0 +1,15 @@
+# vim: set filetype=python:
+# Copyright 2013 Mozilla Foundation and Mozilla contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
--- a/dom/browser-element/Makefile.in
+++ b/dom/browser-element/Makefile.in
@@ -13,18 +13,16 @@ MODULE           = dom
 LIBRARY_NAME     = dom_browserelement_s
 XPIDL_MODULE     = dom_browserelement
 LIBXUL_LIBRARY   = 1
 FORCE_STATIC_LIB = 1
 FAIL_ON_WARNINGS := 1
 
 include $(topsrcdir)/dom/dom-config.mk
 
-TEST_DIRS += mochitest
-
 XPIDLSRCS = \
   nsIOpenWindowEventDetail.idl \
   nsIAsyncScrollEventDetail.idl \
   $(NULL)
 
 EXPORTS = \
   nsOpenWindowEventDetail.h \
   nsAsyncScrollEventDetail.h \
new file mode 100644
--- /dev/null
+++ b/dom/browser-element/mochitest/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/browser-element/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+TEST_DIRS += ['mochitest']
new file mode 100644
--- /dev/null
+++ b/dom/camera/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/cellbroadcast/Makefile.in
+++ b/dom/cellbroadcast/Makefile.in
@@ -6,13 +6,9 @@ DEPTH            = @DEPTH@
 topsrcdir        = @top_srcdir@
 srcdir           = @srcdir@
 VPATH            = @srcdir@
 
 relativesrcdir   = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-PARALLEL_DIRS = interfaces src
-
-TEST_DIRS += tests
-
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/cellbroadcast/interfaces/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/cellbroadcast/moz.build
@@ -0,0 +1,7 @@
+# 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/.
+
+PARALLEL_DIRS += ['interfaces', 'src']
+TEST_DIRS += ['tests']
new file mode 100644
--- /dev/null
+++ b/dom/cellbroadcast/src/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/cellbroadcast/tests/Makefile.in
+++ b/dom/cellbroadcast/tests/Makefile.in
@@ -6,12 +6,9 @@ DEPTH            = @DEPTH@
 topsrcdir        = @top_srcdir@
 srcdir           = @srcdir@
 VPATH            = @srcdir@
 
 relativesrcdir   = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS = \
-  $(NULL)
-
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/cellbroadcast/tests/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/contacts/Makefile.in
+++ b/dom/contacts/Makefile.in
@@ -25,18 +25,16 @@ EXTRA_COMPONENTS =        \
   ContactManager.manifest \
   $(NULL)
 
 EXTRA_JS_MODULES =   \
   ContactService.jsm \
   ContactDB.jsm      \
   $(NULL)
 
-TEST_DIRS += tests
-
 # Add VPATH to LOCAL_INCLUDES so we are going to include the correct backend
 # subdirectory (and the ipc one).
 LOCAL_INCLUDES += $(VPATH:%=-I%)
 
 include $(topsrcdir)/config/config.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
 include $(topsrcdir)/config/rules.mk
 
new file mode 100644
--- /dev/null
+++ b/dom/contacts/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+TEST_DIRS += ['tests']
--- a/dom/contacts/tests/Makefile.in
+++ b/dom/contacts/tests/Makefile.in
@@ -6,19 +6,16 @@ DEPTH            = @DEPTH@
 topsrcdir        = @top_srcdir@
 srcdir           = @srcdir@
 VPATH            = @srcdir@
 
 relativesrcdir   = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS = \
-  $(NULL)
-
 MOCHITEST_FILES = \
   test_contacts_basics.html \
   test_contacts_events.html \
   test_contacts_blobs.html \
   test_contacts_international.html \
   test_contacts_getall.html \
   $(NULL)
 
new file mode 100644
--- /dev/null
+++ b/dom/contacts/tests/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/devicestorage/Makefile.in
+++ b/dom/devicestorage/Makefile.in
@@ -39,16 +39,14 @@ EXPORTS         = \
 
 LOCAL_INCLUDES = \
 		-I$(topsrcdir)/dom/base \
 		-I$(topsrcdir)/dom/ipc \
 		-I$(topsrcdir)/content/base/src \
 		-I$(topsrcdir)/content/events/src \
 		$(NULL)
 
-TEST_DIRS += test ipc
-
 include $(topsrcdir)/config/config.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
 include $(topsrcdir)/config/rules.mk
 
 DEFINES += -D_IMPL_NS_LAYOUT
 
new file mode 100644
--- /dev/null
+++ b/dom/devicestorage/ipc/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/devicestorage/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+TEST_DIRS += ['test', 'ipc']
new file mode 100644
--- /dev/null
+++ b/dom/devicestorage/test/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/encoding/Makefile.in
+++ b/dom/encoding/Makefile.in
@@ -1,9 +1,8 @@
-#
 # 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/.
 
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
@@ -11,20 +10,16 @@ FAIL_ON_WARNINGS := 1
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= dom
 LIBRARY_NAME	= domencoding_s
 LIBXUL_LIBRARY	= 1
 FORCE_STATIC_LIB = 1
 
-DIRS = \
-  test \
-  $(NULL)
-
 EXPORTS_NAMESPACES = mozilla/dom
 EXPORTS_mozilla/dom = \
   EncodingUtils.h \
   TextDecoder.h \
   TextDecoderBase.h \
   TextEncoder.h \
   TextEncoderBase.h \
   $(NULL)
new file mode 100644
--- /dev/null
+++ b/dom/encoding/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+TEST_DIRS += ['test']
--- a/dom/encoding/test/Makefile.in
+++ b/dom/encoding/test/Makefile.in
@@ -5,18 +5,16 @@
 DEPTH = @DEPTH@
 topsrcdir = @top_srcdir@
 srcdir = @srcdir@
 VPATH = @srcdir@
 relativesrcdir = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-TEST_DIRS = unit
-
 XPCSHELL_TESTS = unit
 
 MOCHITEST_FILES = \
   file_utf16_be_bom.css \
   file_utf16_be_bom.js \
   file_utf16_be_bom.xhtml \
   file_utf16_le_bom.css \
   file_utf16_le_bom.js \
new file mode 100644
--- /dev/null
+++ b/dom/encoding/test/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+TEST_DIRS += ['unit']
new file mode 100644
--- /dev/null
+++ b/dom/encoding/test/unit/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/file/Makefile.in
+++ b/dom/file/Makefile.in
@@ -63,17 +63,15 @@ EXPORTS_mozilla/dom/file = \
 XPIDLSRCS = \
   nsIDOMFileHandle.idl \
   nsIDOMFileRequest.idl \
   nsIDOMLockedFile.idl \
   nsIDOMArchiveReader.idl \
   nsIDOMArchiveRequest.idl \
   $(NULL)
 
-TEST_DIRS += test
-
 include $(topsrcdir)/config/rules.mk
 
 XPIDL_FLAGS += \
   -I$(topsrcdir)/dom/base \
   -I$(topsrcdir)/dom/interfaces/base \
   -I$(topsrcdir)/dom/interfaces/events \
   $(NULL)
new file mode 100644
--- /dev/null
+++ b/dom/file/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+TEST_DIRS += ['test']
new file mode 100644
--- /dev/null
+++ b/dom/file/test/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/fm/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/icc/Makefile.in
+++ b/dom/icc/Makefile.in
@@ -4,13 +4,9 @@
 
 DEPTH            = @DEPTH@
 topsrcdir        = @top_srcdir@
 srcdir           = @srcdir@
 VPATH            = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-PARALLEL_DIRS = interfaces src
-
-TEST_DIRS += tests
-
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/icc/interfaces/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/icc/moz.build
@@ -0,0 +1,7 @@
+# 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/.
+
+PARALLEL_DIRS += ['interfaces', 'src']
+TEST_DIRS += ['tests']
new file mode 100644
--- /dev/null
+++ b/dom/icc/src/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/icc/tests/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/identity/Makefile.in
+++ b/dom/identity/Makefile.in
@@ -19,13 +19,9 @@ EXTRA_COMPONENTS = \
 
 EXTRA_PP_JS_MODULES = \
     DOMIdentity.jsm \
     $(NULL)
 
 EXTRA_JS_MODULES = \
     $(NULL)
 
-ifdef ENABLE_TESTS
-DIRS += tests
-endif
-
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/identity/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+TEST_DIRS += ['tests']
new file mode 100644
--- /dev/null
+++ b/dom/identity/tests/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/indexedDB/Makefile.in
+++ b/dom/indexedDB/Makefile.in
@@ -90,19 +90,16 @@ XPIDLSRCS = \
   nsIIDBObjectStore.idl \
   nsIIDBRequest.idl \
   nsIIDBTransaction.idl \
   nsIIDBVersionChangeEvent.idl \
   nsIIDBOpenDBRequest.idl \
   nsIIndexedDatabaseManager.idl \
   $(NULL)
 
-DIRS += ipc
-TEST_DIRS += test
-
 include $(topsrcdir)/config/config.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
 include $(topsrcdir)/config/rules.mk
 
 XPIDL_FLAGS += \
   -I$(topsrcdir)/dom/interfaces/base \
   -I$(topsrcdir)/dom/interfaces/events \
   $(NULL)
new file mode 100644
--- /dev/null
+++ b/dom/indexedDB/ipc/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/indexedDB/moz.build
@@ -0,0 +1,7 @@
+# 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/.
+
+DIRS += ['ipc']
+TEST_DIRS += ['test']
--- a/dom/indexedDB/test/Makefile.in
+++ b/dom/indexedDB/test/Makefile.in
@@ -5,18 +5,16 @@
 DEPTH = @DEPTH@
 topsrcdir = @top_srcdir@
 srcdir = @srcdir@
 VPATH = @srcdir@
 relativesrcdir = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-TEST_DIRS = unit
-
 XPCSHELL_TESTS = unit
 
 MOCHITEST_FILES = \
   bfcache_iframe1.html \
   bfcache_iframe2.html \
   error_events_abort_transactions_iframe.html \
   event_propagation_iframe.html \
   exceptions_in_events_iframe.html \
new file mode 100644
--- /dev/null
+++ b/dom/indexedDB/test/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+TEST_DIRS += ['unit']
new file mode 100644
--- /dev/null
+++ b/dom/indexedDB/test/unit/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/apps/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/base/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/canvas/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/contacts/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/core/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/css/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/devicestorage/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/events/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/geolocation/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/html/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/json/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/load-save/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/notification/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/offline/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/permission/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/range/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/settings/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/sidebar/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/smil/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/storage/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/stylesheets/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/svg/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/traversal/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/xbl/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/xpath/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/xul/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/ipc/Makefile.in
+++ b/dom/ipc/Makefile.in
@@ -13,20 +13,16 @@ MODULE = dom
 LIBRARY_NAME = domipc_s
 LIBXUL_LIBRARY = 1
 FORCE_STATIC_LIB = 1
 EXPORT_LIBRARY = 1
 ifndef _MSC_VER
 FAIL_ON_WARNINGS := 1
 endif # !_MSC_VER
 
-ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))
-TEST_DIRS += tests
-endif
-
 EXPORTS = \
   nsICachedFileDescriptorListener.h \
   PCOMContentPermissionRequestChild.h \
   $(NULL)
 
 EXPORTS_NAMESPACES = \
   mozilla \
   mozilla/dom \
new file mode 100644
--- /dev/null
+++ b/dom/ipc/moz.build
@@ -0,0 +1,8 @@
+# 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/.
+
+if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'cocoa':
+    TEST_DIRS += ['tests']
+
new file mode 100644
--- /dev/null
+++ b/dom/ipc/tests/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/locales/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/media/Makefile.in
+++ b/dom/media/Makefile.in
@@ -43,18 +43,13 @@ CPPSRCS = \
   MediaManager.cpp \
   $(NULL)
 
 ifdef MOZ_WEBRTC
 LOCAL_INCLUDES += \
   -I$(topsrcdir)/media/webrtc/trunk/webrtc \
   -I$(topsrcdir)/media/webrtc/signaling/src/common \
   $(NULL)
-DIRS += bridge
 endif
 
-TEST_DIRS += \
-  tests/mochitest \
-  $(NULL)
-
 include $(topsrcdir)/config/config.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/media/bridge/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/media/moz.build
@@ -0,0 +1,9 @@
+# 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/.
+
+if CONFIG['MOZ_WEBRTC']:
+    DIRS += ['bridge']
+
+TEST_DIRS += ['tests/mochitest']
new file mode 100644
--- /dev/null
+++ b/dom/media/tests/mochitest/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/messages/Makefile.in
+++ b/dom/messages/Makefile.in
@@ -6,18 +6,16 @@ DEPTH            = @DEPTH@
 topsrcdir        = @top_srcdir@
 srcdir           = @srcdir@
 VPATH            = @srcdir@
 
 relativesrcdir   = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-PARALLEL_DIRS = interfaces
-
 EXTRA_COMPONENTS = \
   SystemMessageManager.js \
   SystemMessageInternal.js \
   SystemMessageManager.manifest \
   $(NULL)
 
 EXTRA_JS_MODULES += \
   SystemMessagePermissionsChecker.jsm \
new file mode 100644
--- /dev/null
+++ b/dom/messages/interfaces/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/messages/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+PARALLEL_DIRS += ['interfaces']
--- a/dom/mms/Makefile.in
+++ b/dom/mms/Makefile.in
@@ -6,17 +6,15 @@ DEPTH            = @DEPTH@
 topsrcdir        = @top_srcdir@
 srcdir           = @srcdir@
 VPATH            = @srcdir@
 
 relativesrcdir   = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-PARALLEL_DIRS = interfaces src
-
 ifdef MOZ_B2G_RIL
 ifdef ENABLE_TESTS
 XPCSHELL_TESTS = tests
 endif
 endif
 
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/mms/interfaces/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/mms/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+PARALLEL_DIRS += ['interfaces', 'src']
new file mode 100644
--- /dev/null
+++ b/dom/mms/src/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/mobilemessage/Makefile.in
+++ b/dom/mobilemessage/Makefile.in
@@ -6,11 +6,9 @@ DEPTH            = @DEPTH@
 topsrcdir        = @top_srcdir@
 srcdir           = @srcdir@
 VPATH            = @srcdir@
 
 relativesrcdir   = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS = interfaces src
-
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/mobilemessage/interfaces/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/mobilemessage/moz.build
@@ -0,0 +1,7 @@
+# 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/.
+
+DIRS += ['interfaces', 'src']
+
new file mode 100644
--- /dev/null
+++ b/dom/mobilemessage/src/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/moz.build
@@ -0,0 +1,103 @@
+# 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/.
+
+interfaces = [
+    'base',
+    'canvas',
+    'core',
+    'html',
+    'events',
+    'devicestorage',
+    'contacts',
+    'settings',
+    'stylesheets',
+    'sidebar',
+    'css',
+    'traversal',
+    'range',
+    'xbl',
+    'xpath',
+    'load-save',
+    'xul',
+    'storage',
+    'json',
+    'offline',
+    'geolocation',
+    'notification',
+    'permission',
+    'svg',
+    'smil',
+    'apps',
+]
+
+PARALLEL_DIRS += ['interfaces/' + i for i in interfaces]
+
+PARALLEL_DIRS += [
+    'apps',
+    'base',
+    'activities',
+    'bindings',
+    'battery',
+    'bluetooth',
+    'browser-element',
+    'contacts',
+    'phonenumberutils',
+    'alarm',
+    'devicestorage',
+    'encoding',
+    'file',
+    'media',
+    'messages',
+    'power',
+    'quota',
+    'settings',
+    'mobilemessage',
+    'sms',
+    'mms',
+    'src',
+    'time',
+    'locales',
+    'network',
+    'permission',
+    'plugins/base',
+    'plugins/ipc',
+    'indexedDB',
+    'system',
+    'ipc',
+    'identity',
+    'workers',
+    'camera',
+    'audiochannel',
+]
+
+if CONFIG['OS_ARCH'] == 'WINNT':
+    PARALLEL_DIRS += ['plugins/ipc/hangui']
+
+if CONFIG['MOZ_B2G_RIL']:
+    PARALLEL_DIRS += [
+        'telephony',
+        'wifi',
+        'icc',
+        'cellbroadcast',
+        'voicemail',
+    ]
+
+if CONFIG['MOZ_B2G_FM']:
+    PARALLEL_DIRS += ['fm']
+
+if CONFIG['MOZ_PAY']:
+    PARALLEL_DIRS += ['payment']
+
+# bindings/test is here, because it needs to build after bindings/, and
+# we build subdirectories before ourselves.
+TEST_DIRS += [
+    'tests',
+    'imptests',
+    'bindings/test',
+]
+
+if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'cocoa', 'windows', 'android', 'qt', 'os2'):
+    TEST_DIRS += ['plugins/test']
+
--- a/dom/network/Makefile.in
+++ b/dom/network/Makefile.in
@@ -3,14 +3,9 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 DEPTH            = @DEPTH@
 topsrcdir        = @top_srcdir@
 srcdir           = @srcdir@
 VPATH            = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
-
-PARALLEL_DIRS = interfaces src
-
-TEST_DIRS += tests
-
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/network/interfaces/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/network/moz.build
@@ -0,0 +1,7 @@
+# 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/.
+
+PARALLEL_DIRS += ['interfaces', 'src']
+TEST_DIRS += ['tests']
new file mode 100644
--- /dev/null
+++ b/dom/network/src/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/network/tests/Makefile.in
+++ b/dom/network/tests/Makefile.in
@@ -6,19 +6,16 @@ DEPTH            = @DEPTH@
 topsrcdir        = @top_srcdir@
 srcdir           = @srcdir@
 VPATH            = @srcdir@
 
 relativesrcdir   = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS = \
-  $(NULL)
-
 MOCHITEST_FILES = \
   test_network_basics.html \
   test_tcpsocket_default_permissions.html \
   test_tcpsocket_enabled_no_perm.html \
   test_tcpsocket_enabled_with_perm.html \
   $(NULL)
 
 ifdef MOZ_B2G_RIL
new file mode 100644
--- /dev/null
+++ b/dom/network/tests/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/payment/Makefile.in
+++ b/dom/payment/Makefile.in
@@ -4,18 +4,16 @@
 
 DEPTH     = @DEPTH@
 topsrcdir = @top_srcdir@
 srcdir    = @srcdir@
 VPATH     = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-PARALLEL_DIRS = interfaces
-
 EXTRA_COMPONENTS = \
   Payment.js \
   PaymentFlowInfo.js \
   PaymentRequestInfo.js \
   Payment.manifest \
   $(NULL)
 
 EXTRA_JS_MODULES += \
new file mode 100644
--- /dev/null
+++ b/dom/payment/interfaces/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/payment/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+PARALLEL_DIRS += ['interfaces']
--- a/dom/permission/Makefile.in
+++ b/dom/permission/Makefile.in
@@ -22,15 +22,13 @@ EXTRA_COMPONENTS =        \
   PermissionPromptService.manifest \
   $(NULL)
 
 EXTRA_JS_MODULES =   \
   PermissionPromptHelper.jsm \
   PermissionSettings.jsm \
   $(NULL)
 
-TEST_DIRS += tests
-
 include $(topsrcdir)/config/config.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
 include $(topsrcdir)/config/rules.mk
 
 DEFINES += -D_IMPL_NS_LAYOUT
new file mode 100644
--- /dev/null
+++ b/dom/permission/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+TEST_DIRS += ['tests']
--- a/dom/permission/tests/Makefile.in
+++ b/dom/permission/tests/Makefile.in
@@ -6,19 +6,16 @@ DEPTH            = ../../..
 topsrcdir        = @top_srcdir@
 srcdir           = @srcdir@
 VPATH            = @srcdir@
 
 relativesrcdir   = dom/permission/tests
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS = \
-  $(NULL)
-
 MODULE          = test_permission
 XPCSHELL_TESTS  = unit
 
 include $(topsrcdir)/config/rules.mk
 
 _TEST_FILES = \
   test_permission_basics.html \
   $(NULL)
new file mode 100644
--- /dev/null
+++ b/dom/permission/tests/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/phonenumberutils/Makefile.in
+++ b/dom/phonenumberutils/Makefile.in
@@ -14,11 +14,9 @@ EXTRA_JS_MODULES =   \
   PhoneNumberMetaData.jsm \
   mcc_iso3166_table.jsm \
   $(NULL)
 
 EXTRA_PP_JS_MODULES = \
   PhoneNumberUtils.jsm \
   $(NULL)
 
-TEST_DIRS += tests
-
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/phonenumberutils/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+TEST_DIRS += ['tests']
--- a/dom/phonenumberutils/tests/Makefile.in
+++ b/dom/phonenumberutils/tests/Makefile.in
@@ -6,17 +6,14 @@ DEPTH            = @DEPTH@
 topsrcdir        = @top_srcdir@
 srcdir           = @srcdir@
 VPATH            = @srcdir@
 
 relativesrcdir   = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS = \
-  $(NULL)
-
 MOCHITEST_CHROME_FILES = \
   test_phonenumber.xul \
   test_phonenumberutils.xul \
   $(NULL)
 
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/phonenumberutils/tests/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/plugins/base/Makefile.in
+++ b/dom/plugins/base/Makefile.in
@@ -62,17 +62,16 @@ CPPSRCS		= \
 		nsJSNPRuntime.cpp \
 		nsPluginTags.cpp \
 		PluginPRLibrary.cpp \
 		nsPluginInstanceOwner.cpp \
 		nsPluginPlayPreviewInfo.cpp \
 		$(NULL)
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),android)
-DIRS += android
 LOCAL_INCLUDES += -I$(topsrcdir)/dom/plugins/base/android
 else
 # android_npapi.h extends the NPNVariable and NPPVariable enums
 # using #defines, which results in Wswitch warnings in gcc-4.6.
 # Therefore, enable FAIL_ON_WARNINGS only on non-Android platforms.
 ifndef _MSC_VER
 FAIL_ON_WARNINGS := 1
 endif # !_MSC_VER
new file mode 100644
--- /dev/null
+++ b/dom/plugins/base/android/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/plugins/base/moz.build
@@ -0,0 +1,8 @@
+# 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/.
+
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
+    DIRS += ['android']
+
--- a/dom/plugins/ipc/Makefile.in
+++ b/dom/plugins/ipc/Makefile.in
@@ -103,20 +103,16 @@ DEFINES += \
   $(NULL)
 
 EXPORTS_mozilla/plugins += \
   PluginSurfaceParent.h \
   $(NULL)
 endif
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
-DIRS += \
-    interpose \
-    $(NULL)
-
 CMMSRCS   += \
     PluginUtilsOSX.mm \
     PluginInterposeOSX.mm \
     $(NULL)
 
 EXPORTS_mozilla/plugins += \
     PluginInterposeOSX.h \
     $(NULL)
new file mode 100644
--- /dev/null
+++ b/dom/plugins/ipc/hangui/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/plugins/ipc/interpose/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/plugins/ipc/moz.build
@@ -0,0 +1,7 @@
+# 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/.
+
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
+    DIRS += ['interpose']
--- a/dom/plugins/test/Makefile.in
+++ b/dom/plugins/test/Makefile.in
@@ -8,19 +8,13 @@ topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = test_plugin
 
-DIRS = testplugin
-
 XPCSHELL_TESTS = \
   unit \
   $(NULL)
 
-ifneq (,$(filter gtk2 cocoa windows,$(MOZ_WIDGET_TOOLKIT)))
-TEST_DIRS += mochitest
-endif
-
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/plugins/test/mochitest/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/plugins/test/moz.build
@@ -0,0 +1,9 @@
+# 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/.
+
+DIRS += ['testplugin']
+
+if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'cocoa', 'windows'):
+    TEST_DIRS += ['mochitest']
--- a/dom/plugins/test/testplugin/Makefile.in
+++ b/dom/plugins/test/testplugin/Makefile.in
@@ -12,13 +12,11 @@ include $(DEPTH)/config/autoconf.mk
 
 MODULE       = nptest
 LIBRARY_NAME = nptest
 MODULE_NAME  = TestPlugin
 ifndef _MSC_VER
 FAIL_ON_WARNINGS = 1
 endif # !_MSC_VER
 
-DIRS = secondplugin
-
 RELATIVE_PATH=.
 COCOA_NAME=Test
 include @srcdir@/testplugin.mk
new file mode 100644
--- /dev/null
+++ b/dom/plugins/test/testplugin/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+DIRS += ['secondplugin']
new file mode 100644
--- /dev/null
+++ b/dom/plugins/test/testplugin/secondplugin/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/power/Makefile.in
+++ b/dom/power/Makefile.in
@@ -34,13 +34,11 @@ CPPSRCS = \
 
 XPIDLSRCS = \
   nsIDOMPowerManager.idl \
   nsIDOMWakeLock.idl \
   nsIDOMWakeLockListener.idl \
   nsIPowerManagerService.idl \
   $(NULL)
 
-TEST_DIRS += test
-
 include $(topsrcdir)/config/config.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/power/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+TEST_DIRS += ['test']
--- a/dom/power/test/Makefile.in
+++ b/dom/power/test/Makefile.in
@@ -6,19 +6,16 @@ DEPTH            = @DEPTH@
 topsrcdir        = @top_srcdir@
 srcdir           = @srcdir@
 VPATH            = @srcdir@
 
 relativesrcdir   = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS = \
-  $(NULL)
-
 MOCHITEST_FILES = \
   test_power_basics.html \
   $(NULL)
 
 MOCHITEST_BROWSER_FILES = \
   browser_bug697132.js \
   $(NULL)
 
new file mode 100644
--- /dev/null
+++ b/dom/power/test/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/quota/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/settings/Makefile.in
+++ b/dom/settings/Makefile.in
@@ -23,18 +23,16 @@ EXTRA_COMPONENTS =         \
   $(NULL)
 
 EXTRA_JS_MODULES =   \
   SettingsQueue.jsm  \
   SettingsDB.jsm     \
   SettingsChangeNotifier.jsm \
   $(NULL)
 
-TEST_DIRS += tests
-
 # Add VPATH to LOCAL_INCLUDES so we are going to include the correct backend
 # subdirectory (and the ipc one).
 # LOCAL_INCLUDES += $(VPATH:%=-I%)
 
 include $(topsrcdir)/config/config.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
 include $(topsrcdir)/config/rules.mk
 
new file mode 100644
--- /dev/null
+++ b/dom/settings/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+TEST_DIRS += ['tests']
new file mode 100644
--- /dev/null
+++ b/dom/settings/tests/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/sms/Makefile.in
+++ b/dom/sms/Makefile.in
@@ -6,16 +6,13 @@ DEPTH            = @DEPTH@
 topsrcdir        = @top_srcdir@
 srcdir           = @srcdir@
 VPATH            = @srcdir@
 
 relativesrcdir   = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS = interfaces src
-
-TEST_DIRS += tests
 ifdef ENABLE_TESTS
 XPCSHELL_TESTS = tests
 endif
 
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/sms/interfaces/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/sms/moz.build
@@ -0,0 +1,7 @@
+# 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/.
+
+DIRS += ['interfaces', 'src']
+TEST_DIRS += ['tests']
new file mode 100644
--- /dev/null
+++ b/dom/sms/src/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/sms/tests/Makefile.in
+++ b/dom/sms/tests/Makefile.in
@@ -6,19 +6,16 @@ DEPTH            = @DEPTH@
 topsrcdir        = @top_srcdir@
 srcdir           = @srcdir@
 VPATH            = @srcdir@
 
 relativesrcdir   = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS = \
-  $(NULL)
-
 MOCHITEST_FILES = \
   test_sms_basics.html \
   test_smsfilter.html \
   $(NULL)
 
 ifdef MOZ_B2G_RIL
 MOCHITEST_CHROME_FILES = \
   test_smsdatabaseservice.xul \
new file mode 100644
--- /dev/null
+++ b/dom/sms/tests/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/src/Makefile.in
+++ b/dom/src/Makefile.in
@@ -4,14 +4,9 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
-
-DIRS		= jsurl events storage offline json geolocation notification
-
-TEST_DIRS += foo
-
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/src/events/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/src/foo/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/src/geolocation/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/src/json/Makefile.in
+++ b/dom/src/json/Makefile.in
@@ -26,11 +26,9 @@ EXPORTS = nsJSON.h \
 FORCE_STATIC_LIB = 1
 
 LOCAL_INCLUDES = \
 		-I$(srcdir)/../base \
 		-I$(topsrcdir)/content/events/src
 
 DEFINES += -D_IMPL_NS_LAYOUT
 
-TEST_DIRS += test
-
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/src/json/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+TEST_DIRS += ['test']
new file mode 100644
--- /dev/null
+++ b/dom/src/json/test/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/src/jsurl/Makefile.in
+++ b/dom/src/jsurl/Makefile.in
@@ -31,13 +31,10 @@ LOCAL_INCLUDES += \
 		-I$(srcdir) \
 		-I$(topsrcdir)/dom/base \
 		-I$(topsrcdir)/netwerk/base/src \
 
 ifdef BUILD_DEBUG_GC
 DEFINES		+= -DDEBUG_GC
 endif
 
-DIRS            = $(NULL)
-TEST_DIRS += test
-
 include $(topsrcdir)/config/rules.mk
 
new file mode 100644
--- /dev/null
+++ b/dom/src/jsurl/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+TEST_DIRS += ['test']
new file mode 100644
--- /dev/null
+++ b/dom/src/jsurl/test/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/src/moz.build
@@ -0,0 +1,16 @@
+# 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/.
+
+DIRS += [
+    'jsurl',
+    'events',
+    'storage',
+    'offline',
+    'json',
+    'geolocation',
+    'notification',
+]
+
+TEST_DIRS += ['foo']
new file mode 100644
--- /dev/null
+++ b/dom/src/notification/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/src/offline/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/src/storage/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/system/Makefile.in
+++ b/dom/system/Makefile.in
@@ -10,32 +10,16 @@ VPATH       = @srcdir@
 include $(DEPTH)/config/autoconf.mk
 
 MODULE          = dom
 XPIDL_MODULE    = dom_system
 LIBRARY_NAME    = domsystem_s
 LIBXUL_LIBRARY  = 1
 FAIL_ON_WARNINGS := 1
 
-ifneq (,$(filter qt gtk2,$(MOZ_WIDGET_TOOLKIT)))
-DIRS = unix
-endif
-
-ifneq (,$(filter windows,$(MOZ_WIDGET_TOOLKIT)))
-DIRS = windows
-endif
-
-ifneq (,$(filter android,$(MOZ_WIDGET_TOOLKIT)))
-DIRS = android
-endif
-
-ifdef MOZ_B2G_RIL
-DIRS += gonk
-endif
-
 DEFINES += -DDLL_PREFIX=\"$(DLL_PREFIX)\" -DDLL_SUFFIX=\"$(DLL_SUFFIX)\"
 
 XPIDLSRCS = \
   nsIOSFileConstantsService.idl \
   $(NULL)
 
 CPPSRCS     = \
   nsDeviceSensors.cpp \
@@ -78,20 +62,16 @@ EXPORTS_mozilla = \
   $(NULL)
 
 # We fire the nsDOMDeviceAcceleration
 LOCAL_INCLUDES += \
   -I$(topsrcdir)/content/events/src \
   -I$(topsrcdir)/js/xpconnect/loader \
   $(NULL)
 
-ifdef ENABLE_TESTS
-DIRS += tests
-endif
-
 include $(topsrcdir)/config/config.mk
 
 # we don't want the shared lib, but we want to force the creation of a static lib.
 LIBXUL_LIBRARY   = 1
 FORCE_STATIC_LIB = 1
 EXPORT_LIBRARY = 1
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/system/android/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/system/gonk/moz.build
@@ -0,0 +1,15 @@
+# vim: set filetype=python:
+# Copyright 2013 Mozilla Foundation and Mozilla contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
new file mode 100644
--- /dev/null
+++ b/dom/system/moz.build
@@ -0,0 +1,18 @@
+# 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/.
+
+toolkit = CONFIG['MOZ_WIDGET_TOOLKIT']
+
+if toolkit in ('qt', 'gtk2'):
+    DIRS += ['unix']
+elif toolkit == 'windows':
+    DIRS += ['windows']
+elif toolkit == 'android':
+    DIRS += ['android']
+
+if CONFIG['MOZ_B2G_RIL']:
+    DIRS += ['gonk']
+
+TEST_DIRS += ['tests']
new file mode 100644
--- /dev/null
+++ b/dom/system/tests/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/system/unix/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/system/windows/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/telephony/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/tests/Makefile.in
+++ b/dom/tests/Makefile.in
@@ -1,21 +1,17 @@
-#
 # 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/.
 
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = test_dom
 
-DIRS		+= mochitest \
-		browser \
-		$(NULL)
 XPCSHELL_TESTS = unit
 
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/tests/browser/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/tests/mochitest/Makefile.in
+++ b/dom/tests/mochitest/Makefile.in
@@ -5,35 +5,10 @@
 
 DEPTH	= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir	= @srcdir@
 VPATH	= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS	+= \
-	dom-level0 \
-	dom-level1-core \
-	dom-level2-core \
-	dom-level2-html \
-	ajax \
-	bugs \
-	chrome \
-	crypto \
-	general \
-	whatwg \
-	geolocation \
-	localstorage \
-	orientation \
-	sessionstorage \
-	storageevent \
-	pointerlock \
-	webapps \
-	$(NULL)
-
-#needs IPC support, also tests do not run successfully in Firefox for now
-#ifneq (mobile,$(MOZ_BUILD_APP))
-#DIRS	+= notification
-#endif
-
 include $(topsrcdir)/config/rules.mk
 
--- a/dom/tests/mochitest/ajax/Makefile.in
+++ b/dom/tests/mochitest/ajax/Makefile.in
@@ -4,18 +4,9 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
-
-DIRS =	lib \
-	prototype \
-	offline \
-	mochikit \
-	scriptaculous \
-	jquery \
-	$(NULL)
-
 include $(topsrcdir)/config/rules.mk
--- a/dom/tests/mochitest/ajax/jquery/Makefile.in
+++ b/dom/tests/mochitest/ajax/jquery/Makefile.in
@@ -6,19 +6,14 @@
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir	= @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS	= \
-	dist \
-	test \
-	$(NULL)
-
 MOCHITEST_FILES	= \
 	manifest.json \
 	test_jQuery.html \
 	$(NULL)
 
 include $(topsrcdir)/config/rules.mk
--- a/dom/tests/mochitest/ajax/jquery/dist/Makefile.in
+++ b/dom/tests/mochitest/ajax/jquery/dist/Makefile.in
@@ -6,16 +6,13 @@
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir	= @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS	= \
-	$(NULL)
-
 MOCHITEST_FILES	= \
 	jquery.js \
 	$(NULL)
 
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/ajax/jquery/dist/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/ajax/jquery/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+DIRS += ['dist', 'test']
--- a/dom/tests/mochitest/ajax/jquery/test/Makefile.in
+++ b/dom/tests/mochitest/ajax/jquery/test/Makefile.in
@@ -6,21 +6,16 @@
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir	= @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS	= \
-	data \
-	unit \
-	$(NULL)
-
 MOCHITEST_FILES	= \
 	index.html \
 	offset.html \
 	test.js \
 	fix.html \
 	$(NULL)
 
 include $(topsrcdir)/config/rules.mk
--- a/dom/tests/mochitest/ajax/jquery/test/data/Makefile.in
+++ b/dom/tests/mochitest/ajax/jquery/test/data/Makefile.in
@@ -6,20 +6,16 @@
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir	= @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS	= \
-	offset \
-	$(NULL)
-
 MOCHITEST_FILES	= \
 	cow.jpg \
 	dashboard.xml \
 	iframe.html \
 	json_assigned_obj.js \
 	json_obj.js \
 	name.html \
 	test.html \
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/ajax/jquery/test/data/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+DIRS += ['offset']
--- a/dom/tests/mochitest/ajax/jquery/test/data/offset/Makefile.in
+++ b/dom/tests/mochitest/ajax/jquery/test/data/offset/Makefile.in
@@ -6,19 +6,16 @@
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir	= @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS	= \
-	$(NULL)
-
 MOCHITEST_FILES	= \
 	absolute.html \
 	fixed.html \
 	relative.html \
 	scroll.html \
 	static.html \
 	table.html \
 	$(NULL)
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/ajax/jquery/test/data/offset/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/ajax/jquery/test/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+DIRS += ['data', 'unit']
--- a/dom/tests/mochitest/ajax/jquery/test/unit/Makefile.in
+++ b/dom/tests/mochitest/ajax/jquery/test/unit/Makefile.in
@@ -6,19 +6,16 @@
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir	= @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS	= \
-	$(NULL)
-
 MOCHITEST_FILES	= \
 	ajax.js \
 	core.js \
 	dimensions.js \
 	event.js \
 	fx.js \
 	offset.js \
 	selector.js \
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/ajax/jquery/test/unit/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/ajax/lib/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/tests/mochitest/ajax/mochikit/Makefile.in
+++ b/dom/tests/mochitest/ajax/mochikit/Makefile.in
@@ -6,19 +6,14 @@
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir	= @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS	= \
-	MochiKit \
-	tests \
-	$(NULL)
-
 MOCHITEST_FILES	= \
 	test_Mochikit.html \
 	manifest.json \
 	$(NULL)
 
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/ajax/mochikit/MochiKit/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/ajax/mochikit/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+DIRS += ['MochiKit', 'tests']
--- a/dom/tests/mochitest/ajax/mochikit/tests/Makefile.in
+++ b/dom/tests/mochitest/ajax/mochikit/tests/Makefile.in
@@ -6,20 +6,16 @@
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir	= @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS		= \
-		SimpleTest \
-		$(NULL)
-
 MOCHITEST_FILES	= \
 		FakeJSAN.js \
 		cli.js \
 		index.html \
 		standalone.js \
 		test_Base.js \
 		test_Color.js \
 		test_DateTime.js \
--- a/dom/tests/mochitest/ajax/mochikit/tests/SimpleTest/Makefile.in
+++ b/dom/tests/mochitest/ajax/mochikit/tests/SimpleTest/Makefile.in
@@ -6,17 +6,15 @@
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir	= @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS = $(NULL)
-
 MOCHITEST_FILES	= \
 		SimpleTest.js \
 		TestRunner.js \
 		test.css \
 		$(NULL)
 
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/ajax/mochikit/tests/SimpleTest/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/ajax/mochikit/tests/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+DIRS += ['SimpleTest']
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/ajax/moz.build
@@ -0,0 +1,13 @@
+# 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/.
+
+DIRS += [
+    'lib',
+    'prototype',
+    'offline',
+    'mochikit',
+    'scriptaculous',
+    'jquery',
+]
--- a/dom/tests/mochitest/ajax/offline/Makefile.in
+++ b/dom/tests/mochitest/ajax/offline/Makefile.in
@@ -6,18 +6,16 @@
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir	= @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS = namespace1 namespace2
-
 MOCHITEST_FILES	= \
 	offlineTests.js \
 	test_badManifestMagic.html \
 	test_bypass.html \
 	test_missingFile.html \
 	test_noManifest.html \
 	test_simpleManifest.html \
 	test_identicalManifest.html \
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/ajax/offline/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+DIRS += ['namespace1', 'namespace2']
--- a/dom/tests/mochitest/ajax/offline/namespace1/Makefile.in
+++ b/dom/tests/mochitest/ajax/offline/namespace1/Makefile.in
@@ -6,17 +6,15 @@
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir	= @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS = sub sub2
-
 MOCHITEST_FILES	= \
         opp.html \
         script.js \
         redirectToDifferentOrigin.sjs \
         $(NULL)
 
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/ajax/offline/namespace1/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+TEST_DIRS += ['sub', 'sub2']
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/ajax/offline/namespace1/sub/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/ajax/offline/namespace1/sub2/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/ajax/offline/namespace2/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/tests/mochitest/ajax/prototype/Makefile.in
+++ b/dom/tests/mochitest/ajax/prototype/Makefile.in
@@ -6,19 +6,14 @@
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir	= @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS	= \
-	dist \
-	test \
-	$(NULL)
-
 MOCHITEST_FILES	= \
         test_Prototype.html \
         manifest.json \
         $(NULL)
 
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/ajax/prototype/dist/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/ajax/prototype/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+DIRS += ['dist', 'test']
--- a/dom/tests/mochitest/ajax/prototype/test/Makefile.in
+++ b/dom/tests/mochitest/ajax/prototype/test/Makefile.in
@@ -6,21 +6,15 @@
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir	= @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS	= \
-	unit \
-	lib \
-	functional \
-	$(NULL)
-
 MOCHITEST_FILES	= \
 		test.css \
 		browser.html \
 		console.html \
 		$(NULL)
 
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/ajax/prototype/test/functional/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/ajax/prototype/test/lib/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/ajax/prototype/test/moz.build
@@ -0,0 +1,10 @@
+# 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/.
+
+TEST_DIRS += [
+    'unit',
+    'lib',
+    'functional',
+]
--- a/dom/tests/mochitest/ajax/prototype/test/unit/Makefile.in
+++ b/dom/tests/mochitest/ajax/prototype/test/unit/Makefile.in
@@ -6,21 +6,16 @@
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir	= @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS = 	\
-	fixtures \
-	tmp \
-	$(NULL)
-
 MOCHITEST_FILES	= \
 	ajax_test.js \
 	array_test.js \
 	base_test.js \
 	dom_test.js \
 	element_mixins_test.js \
 	enumerable_test.js \
 	event_test.js \
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/ajax/prototype/test/unit/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+DIRS += ['fixtures', 'tmp']
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/ajax/prototype/test/unit/tmp/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/tests/mochitest/ajax/scriptaculous/Makefile.in
+++ b/dom/tests/mochitest/ajax/scriptaculous/Makefile.in
@@ -6,20 +6,14 @@
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir	= @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS	= \
-	lib \
-	src \
-	test/unit \
-	$(NULL)
-
 MOCHITEST_FILES	= \
 	manifest.json \
 	test_Scriptaculous.html \
 	$(NULL)
 
 include $(topsrcdir)/config/rules.mk
--- a/dom/tests/mochitest/ajax/scriptaculous/lib/Makefile.in
+++ b/dom/tests/mochitest/ajax/scriptaculous/lib/Makefile.in
@@ -6,16 +6,13 @@
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir	= @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS	= \
-	$(NULL)
-
 MOCHITEST_FILES	= \
 	prototype.js \
 	$(NULL)
 
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/ajax/scriptaculous/lib/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/ajax/scriptaculous/moz.build
@@ -0,0 +1,10 @@
+# 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/.
+
+TEST_DIRS += [
+    'lib',
+    'src',
+    'test/unit',
+]
--- a/dom/tests/mochitest/ajax/scriptaculous/src/Makefile.in
+++ b/dom/tests/mochitest/ajax/scriptaculous/src/Makefile.in
@@ -6,19 +6,16 @@
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir	= @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS	= \
-	$(NULL)
-
 MOCHITEST_FILES	= \
 	builder.js \
 	controls.js \
 	dragdrop.js \
 	effects.js \
 	scriptaculous.js \
 	slider.js \
 	sound.js \
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/ajax/scriptaculous/src/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/tests/mochitest/ajax/scriptaculous/test/unit/Makefile.in
+++ b/dom/tests/mochitest/ajax/scriptaculous/test/unit/Makefile.in
@@ -6,19 +6,16 @@
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir	= @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS	= \
-	$(NULL)
-
 MOCHITEST_FILES	= \
 	_ajax_inplaceeditor_result.html \
 	_ajax_inplaceeditor_text.html \
 	_ajax_updater_result.html \
 	_autocomplete_result.html \
 	_autocomplete_result_nobr.html \
 	ajax_autocompleter_test.html \
 	ajax_inplaceeditor_test.html \
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/ajax/scriptaculous/test/unit/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/bugs/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/chrome/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/crypto/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/dom-level0/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/tests/mochitest/dom-level1-core/Makefile.in
+++ b/dom/tests/mochitest/dom-level1-core/Makefile.in
@@ -6,18 +6,16 @@
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir	= @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS = files
-
 MOCHITEST_FILES_A	= \
 		DOMTestCase.js \
 		activity-home.css \
 		exclusions.js \
 		test_attrcreatedocumentfragment.html \
 		test_attrcreatetextnode.html \
 		test_attrcreatetextnode2.html \
 		test_attrdefaultvalue.html \
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/dom-level1-core/files/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/dom-level1-core/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+TEST_DIRS += ['files']
--- a/dom/tests/mochitest/dom-level2-core/Makefile.in
+++ b/dom/tests/mochitest/dom-level2-core/Makefile.in
@@ -6,18 +6,16 @@
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir	= @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS = files
-
 MOCHITEST_FILES_A	= \
 		DOMTestCase.js \
 		exclusions.js \
 		test_attrgetownerelement01.html \
 		test_attrgetownerelement02.html \
 		test_attrgetownerelement03.html \
 		test_attrgetownerelement04.html \
 		test_attrgetownerelement05.html \
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/dom-level2-core/files/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/dom-level2-core/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+TEST_DIRS += ['files']
--- a/dom/tests/mochitest/dom-level2-html/Makefile.in
+++ b/dom/tests/mochitest/dom-level2-html/Makefile.in
@@ -6,18 +6,16 @@
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir	= @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS = files
-
 MOCHITEST_FILES_A	= \
 		DOMTestCase.js \
 		test_anchor01.html \
 		test_anchor02.html \
 		test_anchor03.html \
 		test_anchor04.html \
 		test_anchor05.html \
 		test_anchor06.html \
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/dom-level2-html/files/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/dom-level2-html/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+TEST_DIRS += ['files']
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/general/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/geolocation/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/localstorage/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/moz.build
@@ -0,0 +1,29 @@
+# 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/.
+
+DIRS += [
+    'dom-level0',
+    'dom-level1-core',
+    'dom-level2-core',
+    'dom-level2-html',
+    'ajax',
+    'bugs',
+    'chrome',
+    'crypto',
+    'general',
+    'whatwg',
+    'geolocation',
+    'localstorage',
+    'orientation',
+    'sessionstorage',
+    'storageevent',
+    'pointerlock',
+    'webapps',
+]
+
+#needs IPC support, also tests do not run successfully in Firefox for now
+#if CONFIG['MOZ_BUILD_APP'] != 'mobile':
+#    DIRS += ['notification']
+
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/notification/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/orientation/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/pointerlock/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/sessionstorage/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/storageevent/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/tests/mochitest/webapps/Makefile.in
+++ b/dom/tests/mochitest/webapps/Makefile.in
@@ -5,20 +5,16 @@
 DEPTH	 = @DEPTH@
 topsrcdir	 = @top_srcdir@
 srcdir	= @srcdir@
 VPATH	 = @srcdir@
 relativesrcdir	= @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS = \
-    apps \
-    $(NULL)
-
 MOCHITEST_CHROME_FILES = \
     bug_765063.xul \
     cross_origin.html \
     head.js \
     test_bug_765063.xul \
     test_bug_795164.xul \
     test_cross_origin.xul \
     test_install_app.xul \
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/webapps/apps/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/webapps/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+DIRS += ['apps']
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/whatwg/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/tests/moz.build
@@ -0,0 +1,7 @@
+# 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/.
+
+DIRS += ['mochitest', 'browser']
+
new file mode 100644
--- /dev/null
+++ b/dom/time/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/voicemail/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/wifi/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
--- a/dom/workers/Makefile.in
+++ b/dom/workers/Makefile.in
@@ -69,11 +69,9 @@ EXPORTS_mozilla/dom/workers/bindings = \
 LOCAL_INCLUDES = \
   -I$(topsrcdir)/content/base/src \
   -I$(topsrcdir)/content/events/src \
   -I$(topsrcdir)/dom/base \
   -I$(topsrcdir)/dom/system \
   -I$(topsrcdir)/xpcom/build \
   $(NULL)
 
-TEST_DIRS += test
-
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/workers/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+TEST_DIRS += ['test']
--- a/dom/workers/test/Makefile.in
+++ b/dom/workers/test/Makefile.in
@@ -6,20 +6,16 @@ DEPTH            = @DEPTH@
 topsrcdir        = @top_srcdir@
 srcdir           = @srcdir@
 VPATH            = @srcdir@
 
 relativesrcdir   = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS = \
-  extensions \
-  $(NULL)
-
 MOCHITEST_FILES = \
   test_404.html \
   test_atob.html \
   atob_worker.js \
   test_blobWorkers.html \
   test_clearTimeouts.html \
   clearTimeouts_worker.js \
   test_close.html \
--- a/dom/workers/test/extensions/Makefile.in
+++ b/dom/workers/test/extensions/Makefile.in
@@ -3,15 +3,9 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 DEPTH            = @DEPTH@
 topsrcdir        = @top_srcdir@
 srcdir           = @srcdir@
 VPATH            = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
-
-DIRS = \
-  bootstrap \
-  traditional \
-  $(NULL)
-
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/dom/workers/test/extensions/bootstrap/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/workers/test/extensions/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+DIRS += ['bootstrap', 'traditional']
new file mode 100644
--- /dev/null
+++ b/dom/workers/test/extensions/traditional/moz.build
@@ -0,0 +1,5 @@
+# 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/.
+
new file mode 100644
--- /dev/null
+++ b/dom/workers/test/moz.build
@@ -0,0 +1,6 @@
+# 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/.
+
+DIRS += ['extensions']