Bug 1293505 part.3 Fix wrong key emulation in test_keycodes.xul r?m_kato draft
authorMasayuki Nakano <masayuki@d-toybox.com>
Wed, 31 Aug 2016 17:36:53 +0900
changeset 407954 8fecd92a7184cab20529b6545071bdd3e251f926
parent 407953 ba3ab697a2b18409cba7426757a0a7eb56517035
child 530004 78a36ec31eb0b24e5531129f7fbf337c43075c7b
push id28102
push usermasayuki@d-toybox.com
push dateWed, 31 Aug 2016 11:43:53 +0000
reviewersm_kato
bugs1293505
milestone51.0a1
Bug 1293505 part.3 Fix wrong key emulation in test_keycodes.xul r?m_kato Some tests in test_keycodes.xul emulate native key event with printable character even when Ctrl or Alt key is pressed. With en-US keyboard layout, Ctrl+[A-Z] causes a control character's WM_CHAR message. However, the other OEM keys and numeric keys don't cause WM_CHAR message when Ctrl is pressed. So, we need to fix some wrong emulations in it now. MozReview-Commit-ID: bhF5XeClnd
widget/tests/test_keycodes.xul
--- a/widget/tests/test_keycodes.xul
+++ b/widget/tests/test_keycodes.xul
@@ -3239,26 +3239,26 @@ function* runXULKeyTests()
                           modifiers:{metaKey:1}, chars:"'", unmodifiedChars:"'"},
                          "reservedUnshiftedKey");
     yield testKeyElement({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Quote,
                           modifiers:{metaKey:1, shiftKey:1}, chars:"\"", unmodifiedChars:"'"},
                          "reservedShiftedKey");
   }
   else if (IS_WIN) {
     yield testKeyElement({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_1,
-                          modifiers:{ctrlKey:1}, chars:";"},
+                          modifiers:{ctrlKey:1}, chars:""},
                          "unshiftedKey");
     yield testKeyElement({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_1,
-                          modifiers:{ctrlKey:1, shiftKey:1}, chars:";"},
+                          modifiers:{ctrlKey:1, shiftKey:1}, chars:""},
                          "shiftedKey");
     yield testKeyElement({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_7,
-                          modifiers:{ctrlKey:1}, chars:"'"},
+                          modifiers:{ctrlKey:1}, chars:""},
                          "reservedUnshiftedKey");
     yield testKeyElement({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_7,
-                          modifiers:{ctrlKey:1, shiftKey:1}, chars:"'"},
+                          modifiers:{ctrlKey:1, shiftKey:1}, chars:""},
                          "reservedShiftedKey");
   }
 
   // 429160
   if (IS_MAC) {
     yield testKeyElement({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F,
                           modifiers:{metaKey:1, altKey:1}, chars:"\u0192", unmodifiedChars:"f"},
                          "commandOptionF");
@@ -3434,17 +3434,17 @@ function* runReservedKeyTests()
 
   if (IS_MAC) {
     // Cmd+T is reserved for opening new tab.
     yield testReservedKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_T,
                            modifiers:{metaKey:1}, chars:"t", unmodifiedChars:"t"});
   } else if (IS_WIN) {
     // Ctrl+T is reserved for opening new tab.
     yield testReservedKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_T,
-                           modifiers:{ctrlKey:1}, chars:"t"});
+                           modifiers:{ctrlKey:1}, chars:"\u0014"});
   }
 
   finializeKeyElementTest();
 }
 
 function* runTextInputTests()
 {
   var textbox = document.getElementById("textbox");