Bug 718067 - Part 1: Create skeletons for services/{metrics,healthreport}; r=rnewman
authorGregory Szorc <gps@mozilla.com>
Mon, 05 Nov 2012 12:49:58 -0800
changeset 122922 1e58a9949cede1e152e951ce5f88281fabc14dc2
parent 122921 48f311b7d3554ce3637b8fb346e08694a6b0dab5
child 122923 1a386fa321b2a67b3363d4b62f6c60d7ef288f2f
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman
bugs718067
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 718067 - Part 1: Create skeletons for services/{metrics,healthreport}; r=rnewman services/metrics will hold generic metrics code. services/healthreport report will build on top of that to provide the Firefox Health Report feature. All functionality will land in subsequent patches.
b2g/confvars.sh
browser/confvars.sh
configure.in
mobile/android/confvars.sh
mobile/xul/confvars.sh
services/Makefile.in
services/healthreport/Makefile.in
services/healthreport/tests/Makefile.in
services/healthreport/tests/xpcshell/head.js
services/healthreport/tests/xpcshell/test_load_modules.js
services/healthreport/tests/xpcshell/xpcshell.ini
services/makefiles.sh
services/metrics/Makefile.in
services/metrics/tests/Makefile.in
services/metrics/tests/xpcshell/head.js
services/metrics/tests/xpcshell/test_load_modules.js
services/metrics/tests/xpcshell/xpcshell.ini
testing/xpcshell/xpcshell.ini
--- a/b2g/confvars.sh
+++ b/b2g/confvars.sh
@@ -13,16 +13,18 @@ MOZ_UA_OS_AGNOSTIC=1
 MOZ_B2G_VERSION=1.0.0-prerelease
 
 MOZ_BRANDING_DIRECTORY=b2g/branding/unofficial
 MOZ_OFFICIAL_BRANDING_DIRECTORY=b2g/branding/official
 # MOZ_APP_DISPLAYNAME is set by branding/configure.sh
 
 MOZ_SAFE_BROWSING=
 MOZ_SERVICES_COMMON=1
+MOZ_SERVICES_HEALTHREPORT=1
+MOZ_SERVICES_METRICS=1
 
 MOZ_WEBSMS_BACKEND=1
 MOZ_DISABLE_DOMCRYPTO=1
 MOZ_APP_STATIC_INI=1
 
 if test "$OS_TARGET" = "Android"; then
 MOZ_CAPTURE=1
 MOZ_RAW=1
--- a/browser/confvars.sh
+++ b/browser/confvars.sh
@@ -16,16 +16,18 @@ if test "$OS_ARCH" = "WINNT"; then
 fi
 
 MOZ_STUB_INSTALLER=1
 MOZ_CHROME_FILE_FORMAT=omni
 MOZ_SAFE_BROWSING=1
 MOZ_SERVICES_AITC=1
 MOZ_SERVICES_COMMON=1
 MOZ_SERVICES_CRYPTO=1
+MOZ_SERVICES_HEALTHREPORT=1
+MOZ_SERVICES_METRICS=1
 MOZ_SERVICES_NOTIFICATIONS=1
 MOZ_SERVICES_SYNC=1
 MOZ_APP_VERSION=$FIREFOX_VERSION
 MOZ_EXTENSIONS_DEFAULT=" gio"
 # MOZ_APP_DISPLAYNAME will be set by branding/configure.sh
 # Changing MOZ_*BRANDING_DIRECTORY requires a clobber to ensure correct results,
 # because branding dependencies are broken.
 # MOZ_BRANDING_DIRECTORY is the default branding directory used when none is
--- a/configure.in
+++ b/configure.in
@@ -8209,16 +8209,28 @@ if test -n "$MOZ_SERVICES_COMMON"; then
 fi
 
 dnl Build Services crypto component (used by Sync)
 AC_SUBST(MOZ_SERVICES_CRYPTO)
 if test -n "$MOZ_SERVICES_CRYPTO"; then
   AC_DEFINE(MOZ_SERVICES_CRYPTO)
 fi
 
+dnl Build Firefox Health Reporter Service
+AC_SUBST(MOZ_SERVICES_HEALTHREPORT)
+if test -n "$MOZ_SERVICES_HEALTHREPORT"; then
+  AC_DEFINE(MOZ_SERVICES_HEALTHREPORT)
+fi
+
+dnl Build Services metrics component
+AC_SUBST(MOZ_SERVICES_METRICS)
+if test -n "$MOZ_SERVICES_METRICS"; then
+  AC_DEFINE(MOZ_SERVICES_METRICS)
+fi
+
 dnl Build Notifications if required
 AC_SUBST(MOZ_SERVICES_NOTIFICATIONS)
 if test -n "$MOZ_SERVICES_NOTIFICATIONS"; then
   AC_DEFINE(MOZ_SERVICES_NOTIFICATIONS)
 fi
 
 dnl Build Sync Services if required
 AC_SUBST(MOZ_SERVICES_SYNC)
old mode 100755
new mode 100644
--- a/mobile/android/confvars.sh
+++ b/mobile/android/confvars.sh
@@ -14,16 +14,20 @@ MOZ_OFFICIAL_BRANDING_DIRECTORY=mobile/a
 
 MOZ_SAFE_BROWSING=1
 
 MOZ_DISABLE_DOMCRYPTO=1
 
 # Enable getUserMedia
 MOZ_MEDIA_NAVIGATOR=1
 
+MOZ_SERVICES_COMMON=1
+MOZ_SERVICES_HEALTHREPORT=1
+MOZ_SERVICES_METRICS=1
+
 if test "$LIBXUL_SDK"; then
 MOZ_XULRUNNER=1
 else
 MOZ_XULRUNNER=
 fi
 
 MOZ_CAPTURE=1
 MOZ_RAW=1
--- a/mobile/xul/confvars.sh
+++ b/mobile/xul/confvars.sh
@@ -10,16 +10,18 @@ MOZ_APP_VERSION=20.0a1
 MOZ_BRANDING_DIRECTORY=mobile/xul/branding/unofficial
 MOZ_OFFICIAL_BRANDING_DIRECTORY=mobile/xul/branding/official
 # MOZ_APP_DISPLAYNAME is set by branding/configure.sh
 
 MOZ_SAFE_BROWSING=
 
 MOZ_SERVICES_COMMON=1
 MOZ_SERVICES_CRYPTO=1
+MOZ_SERVICES_HEALTHREPORT=1
+MOZ_SERVICES_METRICS=1
 MOZ_SERVICES_SYNC=1
 
 MOZ_DISABLE_DOMCRYPTO=1
 
 if test "$LIBXUL_SDK"; then
 MOZ_XULRUNNER=1
 else
 MOZ_XULRUNNER=
--- a/services/Makefile.in
+++ b/services/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@
@@ -17,16 +16,24 @@ endif
 ifdef MOZ_SERVICES_CRYPTO
 PARALLEL_DIRS += crypto
 endif
 
 ifdef MOZ_SERVICES_AITC
 PARALLEL_DIRS += aitc
 endif
 
+ifdef MOZ_SERVICES_HEALTHREPORT
+PARALLEL_DIRS += healthreport
+endif
+
+ifdef MOZ_SERVICES_METRICS
+PARALLEL_DIRS += metrics
+endif
+
 ifdef MOZ_SERVICES_NOTIFICATIONS
 PARALLEL_DIRS += notifications
 endif
 
 ifdef MOZ_SERVICES_SYNC
 PARALLEL_DIRS += sync
 endif
 
new file mode 100644
--- /dev/null
+++ b/services/healthreport/Makefile.in
@@ -0,0 +1,27 @@
+# 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
+
+modules := \
+  $(NULL)
+
+testing_modules := \
+  $(NULL)
+
+TEST_DIRS += tests
+
+MODULES_FILES := $(modules)
+MODULES_DEST = $(FINAL_TARGET)/modules/services/healthreport
+INSTALL_TARGETS += MODULES
+
+TESTING_JS_MODULES := $(addprefix modules-testing/,$(testing_modules))
+TESTING_JS_MODULE_DIR := services/healthreport
+
+include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/services/healthreport/tests/Makefile.in
@@ -0,0 +1,15 @@
+# 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
+
+XPCSHELL_TESTS = xpcshell
+
+include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/services/healthreport/tests/xpcshell/head.js
@@ -0,0 +1,13 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+(function initMetricsTestingInfrastructure() {
+  let ns = {};
+  Components.utils.import("resource://testing-common/services-common/logging.js",
+                          ns);
+
+  ns.initTestLogging();
+}).call(this);
+
new file mode 100644
--- /dev/null
+++ b/services/healthreport/tests/xpcshell/test_load_modules.js
@@ -0,0 +1,23 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const modules = [
+];
+
+const test_modules = [
+];
+
+function run_test() {
+  for (let m of modules) {
+    let resource = "resource://gre/modules/services/healthreport/" + m;
+    Components.utils.import(resource, {});
+  }
+
+  for (let m of test_modules) {
+    let resource = "resource://testing-common/services/healthreport/" + m;
+    Components.utils.import(resource, {});
+  }
+}
+
new file mode 100644
--- /dev/null
+++ b/services/healthreport/tests/xpcshell/xpcshell.ini
@@ -0,0 +1,5 @@
+[DEFAULT]
+head = head.js
+tail =
+
+[test_load_modules.js]
--- a/services/makefiles.sh
+++ b/services/makefiles.sh
@@ -3,22 +3,26 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 add_makefiles "
   services/Makefile
   services/aitc/Makefile
   services/common/Makefile
   services/crypto/Makefile
   services/crypto/component/Makefile
+  services/healthreport/Makefile
+  services/metrics/Makefile
   services/notifications/Makefile
   services/sync/Makefile
   services/sync/locales/Makefile
 "
 
 if [ "$ENABLE_TESTS" ]; then
   add_makefiles "
     services/aitc/tests/Makefile
     services/common/tests/Makefile
     services/crypto/tests/Makefile
+    services/healthreport/tests/Makefile
+    services/metrics/tests/Makefile
     services/notifications/tests/Makefile
     services/sync/tests/Makefile
   "
 fi
new file mode 100644
--- /dev/null
+++ b/services/metrics/Makefile.in
@@ -0,0 +1,27 @@
+# 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
+
+modules := \
+  $(NULL)
+
+testing_modules := \
+  $(NULL)
+
+TEST_DIRS += tests
+
+MODULES_FILES := $(modules)
+MODULES_DEST = $(FINAL_TARGET)/modules/services/metrics
+INSTALL_TARGETS += MODULES
+
+TESTING_JS_MODULES := $(addprefix modules-testing/,$(testing_modules))
+TESTING_JS_MODULE_DIR := services/metrics
+
+include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/services/metrics/tests/Makefile.in
@@ -0,0 +1,15 @@
+# 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
+
+XPCSHELL_TESTS = xpcshell
+
+include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/services/metrics/tests/xpcshell/head.js
@@ -0,0 +1,13 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+(function initMetricsTestingInfrastructure() {
+  let ns = {};
+  Components.utils.import("resource://testing-common/services-common/logging.js",
+                          ns);
+
+  ns.initTestLogging();
+}).call(this);
+
new file mode 100644
--- /dev/null
+++ b/services/metrics/tests/xpcshell/test_load_modules.js
@@ -0,0 +1,23 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const modules = [
+];
+
+const test_modules = [
+];
+
+function run_test() {
+  for (let m of modules) {
+    let resource = "resource://gre/modules/services/metrics/" + m;
+    Components.utils.import(resource, {});
+  }
+
+  for (let m of test_modules) {
+    let resource = "resource://testing-common/services/metrics/" + m;
+    Components.utils.import(resource, {});
+  }
+}
+
new file mode 100644
--- /dev/null
+++ b/services/metrics/tests/xpcshell/xpcshell.ini
@@ -0,0 +1,5 @@
+[DEFAULT]
+head = head.js
+tail =
+
+[test_load_modules.js]
--- a/testing/xpcshell/xpcshell.ini
+++ b/testing/xpcshell/xpcshell.ini
@@ -80,16 +80,18 @@ skip-if = os == "android"
 [include:widget/tests/unit/xpcshell.ini]
 [include:content/base/test/unit/xpcshell.ini]
 [include:content/test/unit/xpcshell.ini]
 [include:toolkit/components/url-classifier/tests/unit/xpcshell.ini]
 [include:services/aitc/tests/unit/xpcshell.ini]
 [include:services/common/tests/unit/xpcshell.ini]
 [include:services/crypto/tests/unit/xpcshell.ini]
 [include:services/crypto/components/tests/unit/xpcshell.ini]
+[include:services/healthreport/tests/xpcshell/xpcshell.ini]
+[include:services/metrics/tests/xpcshell/xpcshell.ini]
 [include:services/notifications/tests/unit/xpcshell.ini]
 [include:services/sync/tests/unit/xpcshell.ini]
 # Bug 676978: tests hang on Android
 skip-if = os == "android"
 [include:browser/components/dirprovider/tests/unit/xpcshell.ini]
 [include:browser/components/downloads/test/unit/xpcshell.ini]
 [include:browser/components/feeds/test/unit/xpcshell.ini]
 [include:browser/components/migration/tests/unit/xpcshell.ini]