From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- .../test/xpcshell/test_ext_manifest_commands.js | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 browser/components/extensions/test/xpcshell/test_ext_manifest_commands.js (limited to 'browser/components/extensions/test/xpcshell/test_ext_manifest_commands.js') diff --git a/browser/components/extensions/test/xpcshell/test_ext_manifest_commands.js b/browser/components/extensions/test/xpcshell/test_ext_manifest_commands.js new file mode 100644 index 000000000..4de7afe01 --- /dev/null +++ b/browser/components/extensions/test/xpcshell/test_ext_manifest_commands.js @@ -0,0 +1,24 @@ +/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* vim: set sts=2 sw=2 et tw=80: */ +"use strict"; + + +add_task(function* test_manifest_commands() { + let normalized = yield ExtensionTestUtils.normalizeManifest({ + "commands": { + "toggle-feature": { + "suggested_key": {"default": "Shifty+Y"}, + "description": "Send a 'toggle-feature' event to the extension", + }, + }, + }); + + let expectedError = ( + String.raw`commands.toggle-feature.suggested_key.default: Value must either: ` + + String.raw`match the pattern /^\s*(Alt|Ctrl|Command|MacCtrl)\s*\+\s*(Shift\s*\+\s*)?([A-Z0-9]|Comma|Period|Home|End|PageUp|PageDown|Space|Insert|Delete|Up|Down|Left|Right)\s*$/, or ` + + String.raw`match the pattern /^(MediaNextTrack|MediaPlayPause|MediaPrevTrack|MediaStop)$/` + ); + + ok(normalized.error.includes(expectedError), + `The manifest error ${JSON.stringify(normalized.error)} must contain ${JSON.stringify(expectedError)}`); +}); -- cgit v1.2.3