Bug 718067 - Part 1: Create skeletons for services/{metrics,healthreport}. r=rnewman, a=akeybl
authorGregory Szorc <gps@mozilla.com>
Mon, 05 Nov 2012 12:49:58 -0800
changeset 118353 a6e79eec81512401fc473bb72bef8413b794f742
parent 118352 2445b602fe377aa5375fa17c02449f2683bbe2d1
child 118354 5e70b77e821860603e60a8892682bbcf3177ed04
push id2758
push userryanvm@gmail.com
push dateWed, 21 Nov 2012 23:59:24 +0000
treeherdermozilla-aurora@c7cf5632c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman, akeybl
bugs718067
milestone19.0a2
Bug 718067 - Part 1: Create skeletons for services/{metrics,healthreport}. r=rnewman, a=akeybl 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
@@ -8210,16 +8210,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)
--- 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=19.0a2
 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]