From e129828a38e8ad6248d123458900067da0ce14af Mon Sep 17 00:00:00 2001 From: Julian Descottes Date: Tue, 6 Sep 2016 11:43:11 +0200 Subject: [PATCH 01/11] Bug 1300458 - devtools key shortcuts fix shift+cmd shortcuts on OSX;r=ochameau MozReview-Commit-ID: Aq6cFkF86Qa --HG-- extra : rebase_source : 07c240f080dce7e4fe6d20275d26ffefb81d705d --- devtools/client/shared/key-shortcuts.js | 15 +++++--- .../shared/test/browser_key_shortcuts.js | 36 +++++++++++++++++++ 2 files changed, 46 insertions(+), 5 deletions(-) diff --git a/devtools/client/shared/key-shortcuts.js b/devtools/client/shared/key-shortcuts.js index 2591817eb29f..ec7d30bcb333 100644 --- a/devtools/client/shared/key-shortcuts.js +++ b/devtools/client/shared/key-shortcuts.js @@ -192,12 +192,17 @@ KeyShortcuts.prototype = { if (shortcut.alt != event.altKey) { return false; } - // Shift is a special modifier, it may implicitely be required if the - // expected key is a special character accessible via shift. - if (shortcut.shift != event.shiftKey && event.key && - event.key.match(/[a-zA-Z]/)) { - return false; + if (shortcut.shift != event.shiftKey) { + // Shift is a special modifier, it may implicitely be required if the expected key + // is a special character accessible via shift. + let isAlphabetical = event.key && event.key.match(/[a-zA-Z]/); + // OSX: distinguish cmd+[key] from cmd+shift+[key] shortcuts (Bug 1300458) + let cmdShortcut = shortcut.meta && !shortcut.alt && !shortcut.ctrl; + if (isAlphabetical || cmdShortcut) { + return false; + } } + if (shortcut.keyCode) { return event.keyCode == shortcut.keyCode; } else if (event.key in ElectronKeysMapping) { diff --git a/devtools/client/shared/test/browser_key_shortcuts.js b/devtools/client/shared/test/browser_key_shortcuts.js index ee212b0007c4..5d23c2deded9 100644 --- a/devtools/client/shared/test/browser_key_shortcuts.js +++ b/devtools/client/shared/test/browser_key_shortcuts.js @@ -7,6 +7,7 @@ add_task(function* () { let shortcuts = new KeyShortcuts({ window }); + yield testSimple(shortcuts); yield testNonLetterCharacter(shortcuts); yield testPlusCharacter(shortcuts); @@ -20,6 +21,7 @@ add_task(function* () { yield testCommandOrControlModifier(shortcuts); yield testCtrlModifier(shortcuts); yield testInvalidShortcutString(shortcuts); + yield testCmdShiftShortcut(shortcuts); shortcuts.destroy(); yield testTarget(); @@ -352,6 +354,40 @@ function testCtrlModifier(shortcuts) { yield onKeyAlias; } +function testCmdShiftShortcut(shortcuts) { + if (!isOSX) { + // This test is OSX only (Bug 1300458). + return; + } + + let onCmdKey = once(shortcuts, "CmdOrCtrl+[", (key, event) => { + is(event.key, "["); + ok(!event.altKey); + ok(!event.ctrlKey); + ok(event.metaKey); + ok(!event.shiftKey); + }); + let onCmdShiftKey = once(shortcuts, "CmdOrCtrl+Shift+[", (key, event) => { + is(event.key, "["); + ok(!event.altKey); + ok(!event.ctrlKey); + ok(event.metaKey); + ok(event.shiftKey); + }); + + EventUtils.synthesizeKey( + "[", + { metaKey: true, shiftKey: true }, + window); + EventUtils.synthesizeKey( + "[", + { metaKey: true }, + window); + + yield onCmdKey; + yield onCmdShiftKey; +} + function testTarget() { info("Test KeyShortcuts with target argument"); From edb0888015ba564e3f4ddc91a6a437604df58af1 Mon Sep 17 00:00:00 2001 From: Julian Descottes Date: Tue, 6 Sep 2016 10:38:40 +0200 Subject: [PATCH 02/11] Bug 1300458 - fix linting errors in browser_key_shortcuts.js;r=ochameau MozReview-Commit-ID: 85VRaDe8Vxf --HG-- extra : rebase_source : 32ba5059c1f04e4d5df167b3a72104dfd47b5c4f --- .../shared/test/browser_key_shortcuts.js | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/devtools/client/shared/test/browser_key_shortcuts.js b/devtools/client/shared/test/browser_key_shortcuts.js index 5d23c2deded9..c88782f85695 100644 --- a/devtools/client/shared/test/browser_key_shortcuts.js +++ b/devtools/client/shared/test/browser_key_shortcuts.js @@ -1,6 +1,8 @@ /* Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ */ +"use strict"; + var isOSX = Services.appinfo.OS === "Darwin"; add_task(function* () { @@ -44,7 +46,7 @@ function once(shortcuts, key, listener) { }); } -function testSimple(shortcuts) { +function* testSimple(shortcuts) { info("Test simple key shortcuts"); let onKey = once(shortcuts, "0", (key, event) => { @@ -58,7 +60,7 @@ function testSimple(shortcuts) { yield onKey; } -function testNonLetterCharacter(shortcuts) { +function* testNonLetterCharacter(shortcuts) { info("Test non-naive character key shortcuts"); let onKey = once(shortcuts, "[", (key, event) => { @@ -69,7 +71,7 @@ function testNonLetterCharacter(shortcuts) { yield onKey; } -function testFunctionKey(shortcuts) { +function* testFunctionKey(shortcuts) { info("Test function key shortcuts"); let onKey = once(shortcuts, "F12", (key, event) => { @@ -83,7 +85,7 @@ function testFunctionKey(shortcuts) { // Plus is special. It's keycode is the one for "=". That's because it requires // shift to be pressed and is behind "=" key. So it should be considered as a // character key -function testPlusCharacter(shortcuts) { +function* testPlusCharacter(shortcuts) { info("Test 'Plus' key shortcuts"); let onKey = once(shortcuts, "Plus", (key, event) => { @@ -95,7 +97,7 @@ function testPlusCharacter(shortcuts) { } // Test they listeners are not mixed up between shortcuts -function testMixup(shortcuts) { +function* testMixup(shortcuts) { info("Test possible listener mixup"); let hitFirst = false, hitSecond = false; @@ -130,7 +132,7 @@ function testMixup(shortcuts) { // On azerty keyboard, digits are only available by pressing Shift/Capslock, // but we accept them even if we omit doing that. -function testLooseDigits(shortcuts) { +function* testLooseDigits(shortcuts) { info("Test Loose digits"); let onKey = once(shortcuts, "0", (key, event) => { is(event.key, "à"); @@ -163,7 +165,7 @@ function testLooseDigits(shortcuts) { } // Test that shortcuts is notified only when the modifiers match exactly -function testExactModifiers(shortcuts) { +function* testExactModifiers(shortcuts) { info("Test exact modifiers match"); let hit = false; @@ -211,7 +213,7 @@ function testExactModifiers(shortcuts) { // even if the key didn't explicitely requested Shift modifier. // For example, `%` on french keyboards is only accessible via Shift. // Same thing for `@` on US keybords. -function testLooseShiftModifier(shortcuts) { +function* testLooseShiftModifier(shortcuts) { info("Test Loose shift modifier"); let onKey = once(shortcuts, "%", (key, event) => { is(event.key, "%"); @@ -241,7 +243,7 @@ function testLooseShiftModifier(shortcuts) { } // But Shift modifier is strict on all letter characters (a to Z) -function testStrictLetterShiftModifier(shortcuts) { +function* testStrictLetterShiftModifier(shortcuts) { info("Test strict shift modifier on letters"); let hitFirst = false; let onKey = once(shortcuts, "a", (key, event) => { @@ -273,7 +275,7 @@ function testStrictLetterShiftModifier(shortcuts) { yield onKey; } -function testAltModifier(shortcuts) { +function* testAltModifier(shortcuts) { info("Test Alt modifier"); let onKey = once(shortcuts, "Alt+F1", (key, event) => { is(event.keyCode, window.KeyboardEvent.DOM_VK_F1); @@ -289,7 +291,7 @@ function testAltModifier(shortcuts) { yield onKey; } -function testCommandOrControlModifier(shortcuts) { +function* testCommandOrControlModifier(shortcuts) { info("Test CommandOrControl modifier"); let onKey = once(shortcuts, "CommandOrControl+F1", (key, event) => { is(event.keyCode, window.KeyboardEvent.DOM_VK_F1); @@ -330,7 +332,7 @@ function testCommandOrControlModifier(shortcuts) { yield onKeyAlias; } -function testCtrlModifier(shortcuts) { +function* testCtrlModifier(shortcuts) { info("Test Ctrl modifier"); let onKey = once(shortcuts, "Ctrl+F1", (key, event) => { is(event.keyCode, window.KeyboardEvent.DOM_VK_F1); @@ -354,7 +356,7 @@ function testCtrlModifier(shortcuts) { yield onKeyAlias; } -function testCmdShiftShortcut(shortcuts) { +function* testCmdShiftShortcut(shortcuts) { if (!isOSX) { // This test is OSX only (Bug 1300458). return; @@ -388,7 +390,7 @@ function testCmdShiftShortcut(shortcuts) { yield onCmdShiftKey; } -function testTarget() { +function* testTarget() { info("Test KeyShortcuts with target argument"); let target = document.createElementNS("http://www.w3.org/1999/xhtml", From 45e087064bdab4d3124bf79c3beb83e1f5eced88 Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Sat, 3 Sep 2016 10:27:46 -0400 Subject: [PATCH 03/11] Bug 1293789 - Single Local TC, mozharness bits. r=rail MozReview-Commit-ID: mH5MKaUodA --HG-- extra : rebase_source : cd223902bb8fcd4f0d4d926ad5d17dbf69d760f2 --- taskcluster/scripts/builder/build-l10n.sh | 0 .../mozilla-central_android-api-15.py | 2 + .../single_locale/tc_android_api_15.py | 30 +++++++ testing/mozharness/scripts/mobile_l10n.py | 86 +++++++++++++------ 4 files changed, 93 insertions(+), 25 deletions(-) mode change 100644 => 100755 taskcluster/scripts/builder/build-l10n.sh create mode 100644 testing/mozharness/configs/single_locale/tc_android_api_15.py diff --git a/taskcluster/scripts/builder/build-l10n.sh b/taskcluster/scripts/builder/build-l10n.sh old mode 100644 new mode 100755 diff --git a/testing/mozharness/configs/single_locale/mozilla-central_android-api-15.py b/testing/mozharness/configs/single_locale/mozilla-central_android-api-15.py index d2b6623c3305..63582a146c17 100644 --- a/testing/mozharness/configs/single_locale/mozilla-central_android-api-15.py +++ b/testing/mozharness/configs/single_locale/mozilla-central_android-api-15.py @@ -6,6 +6,8 @@ EN_US_BINARY_URL = "http://archive.mozilla.org/pub/mobile/nightly/latest-%s-andr HG_SHARE_BASE_DIR = "/builds/hg-shared" config = { + # XXX For Try + "update_gecko_source_to_enUS": False, "branch": BRANCH, "log_name": "single_locale", "objdir": OBJDIR, diff --git a/testing/mozharness/configs/single_locale/tc_android_api_15.py b/testing/mozharness/configs/single_locale/tc_android_api_15.py new file mode 100644 index 000000000000..f2b8c45d8f27 --- /dev/null +++ b/testing/mozharness/configs/single_locale/tc_android_api_15.py @@ -0,0 +1,30 @@ +import os + +config = { + "locales_file": "src/mobile/android/locales/all-locales", + "tools_repo": "https://hg.mozilla.org/build/tools", + "mozconfig": "src/mobile/android/config/mozconfigs/android-api-15/l10n-nightly", + "tooltool_config": { + "manifest": "mobile/android/config/tooltool-manifests/android/releng.manifest", + "output_dir": "%(abs_work_dir)s/src", + }, + #"tooltool_servers": ['http://relengapi/tooltool/'], + + #"bootstrap_env": { + # "NO_MERCURIAL_SETUP_CHECK": "1", + # "MOZ_OBJDIR": "obj-l10n", + # "EN_US_BINARY_URL": "%(en_us_binary_url)s", + # "LOCALE_MERGEDIR": "%(abs_merge_dir)s/", + # "MOZ_UPDATE_CHANNEL": "%(update_channel)s", + # "DIST": "%(abs_objdir)s", + # "LOCALE_MERGEDIR": "%(abs_merge_dir)s/", + # "L10NBASEDIR": "../../l10n", + # "MOZ_MAKE_COMPLETE_MAR": "1", + # 'TOOLTOOL_CACHE': os.environ.get('TOOLTOOL_CACHE'), + #}, + "upload_env": { + 'UPLOAD_HOST': 'localhost', + 'UPLOAD_PATH': '/home/worker/artifacts/', + }, + "mozilla_dir": "src/", +} diff --git a/testing/mozharness/scripts/mobile_l10n.py b/testing/mozharness/scripts/mobile_l10n.py index 06efe024ad2e..1b4938bc6b03 100755 --- a/testing/mozharness/scripts/mobile_l10n.py +++ b/testing/mozharness/scripts/mobile_l10n.py @@ -106,6 +106,19 @@ class MobileSingleLocale(MockMixin, LocalesMixin, ReleaseMixin, "type": "int", "help": "Specify the total number of chunks of locales" } + ], [ + ["--disable-mock"], + {"dest": "disable_mock", + "action": "store_true", + "help": "do not run under mock despite what gecko-config says", + } + ], [ + ['--revision', ], + {"action": "store", + "dest": "revision", + "type": "string", + "help": "Override the gecko revision to use (otherwise use buildbot supplied" + " value, or en-US revision) "} ]] def __init__(self, require_config_file=True): @@ -113,9 +126,11 @@ class MobileSingleLocale(MockMixin, LocalesMixin, ReleaseMixin, 'all_actions': [ "clobber", "pull", + "clone-locales", "list-locales", "setup", "repack", + "validate-repacks-signed", "upload-repacks", "create-virtualenv", "taskcluster-upload", @@ -356,6 +371,8 @@ class MobileSingleLocale(MockMixin, LocalesMixin, ReleaseMixin, repos = c['repos'] self.vcs_checkout_repos(repos, parent_dir=dirs['abs_work_dir'], tag_override=c.get('tag_override')) + + def clone_locales(self): self.pull_locale_source() # list_locales() is defined in LocalesMixin. @@ -396,7 +413,6 @@ class MobileSingleLocale(MockMixin, LocalesMixin, ReleaseMixin, mozconfig_path) # TODO stop using cat cat = self.query_exe("cat") - hg = self.query_exe("hg") make = self.query_exe("make") self.run_command_m([cat, mozconfig_path]) env = self.query_repack_env() @@ -416,29 +432,31 @@ class MobileSingleLocale(MockMixin, LocalesMixin, ReleaseMixin, env=env, error_list=MakefileErrorList, halt_on_failure=True) - revision = self.query_revision() - if not revision: - self.fatal("Can't determine revision!") - # TODO do this through VCSMixin instead of hardcoding hg - self.run_command_m([hg, "update", "-r", revision], - cwd=dirs["abs_mozilla_dir"], - env=env, - error_list=BaseErrorList, - halt_on_failure=True) - self.set_buildbot_property('revision', revision, write_to_file=True) - # Configure again since the hg update may have invalidated it. - buildid = self.query_buildid() - self._setup_configure(buildid=buildid) + + # on try we want the source we already have, otherwise update to the + # same as the en-US binary + if self.config.get("update_gecko_source_to_enUS", True): + revision = self.query_revision() + if not revision: + self.fatal("Can't determine revision!") + hg = self.query_exe("hg") + # TODO do this through VCSMixin instead of hardcoding hg + self.run_command_m([hg, "update", "-r", revision], + cwd=dirs["abs_mozilla_dir"], + env=env, + error_list=BaseErrorList, + halt_on_failure=True) + self.set_buildbot_property('revision', revision, write_to_file=True) + # Configure again since the hg update may have invalidated it. + buildid = self.query_buildid() + self._setup_configure(buildid=buildid) def repack(self): # TODO per-locale logs and reporting. - c = self.config dirs = self.query_abs_dirs() locales = self.query_locales() make = self.query_exe("make") repack_env = self.query_repack_env() - base_package_name = self.query_base_package_name() - base_package_dir = os.path.join(dirs['abs_objdir'], 'dist') success_count = total_count = 0 for locale in locales: total_count += 1 @@ -455,6 +473,20 @@ class MobileSingleLocale(MockMixin, LocalesMixin, ReleaseMixin, halt_on_failure=False): self.add_failure(locale, message="%s failed in make installers-%s!" % (locale, locale)) continue + success_count += 1 + self.summarize_success_count(success_count, total_count, + message="Repacked %d of %d binaries successfully.") + + def validate_repacks_signed(self): + c = self.config + dirs = self.query_abs_dirs() + locales = self.query_locales() + base_package_name = self.query_base_package_name() + base_package_dir = os.path.join(dirs['abs_objdir'], 'dist') + repack_env = self.query_repack_env() + success_count = total_count = 0 + for locale in locales: + total_count += 1 signed_path = os.path.join(base_package_dir, base_package_name % {'locale': locale}) # We need to wrap what this function does with mock, since @@ -473,7 +505,7 @@ class MobileSingleLocale(MockMixin, LocalesMixin, ReleaseMixin, continue success_count += 1 self.summarize_success_count(success_count, total_count, - message="Repacked %d of %d binaries successfully.") + message="Validated signatures on %d of %d binaries successfully.") def taskcluster_upload(self): auth = os.path.join(os.getcwd(), self.config['taskcluster_credentials_file']) @@ -579,20 +611,14 @@ class MobileSingleLocale(MockMixin, LocalesMixin, ReleaseMixin, continue package_name = base_package_name % {'locale': locale} r = re.compile("(http.*%s)" % package_name) - success = False for line in output.splitlines(): m = r.match(line) if m: self.upload_urls[locale] = m.groups()[0] self.info("Found upload url %s" % self.upload_urls[locale]) - success = True - if not success: - self.add_failure(locale, message="Failed to detect %s url in make upload!" % (locale)) - print output - continue success_count += 1 self.summarize_success_count(success_count, total_count, - message="Uploaded %d of %d binaries successfully.") + message="Make Upload for %d of %d locales successful.") def checkout_tools(self): dirs = self.query_abs_dirs() @@ -641,6 +667,16 @@ class MobileSingleLocale(MockMixin, LocalesMixin, ReleaseMixin, dirs = self.query_abs_dirs() locales = self.query_locales() + balrogReady = True + for locale in locales: + apk_url = self.query_upload_url(locale) + if not apk_url: + self.add_failure(locale, message="Failed to detect %s url in make upload!" % (locale)) + balrogReady = False + continue + if not balrogReady: + return self.fatal(message="Not all repacks successful, abort without submitting to balrog") + for locale in locales: apkfile = self.query_apkfile_path(locale) apk_url = self.query_upload_url(locale) From 7be2611be78e39af7ae00ed848bdcf16b03457d7 Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Sat, 3 Sep 2016 10:32:22 -0400 Subject: [PATCH 04/11] Bug 1293789 - Single Locale in TC - Add task def for try. r=rail MozReview-Commit-ID: 7n2NqqHj9wL --HG-- rename : testing/mozharness/configs/single_locale/tc_android_api_15.py => testing/mozharness/configs/single_locale/tc_android-api-15.py extra : rebase_source : 4a575d04ea6fac7078d483f00f169cfdb9ac5194 --- .../legacy/tasks/branches/base_job_flags.yml | 1 + .../ci/legacy/tasks/branches/base_jobs.yml | 2 + .../legacy/tasks/branches/try/job_flags.yml | 15 +++ .../tasks/builds/android_l10n_api_15.yml | 19 ++++ .../legacy/tasks/builds/android_l10n_base.yml | 52 ++++++++++ .../taskgraph/test/test_try_option_syntax.py | 6 +- taskcluster/taskgraph/try_option_syntax.py | 3 + .../single_locale/tc_android-api-15.py | 18 ++++ .../single_locale/tc_android_api_15.py | 30 ------ .../single_locale/try_android-api-15.py | 97 +++++++++++++++++++ 10 files changed, 212 insertions(+), 31 deletions(-) create mode 100644 taskcluster/ci/legacy/tasks/builds/android_l10n_api_15.yml create mode 100644 taskcluster/ci/legacy/tasks/builds/android_l10n_base.yml create mode 100644 testing/mozharness/configs/single_locale/tc_android-api-15.py delete mode 100644 testing/mozharness/configs/single_locale/tc_android_api_15.py create mode 100644 testing/mozharness/configs/single_locale/try_android-api-15.py diff --git a/taskcluster/ci/legacy/tasks/branches/base_job_flags.yml b/taskcluster/ci/legacy/tasks/branches/base_job_flags.yml index cb68181776ec..c5de3ce9f6ec 100644 --- a/taskcluster/ci/legacy/tasks/branches/base_job_flags.yml +++ b/taskcluster/ci/legacy/tasks/branches/base_job_flags.yml @@ -14,6 +14,7 @@ flags: - nexus-5l-eng - aries-eng - android-api-15 + - android-api-15-l10n - android-api-15-gradle - android-api-15-frontend - android-partner-sample1 diff --git a/taskcluster/ci/legacy/tasks/branches/base_jobs.yml b/taskcluster/ci/legacy/tasks/branches/base_jobs.yml index 012da45dfc65..cb184382ca03 100644 --- a/taskcluster/ci/legacy/tasks/branches/base_jobs.yml +++ b/taskcluster/ci/legacy/tasks/branches/base_jobs.yml @@ -9,6 +9,8 @@ builds: android-api-15: platforms: - Android + extra-builds: # see RIDEALONG_BUILDS in `mach taskgraph` + - android-api-15-l10n types: opt: task: tasks/builds/android_api_15.yml diff --git a/taskcluster/ci/legacy/tasks/branches/try/job_flags.yml b/taskcluster/ci/legacy/tasks/branches/try/job_flags.yml index 14d7c2027f24..45ca7908a9a3 100644 --- a/taskcluster/ci/legacy/tasks/branches/try/job_flags.yml +++ b/taskcluster/ci/legacy/tasks/branches/try/job_flags.yml @@ -121,6 +121,21 @@ builds: types: opt: task: tasks/builds/opt_macosx64_st-an.yml + android-api-15-l10n: + platforms: + - Android + types: + opt: + task: tasks/builds/android_l10n_api_15.yml + when: + file_patterns: + - mobile/android/locales/all-locales + - python/compare-locales/** + - testing/mozharness/configs/single_locale/** + - testing/mozharness/mozharness/mozilla/l10n/locales.py + - testing/mozharness/scripts/desktop_l10n.py + - toolkit/locales/** + - toolkit/mozapps/installer/** aries-eng: platforms: - b2g diff --git a/taskcluster/ci/legacy/tasks/builds/android_l10n_api_15.yml b/taskcluster/ci/legacy/tasks/builds/android_l10n_api_15.yml new file mode 100644 index 000000000000..92cd0d3d3c21 --- /dev/null +++ b/taskcluster/ci/legacy/tasks/builds/android_l10n_api_15.yml @@ -0,0 +1,19 @@ +$inherits: + from: 'tasks/builds/android_l10n_base.yml' + variables: + build_name: 'android-l10n' + platform: 'android-api-15' +task: + metadata: + name: '[TC] Android API 15 Single Locale Repack' + description: 'Android API 15 Single Locale Repack' + + workerType: 'android-api-15' + + extra: + treeherder: + groupSymbol: tc + groupName: Submitted by taskcluster + tier: 2 + symbol: L10n + diff --git a/taskcluster/ci/legacy/tasks/builds/android_l10n_base.yml b/taskcluster/ci/legacy/tasks/builds/android_l10n_base.yml new file mode 100644 index 000000000000..815f6f288a95 --- /dev/null +++ b/taskcluster/ci/legacy/tasks/builds/android_l10n_base.yml @@ -0,0 +1,52 @@ +$inherits: + from: 'tasks/l10n.yml' + variables: + platform: 'android-api-15' + build_name: 'android-l10n' + build_product: 'mobile' + build_type: 'opt' +docker-image: desktop-build +task: + scopes: + - 'docker-worker:cache:tooltool-cache' + - 'docker-worker:relengapi-proxy:tooltool.download.public' + - 'docker-worker:relengapi-proxy:tooltool.download.internal' + - 'docker-worker:cache:level-{{level}}-{{project}}-l10n-{{build_name}}-workspace' + + payload: + image: + type: 'task-image' + path: 'public/image.tar' + taskId: + task-reference: "" + cache: + tooltool-cache: '/home/worker/tooltool-cache' + level-{{level}}-{{project}}-l10n-{{build_name}}-workspace: '/home/worker/workspace' + + features: + relengAPIProxy: true + + env: + MOZHARNESS_SCRIPT: 'mozharness/scripts/mobile_l10n.py' + MOZHARNESS_CONFIG: 'single_locale/{{project}}_{{platform}}.py single_locale/tc_{{platform}}.py' + MOZHARNESS_ACTIONS: 'clone-locales list-locales setup repack upload-repacks summary' + MOZHARNESS_OPTIONS: 'total-chunks=1 this-chunk=1' + JOB_SCRIPT: 'taskcluster/scripts/builder/build-l10n.sh' + MH_BRANCH: {{project}} + MH_BUILD_POOL: taskcluster + # image paths + TOOLTOOL_CACHE: '/home/worker/tooltool-cache' + NEED_XVFB: true + + maxRunTime: 18000 + + command: ["/bin/bash", "bin/build.sh"] + + extra: + treeherderEnv: + - production + - staging + treeherder: + machine: + # see https://github.com/mozilla/treeherder/blob/master/ui/js/values.js + platform: {{platform}} diff --git a/taskcluster/taskgraph/test/test_try_option_syntax.py b/taskcluster/taskgraph/test/test_try_option_syntax.py index 8ac0ba869796..2fc71c4b2499 100644 --- a/taskcluster/taskgraph/test/test_try_option_syntax.py +++ b/taskcluster/taskgraph/test/test_try_option_syntax.py @@ -137,7 +137,11 @@ class TestTryOptionSyntax(unittest.TestCase): def test_p_expands_ridealongs(self): "-p linux,linux64 includes the RIDEALONG_BUILDS" tos = TryOptionSyntax('try: -p linux,linux64', empty_graph) - ridealongs = list(itertools.chain.from_iterable(RIDEALONG_BUILDS.itervalues())) + ridealongs = list(task + for task in itertools.chain.from_iterable( + RIDEALONG_BUILDS.itervalues() + ) + if 'android' not in task) # Don't include android-l10n self.assertEqual(sorted(tos.platforms), sorted(['linux', 'linux64'] + ridealongs)) def test_u_none(self): diff --git a/taskcluster/taskgraph/try_option_syntax.py b/taskcluster/taskgraph/try_option_syntax.py index d75dd5a6c8f2..a6c49fb4ea35 100644 --- a/taskcluster/taskgraph/try_option_syntax.py +++ b/taskcluster/taskgraph/try_option_syntax.py @@ -126,6 +126,9 @@ UNITTEST_PLATFORM_PRETTY_NAMES = { # least build-ish things. Sort of. Anyway, these other things are implemented # as different "platforms". RIDEALONG_BUILDS = { + 'android-api-15': [ + 'android-api-15-l10n', + ], 'linux': [ 'linux-l10n', ], diff --git a/testing/mozharness/configs/single_locale/tc_android-api-15.py b/testing/mozharness/configs/single_locale/tc_android-api-15.py new file mode 100644 index 000000000000..f15b254dce41 --- /dev/null +++ b/testing/mozharness/configs/single_locale/tc_android-api-15.py @@ -0,0 +1,18 @@ +import os + +config = { + "locales_file": "src/mobile/android/locales/all-locales", + "tools_repo": "https://hg.mozilla.org/build/tools", + "mozconfig": "src/mobile/android/config/mozconfigs/android-api-15/l10n-nightly", + "tooltool_config": { + "manifest": "mobile/android/config/tooltool-manifests/android/releng.manifest", + "output_dir": "%(abs_work_dir)s/src", + }, + "tooltool_servers": ['http://relengapi/tooltool/'], + + "upload_env": { + 'UPLOAD_HOST': 'localhost', + 'UPLOAD_PATH': '/home/worker/artifacts/', + }, + "mozilla_dir": "src/", +} diff --git a/testing/mozharness/configs/single_locale/tc_android_api_15.py b/testing/mozharness/configs/single_locale/tc_android_api_15.py deleted file mode 100644 index f2b8c45d8f27..000000000000 --- a/testing/mozharness/configs/single_locale/tc_android_api_15.py +++ /dev/null @@ -1,30 +0,0 @@ -import os - -config = { - "locales_file": "src/mobile/android/locales/all-locales", - "tools_repo": "https://hg.mozilla.org/build/tools", - "mozconfig": "src/mobile/android/config/mozconfigs/android-api-15/l10n-nightly", - "tooltool_config": { - "manifest": "mobile/android/config/tooltool-manifests/android/releng.manifest", - "output_dir": "%(abs_work_dir)s/src", - }, - #"tooltool_servers": ['http://relengapi/tooltool/'], - - #"bootstrap_env": { - # "NO_MERCURIAL_SETUP_CHECK": "1", - # "MOZ_OBJDIR": "obj-l10n", - # "EN_US_BINARY_URL": "%(en_us_binary_url)s", - # "LOCALE_MERGEDIR": "%(abs_merge_dir)s/", - # "MOZ_UPDATE_CHANNEL": "%(update_channel)s", - # "DIST": "%(abs_objdir)s", - # "LOCALE_MERGEDIR": "%(abs_merge_dir)s/", - # "L10NBASEDIR": "../../l10n", - # "MOZ_MAKE_COMPLETE_MAR": "1", - # 'TOOLTOOL_CACHE': os.environ.get('TOOLTOOL_CACHE'), - #}, - "upload_env": { - 'UPLOAD_HOST': 'localhost', - 'UPLOAD_PATH': '/home/worker/artifacts/', - }, - "mozilla_dir": "src/", -} diff --git a/testing/mozharness/configs/single_locale/try_android-api-15.py b/testing/mozharness/configs/single_locale/try_android-api-15.py new file mode 100644 index 000000000000..81a90bba6382 --- /dev/null +++ b/testing/mozharness/configs/single_locale/try_android-api-15.py @@ -0,0 +1,97 @@ +BRANCH = "try" +MOZILLA_DIR = BRANCH +EN_US_BINARY_URL = "http://archive.mozilla.org/pub/" \ + "mobile/nightly/latest-mozilla-central-android-api-15/en-US" + +config = { + "branch": "try", + "log_name": "single_locale", + "objdir": "obj-l10n", + "is_automation": True, + "buildbot_json_path": "buildprops.json", + "force_clobber": True, + "clobberer_url": "https://api.pub.build.mozilla.org/clobberer/lastclobber", + "locales_file": "%s/mobile/android/locales/all-locales" % MOZILLA_DIR, + "locales_dir": "mobile/android/locales", + "ignore_locales": ["en-US"], + "nightly_build": False, + 'balrog_credentials_file': 'oauth.txt', + "tools_repo": "https://hg.mozilla.org/build/tools", + "tooltool_config": { + "manifest": "mobile/android/config/tooltool-manifests/android/releng.manifest", + "output_dir": "%(abs_work_dir)s/" + MOZILLA_DIR, + }, + "exes": { + 'tooltool.py': '/builds/tooltool.py', + }, + "update_gecko_source_to_enUS": False, + "repos": [{ + "vcs": "hg", + "repo": "https://hg.mozilla.org/build/tools", + "branch": "default", + "dest": "tools", + }, { + "vcs": "hg", + "repo": "https://hg.mozilla.org/try", + "revision": "%(revision)s", + "dest": "try", + "clone_upstream_url": "https://hg.mozilla.org/mozilla-central", + "clone_by_revision": True, + "clone_with_purge": True, + }], + "hg_l10n_base": "https://hg.mozilla.org/l10n-central", + "hg_l10n_tag": "default", + 'vcs_share_base': "/builds/hg-shared", + + "l10n_dir": "l10n-central", + "repack_env": { + # so ugly, bug 951238 + "LD_LIBRARY_PATH": "/lib:/tools/gcc-4.7.2-0moz1/lib:/tools/gcc-4.7.2-0moz1/lib64", + "MOZ_OBJDIR": "obj-l10n", + "EN_US_BINARY_URL": EN_US_BINARY_URL, + "LOCALE_MERGEDIR": "%(abs_merge_dir)s/", + "MOZ_UPDATE_CHANNEL": "try", # XXX Invalid + }, + "upload_branch": "%s-android-api-15" % BRANCH, + "ssh_key_dir": "~/.ssh", + "merge_locales": True, + "mozilla_dir": MOZILLA_DIR, + "mozconfig": "%s/mobile/android/config/mozconfigs/android-api-15/l10n-nightly" % MOZILLA_DIR, + "signature_verification_script": "tools/release/signing/verify-android-signature.sh", + "stage_product": "mobile", + "platform": "android", # XXX Validate + "build_type": "api-15-opt", # XXX Validate + + # Balrog + "build_target": "Android_arm-eabi-gcc3", + + # Mock + "mock_target": "mozilla-centos6-x86_64-android", + "mock_packages": ['autoconf213', 'python', 'zip', 'mozilla-python27-mercurial', 'git', 'ccache', + 'glibc-static', 'libstdc++-static', 'perl-Test-Simple', 'perl-Config-General', + 'gtk2-devel', 'libnotify-devel', 'yasm', + 'alsa-lib-devel', 'libcurl-devel', + 'wireless-tools-devel', 'libX11-devel', + 'libXt-devel', 'mesa-libGL-devel', + 'gnome-vfs2-devel', 'GConf2-devel', 'wget', + 'mpfr', # required for system compiler + 'xorg-x11-font*', # fonts required for PGO + 'imake', # required for makedepend!?! + 'gcc45_0moz3', 'gcc454_0moz1', 'gcc472_0moz1', 'gcc473_0moz1', 'yasm', 'ccache', # <-- from releng repo + 'valgrind', 'dbus-x11', + 'pulseaudio-libs-devel', + 'gstreamer-devel', 'gstreamer-plugins-base-devel', + 'freetype-2.3.11-6.el6_1.8.x86_64', + 'freetype-devel-2.3.11-6.el6_1.8.x86_64', + 'java-1.7.0-openjdk-devel', + 'openssh-clients', + 'zlib-devel-1.2.3-27.el6.i686', + ], + "mock_files": [ + ("/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"), + ('/home/cltbld/.hgrc', '/builds/.hgrc'), + ('/builds/relengapi.tok', '/builds/relengapi.tok'), + ('/tools/tooltool.py', '/builds/tooltool.py'), + ('/usr/local/lib/hgext', '/usr/local/lib/hgext'), + ], +} From 27382a60380a10e6edffbbcc5b7ae2537cce5aa7 Mon Sep 17 00:00:00 2001 From: AdamG2 Date: Sat, 3 Sep 2016 15:26:40 -0400 Subject: [PATCH 05/11] Bug 1288745 - Remove TelemetryHistogram::NewHistogram and replace with predefined histograms. r=chutten MozReview-Commit-ID: 6v270MnquqT --HG-- extra : rebase_source : 0546095872930c726e2a9010adc7496d08a87d06 --- toolkit/components/telemetry/Histograms.json | 34 +++++++++++++++++++ toolkit/components/telemetry/Telemetry.cpp | 10 ------ .../telemetry/TelemetryHistogram.cpp | 29 ---------------- .../components/telemetry/TelemetryHistogram.h | 6 ---- toolkit/components/telemetry/nsITelemetry.idl | 33 +++++------------- .../tests/unit/test_TelemetrySession.js | 10 +++--- .../tests/unit/test_TelemetryStopwatch.js | 2 -- .../telemetry/tests/unit/test_nsITelemetry.js | 27 +++++++-------- 8 files changed, 59 insertions(+), 92 deletions(-) diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index afa74cbb7bf5..d233415ebbeb 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -5436,6 +5436,13 @@ "kind": "count", "description": "a testing histogram; not meant to be touched" }, + "TELEMETRY_TEST_COUNT2": { + "alert_emails": ["telemetry-client-dev@mozilla.com"], + "expires_in_version": "never", + "kind": "count", + "bug_numbers": [1288745], + "description": "a testing histogram; not meant to be touched" + }, "TELEMETRY_TEST_COUNT_INIT_NO_RECORD": { "expires_in_version": "never", "kind": "count", @@ -5511,6 +5518,33 @@ "releaseChannelCollection": "opt-out", "description": "a testing histogram; not meant to be touched" }, + "TELEMETRY_TEST_EXPONENTIAL": { + "alert_emails": ["telemetry-client-dev@mozilla.com"], + "expires_in_version": "never", + "kind": "exponential", + "low": 1, + "high": 2147483646, + "n_buckets": 10, + "bug_numbers": [1288745], + "description": "a testing histogram; not meant to be touched" + }, + "TELEMETRY_TEST_LINEAR": { + "alert_emails": ["telemetry-client-dev@mozilla.com"], + "expires_in_version": "never", + "kind": "linear", + "low": 1, + "high": 2147483646, + "n_buckets": 10, + "bug_numbers": [1288745], + "description": "a testing histogram; not meant to be touched" + }, + "TELEMETRY_TEST_BOOLEAN": { + "alert_emails": ["telemetry-client-dev@mozilla.com"], + "expires_in_version" : "never", + "kind": "boolean", + "bug_numbers": [1288745], + "description": "a testing histogram; not meant to be touched" + }, "STARTUP_CRASH_DETECTED": { "expires_in_version": "never", "kind": "flag", diff --git a/toolkit/components/telemetry/Telemetry.cpp b/toolkit/components/telemetry/Telemetry.cpp index 251bf8f3890e..f9854c70cd21 100644 --- a/toolkit/components/telemetry/Telemetry.cpp +++ b/toolkit/components/telemetry/Telemetry.cpp @@ -1030,16 +1030,6 @@ TelemetryImpl::InitMemoryReporter() { RegisterWeakMemoryReporter(this); } -NS_IMETHODIMP -TelemetryImpl::NewHistogram(const nsACString &name, const nsACString &expiration, uint32_t histogramType, - uint32_t min, uint32_t max, uint32_t bucketCount, JSContext *cx, - uint8_t optArgCount, JS::MutableHandle ret) -{ - return TelemetryHistogram::NewHistogram(name, expiration, histogramType, - min, max, bucketCount, - cx, optArgCount, ret); -} - NS_IMETHODIMP TelemetryImpl::NewKeyedHistogram(const nsACString &name, const nsACString &expiration, uint32_t histogramType, uint32_t min, uint32_t max, uint32_t bucketCount, JSContext *cx, diff --git a/toolkit/components/telemetry/TelemetryHistogram.cpp b/toolkit/components/telemetry/TelemetryHistogram.cpp index 29949b62ce45..c8711bee1243 100644 --- a/toolkit/components/telemetry/TelemetryHistogram.cpp +++ b/toolkit/components/telemetry/TelemetryHistogram.cpp @@ -2012,35 +2012,6 @@ TelemetryHistogram::GetHistogramName(mozilla::Telemetry::ID id) return h.id(); } -nsresult -TelemetryHistogram::NewHistogram(const nsACString &name, - const nsACString &expiration, - uint32_t histogramType, - uint32_t min, uint32_t max, - uint32_t bucketCount, JSContext *cx, - uint8_t optArgCount, - JS::MutableHandle ret) -{ - Histogram *h = nullptr; - { - StaticMutexAutoLock locker(gTelemetryHistogramMutex); - if (!internal_IsValidHistogramName(name)) { - return NS_ERROR_INVALID_ARG; - } - - nsresult rv = internal_HistogramGet(PromiseFlatCString(name).get(), - PromiseFlatCString(expiration).get(), - histogramType, min, max, bucketCount, - optArgCount == 3, &h); - if (NS_FAILED(rv)) - return rv; - h->ClearFlags(Histogram::kUmaTargetedHistogramFlag); - } - - // Runs without protection from |gTelemetryHistogramMutex| - return internal_WrapAndReturnHistogram(h, cx, ret); -} - nsresult TelemetryHistogram::NewKeyedHistogram(const nsACString &name, const nsACString &expiration, diff --git a/toolkit/components/telemetry/TelemetryHistogram.h b/toolkit/components/telemetry/TelemetryHistogram.h index a008de8d602b..4bb83dbf5f30 100644 --- a/toolkit/components/telemetry/TelemetryHistogram.h +++ b/toolkit/components/telemetry/TelemetryHistogram.h @@ -56,12 +56,6 @@ GetKeyedHistogramById(const nsACString &name, JSContext *cx, const char* GetHistogramName(mozilla::Telemetry::ID id); -nsresult -NewHistogram(const nsACString &name, const nsACString &expiration, - uint32_t histogramType, uint32_t min, uint32_t max, - uint32_t bucketCount, JSContext *cx, - uint8_t optArgCount, JS::MutableHandle ret); - nsresult NewKeyedHistogram(const nsACString &name, const nsACString &expiration, uint32_t histogramType, uint32_t min, uint32_t max, diff --git a/toolkit/components/telemetry/nsITelemetry.idl b/toolkit/components/telemetry/nsITelemetry.idl index 76a5639ad453..c992b2a8c32d 100644 --- a/toolkit/components/telemetry/nsITelemetry.idl +++ b/toolkit/components/telemetry/nsITelemetry.idl @@ -180,42 +180,29 @@ interface nsITelemetry : nsISupports [retval, array, size_is(count)] out string histograms); /** - * Create and return a histogram. Parameters: + * Create a histogram using the current state of an existing histogram. The + * existing histogram must be registered in TelemetryHistograms.h. * * @param name Unique histogram name - * @param expiration Expiration version - * @param type - HISTOGRAM_EXPONENTIAL, HISTOGRAM_LINEAR or HISTOGRAM_BOOLEAN - * @param min - Minimal bucket size - * @param max - Maximum bucket size - * @param bucket_count - number of buckets in the histogram. + * @param existing_name Existing histogram name * The returned object has the following functions: * add(int) - Adds an int value to the appropriate bucket * snapshot() - Returns a snapshot of the histogram with the same data fields as in histogramSnapshots() * clear() - Zeros out the histogram's buckets and sum * dataset() - identifies what dataset this is in: DATASET_RELEASE_CHANNEL_OPTOUT or ...OPTIN */ - [implicit_jscontext, optional_argc] - jsval newHistogram(in ACString name, in ACString expiration, - in unsigned long histogram_type, - [optional] in uint32_t min, - [optional] in uint32_t max, - [optional] in uint32_t bucket_count); - - /** - * Create a histogram using the current state of an existing histogram. The - * existing histogram must be registered in TelemetryHistograms.h. - * - * @param name Unique histogram name - * @param existing_name Existing histogram name - * The returned object has the same functions as a histogram returned from newHistogram. - */ [implicit_jscontext] jsval histogramFrom(in ACString name, in ACString existing_name); /** - * Same as newHistogram above, but for histograms registered in TelemetryHistograms.h. + * Create and return a histogram registered in TelemetryHistograms.h. * * @param id - unique identifier from TelemetryHistograms.h + * The returned object has the following functions: + * add(int) - Adds an int value to the appropriate bucket + * snapshot() - Returns a snapshot of the histogram with the same data fields as in histogramSnapshots() + * clear() - Zeros out the histogram's buckets and sum + * dataset() - identifies what dataset this is in: DATASET_RELEASE_CHANNEL_OPTOUT or ...OPTIN */ [implicit_jscontext] jsval getHistogramById(in ACString id); @@ -326,8 +313,6 @@ interface nsITelemetry : nsISupports * @param addon_id - Unique ID of the addon * @param name - Registered histogram name * - * The returned object has the same functions as a histogram returned - * from newHistogram. */ [implicit_jscontext] jsval getAddonHistogram(in ACString addon_id, in ACString name); diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js b/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js index 5bcfcb381d15..06cb7a5e75cf 100644 --- a/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js +++ b/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js @@ -39,7 +39,6 @@ const APP_VERSION = "1"; const APP_ID = "xpcshell@tests.mozilla.org"; const APP_NAME = "XPCShell"; -const IGNORE_HISTOGRAM = "test::ignore_me"; const IGNORE_HISTOGRAM_TO_CLONE = "MEMORY_HEAP_ALLOCATED"; const IGNORE_CLONED_HISTOGRAM = "test::ignore_me_also"; const ADDON_NAME = "Telemetry test addon"; @@ -109,7 +108,7 @@ function fakeIdleNotification(topic) { } function setupTestData() { - Telemetry.newHistogram(IGNORE_HISTOGRAM, "never", Telemetry.HISTOGRAM_BOOLEAN); + Telemetry.histogramFrom(IGNORE_CLONED_HISTOGRAM, IGNORE_HISTOGRAM_TO_CLONE); Services.startup.interrupted = true; Telemetry.registerAddonHistogram(ADDON_NAME, ADDON_HISTOGRAM, @@ -315,7 +314,7 @@ function checkPayload(payload, reason, successfulPings, savedPings) { Assert.ok(histogramName in payload.histograms, histogramName + " must be available."); } } - Assert.ok(!(IGNORE_HISTOGRAM in payload.histograms)); + Assert.ok(!(IGNORE_CLONED_HISTOGRAM in payload.histograms)); // Flag histograms should automagically spring to life. @@ -484,12 +483,11 @@ add_task(function* asyncSetup() { // Ensures that expired histograms are not part of the payload. add_task(function* test_expiredHistogram() { - let histogram_id = "FOOBAR"; - let dummy = Telemetry.newHistogram(histogram_id, "30", Telemetry.HISTOGRAM_EXPONENTIAL, 1, 2, 3); + + let dummy = Telemetry.getHistogramById("TELEMETRY_TEST_EXPIRED"); dummy.add(1); - do_check_eq(TelemetrySession.getPayload()["histograms"][histogram_id], undefined); do_check_eq(TelemetrySession.getPayload()["histograms"]["TELEMETRY_TEST_EXPIRED"], undefined); }); diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetryStopwatch.js b/toolkit/components/telemetry/tests/unit/test_TelemetryStopwatch.js index 219d77e36c56..8cb736dbdc54 100644 --- a/toolkit/components/telemetry/tests/unit/test_TelemetryStopwatch.js +++ b/toolkit/components/telemetry/tests/unit/test_TelemetryStopwatch.js @@ -5,8 +5,6 @@ var tmpScope = {}; Cu.import("resource://gre/modules/TelemetryStopwatch.jsm", tmpScope); var TelemetryStopwatch = tmpScope.TelemetryStopwatch; -// We can't create a histogram here since the ones created with -// newHistogram are not seen by getHistogramById that the module uses. const HIST_NAME = "TELEMETRY_PING"; const HIST_NAME2 = "RANGE_CHECKSUM_ERRORS"; const KEYED_HIST = { id: "TELEMETRY_INVALID_PING_TYPE_SUBMITTED", key: "TEST" }; diff --git a/toolkit/components/telemetry/tests/unit/test_nsITelemetry.js b/toolkit/components/telemetry/tests/unit/test_nsITelemetry.js index cd23f4f7d1e9..052551786386 100644 --- a/toolkit/components/telemetry/tests/unit/test_nsITelemetry.js +++ b/toolkit/components/telemetry/tests/unit/test_nsITelemetry.js @@ -57,7 +57,7 @@ function compareHistograms(h1, h2) { } function check_histogram(histogram_type, name, min, max, bucket_count) { - var h = Telemetry.newHistogram(name, "never", histogram_type, min, max, bucket_count); + var h = Telemetry.getHistogramById(name); var r = h.snapshot().ranges; var sum = 0; for (let i=0;i nh("test::min", "never", histogram_type, 0, max, bucket_count)); - expect_fail(() => nh("test::bucket_count", "never", histogram_type, min, max, 1)); + check_histogram(histogram_type, test_type, min, max, bucket_count); } }); @@ -142,7 +141,7 @@ add_task(function* test_noSerialization() { }); add_task(function* test_boolean_histogram() { - var h = Telemetry.newHistogram("test::boolean histogram", "never", Telemetry.HISTOGRAM_BOOLEAN); + var h = Telemetry.getHistogramById("TELEMETRY_TEST_BOOLEAN"); var r = h.snapshot().ranges; // boolean histograms ignore numeric parameters do_check_eq(uneval(r), uneval([0, 1, 2])) @@ -163,7 +162,7 @@ add_task(function* test_boolean_histogram() { }); add_task(function* test_flag_histogram() { - var h = Telemetry.newHistogram("test::flag histogram", "never", Telemetry.HISTOGRAM_FLAG); + var h = Telemetry.getHistogramById("TELEMETRY_TEST_FLAG"); var r = h.snapshot().ranges; // Flag histograms ignore numeric parameters. do_check_eq(uneval(r), uneval([0, 1, 2])); @@ -188,7 +187,7 @@ add_task(function* test_flag_histogram() { }); add_task(function* test_count_histogram() { - let h = Telemetry.newHistogram("test::count histogram", "never", Telemetry.HISTOGRAM_COUNT, 1, 2, 3); + let h = Telemetry.getHistogramById("TELEMETRY_TEST_COUNT2"); let s = h.snapshot(); do_check_eq(uneval(s.ranges), uneval([0, 1, 2])); do_check_eq(uneval(s.counts), uneval([0, 0, 0])); @@ -289,7 +288,7 @@ add_task(function* test_getWebrtc() { // Check that telemetry doesn't record in private mode add_task(function* test_privateMode() { - var h = Telemetry.newHistogram("test::private_mode_boolean", "never", Telemetry.HISTOGRAM_BOOLEAN); + var h = Telemetry.getHistogramById("TELEMETRY_TEST_BOOLEAN"); var orig = h.snapshot(); Telemetry.canRecordExtended = false; h.add(1); @@ -325,7 +324,7 @@ add_task(function* test_histogramRecording() { "Histograms should be equal after recording."); // Runtime created histograms should not be recorded. - h = Telemetry.newHistogram("test::runtime_created_boolean", "never", Telemetry.HISTOGRAM_BOOLEAN); + h = Telemetry.getHistogramById("TELEMETRY_TEST_BOOLEAN"); orig = h.snapshot(); h.add(1); Assert.equal(orig.sum, h.snapshot().sum, @@ -442,10 +441,9 @@ add_task(function* test_addons() { }); add_task(function* test_expired_histogram() { - var histogram_id = "FOOBAR"; var test_expired_id = "TELEMETRY_TEST_EXPIRED"; var clone_id = "ExpiredClone"; - var dummy = Telemetry.newHistogram(histogram_id, "28.0a1", Telemetry.HISTOGRAM_EXPONENTIAL, 1, 2, 3); + var dummy = Telemetry.getHistogramById(test_expired_id); var dummy_clone = Telemetry.histogramFrom(clone_id, test_expired_id); var rh = Telemetry.registeredHistograms(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, []); Assert.ok(!!rh); @@ -454,7 +452,6 @@ add_task(function* test_expired_histogram() { dummy_clone.add(1); do_check_eq(Telemetry.histogramSnapshots["__expired__"], undefined); - do_check_eq(Telemetry.histogramSnapshots[histogram_id], undefined); do_check_eq(Telemetry.histogramSnapshots[test_expired_id], undefined); do_check_eq(Telemetry.histogramSnapshots[clone_id], undefined); do_check_eq(rh[test_expired_id], undefined); From 44702e77ffd8868ab297cc0de180dd8e6b6b5da5 Mon Sep 17 00:00:00 2001 From: Johann Hofmann Date: Mon, 5 Sep 2016 14:38:32 +0200 Subject: [PATCH 06/11] Bug 1300495 - Remove UI leftovers from the pointerLock removal. r=dao MozReview-Commit-ID: 9ILNjTTYwbm --HG-- extra : rebase_source : bd6770b4a82639282d0467b60b7b5bb3346898ad --- browser/base/content/browser.xul | 4 ---- browser/base/content/popup-notifications.inc | 6 ------ browser/locales/en-US/chrome/browser/browser.dtd | 3 --- browser/themes/shared/notification-icons.inc.css | 11 ----------- browser/themes/shared/notification-icons.svg | 3 --- 5 files changed, 27 deletions(-) diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index 6de9144b33ee..092d1d61e439 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -704,8 +704,6 @@ aria-label="&urlbar.webRTCShareMicrophoneNotificationAnchor.label;"/> -