Bug 1293505 - Part 3: Fix wrong key emulation in test_keycodes.xul. r=m_kato, a=ritu
authorMasayuki Nakano <masayuki@d-toybox.com>
Wed, 31 Aug 2016 17:36:53 +0900
changeset 347998 5968286c776b09bd2d008a9acf80ec0e7d667907
parent 347997 87c57eedbd7f0f4b45c5b421b4a9d434025c0570
child 347999 c234a630802402b5f1878d59a58cce0e79923e49
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersm_kato, ritu
bugs1293505
milestone50.0a2
Bug 1293505 - Part 3: Fix wrong key emulation in test_keycodes.xul. r=m_kato, a=ritu 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");