diff --git a/testing/firefox-ui/tests/functional/keyboard_shortcuts/test_browser_window.py b/testing/firefox-ui/tests/functional/keyboard_shortcuts/test_browser_window.py index 5b656d0e5fd4..2b5eef630a6f 100644 --- a/testing/firefox-ui/tests/functional/keyboard_shortcuts/test_browser_window.py +++ b/testing/firefox-ui/tests/functional/keyboard_shortcuts/test_browser_window.py @@ -2,6 +2,9 @@ # 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/. +import sys +import unittest + from firefox_puppeteer import PuppeteerMixin from marionette_driver import Wait from marionette_harness import MarionetteTestCase @@ -54,3 +57,25 @@ class TestBrowserWindowShortcuts(PuppeteerMixin, MarionetteTestCase): return selection_name == "input" Wait(self.marionette).until(has_input_selected) + + +@unittest.skipIf(sys.platform == 'darwin', + 'Quit Shotcut not supported due to native menu of Mac OS') +class TestBrowserQuitShortcut(PuppeteerMixin, MarionetteTestCase): + + def test_quit_firefox_shortcut(self): + def quit_via_shortcut_callback(): + if self.puppeteer.platform == 'win': + key = 'quitApplicationCmdWin2.accesskey' + else: + key = 'quitApplicationCmdUnix.key' + + self.browser.send_shortcut(self.browser.localize_entity(key), + accel=True) + + self.marionette.quit(in_app=True, callback=quit_via_shortcut_callback) + self.assertIsNone(self.marionette.session) + + def tearDown(self): + self.marionette.start_session() + super(TestBrowserQuitShortcut, self).tearDown() diff --git a/testing/marionette/puppeteer/firefox/firefox_puppeteer/ui/windows.py b/testing/marionette/puppeteer/firefox/firefox_puppeteer/ui/windows.py index f81ba4b56869..7cf0e6946c4e 100644 --- a/testing/marionette/puppeteer/firefox/firefox_puppeteer/ui/windows.py +++ b/testing/marionette/puppeteer/firefox/firefox_puppeteer/ui/windows.py @@ -409,8 +409,7 @@ class BaseWindow(BaseLib): if kwargs[modifier] is True: keys.append(keymap[modifier]) - # Bug 1125209 - Only lower-case command keys should be sent - keys.append(command_key.lower()) + keys.append(command_key) self.switch_to()