Bug 616797 relanding backed-out test for the bug r=enn, a=final+
authorMasayuki Nakano <masayuki@d-toybox.com>
Thu, 09 Dec 2010 14:52:33 +0900
changeset 58934 b2aeaf724c8d1fa3665074470ef9ff93261dbd85
parent 58933 7284451662bfc0d17a7bab31ba85206182f0e930
child 58935 0bd4cd152565778060d85170c9eb5e1289df9ef2
push id17472
push usermasayuki@d-toybox.com
push dateThu, 09 Dec 2010 05:52:50 +0000
treeherdermozilla-central@b2aeaf724c8d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersenn, final
bugs616797
milestone2.0b8pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 616797 relanding backed-out test for the bug r=enn, a=final+
toolkit/content/tests/widgets/window_menubar.xul
--- a/toolkit/content/tests/widgets/window_menubar.xul
+++ b/toolkit/content/tests/widgets/window_menubar.xul
@@ -562,16 +562,70 @@ var popupTests = [
     synthesizeKey("VK_ALT", { type: "keydown" });
     synthesizeMouse(document.getElementById("menubar"), 8, -30, { type: "mouseup", altKey: true });
     synthesizeKey("VK_ALT", { type: "keydown" });
     synthesizeKey("VK_ALT", { type: "keyup" });
   },
   result: function (testname) {
     checkActive(document.getElementById("menubar"), "", testname);
   }
+},
+
+// Fllowing 4 tests are a test of bug 616797, don't insert any new tests
+// between them.
+{
+  testname: "Open file menu by accelerator",
+  condition: function() { return (navigator.platform.indexOf("Win") == 0) },
+  events: function() {
+    return [ "DOMMenuBarActive menubar", "popupshowing filepopup",
+             "DOMMenuItemActive filemenu", "DOMMenuItemActive item1",
+             "popupshown filepopup" ];
+  },
+  test: function() {
+    synthesizeKey("VK_ALT", { type: "keydown" });
+    synthesizeKey("F", { altKey: true });
+    synthesizeKey("VK_ALT", { type: "keyup" });
+  }
+},
+{
+  testname: "Close file menu by click at outside of popup menu",
+  condition: function() { return (navigator.platform.indexOf("Win") == 0) },
+  events: function() {
+    return [ "popuphiding filepopup", "popuphidden filepopup",
+             "DOMMenuItemInactive item1", "DOMMenuInactive filepopup",
+             "DOMMenuBarInactive menubar", "DOMMenuItemInactive filemenu",
+             "DOMMenuItemInactive filemenu" ];
+  },
+  test: function() {
+    // XXX hidePopup() causes DOMMenuItemInactive event to be fired twice.
+    document.getElementById("filepopup").hidePopup();
+  }
+},
+{
+  testname: "Alt keydown set focus the menubar",
+  condition: function() { return (navigator.platform.indexOf("Win") == 0) },
+  events: function() {
+    return [ "DOMMenuBarActive menubar", "DOMMenuItemActive filemenu" ];
+  },
+  test: function() {
+    synthesizeKey("VK_ALT", {  });
+  },
+  result: function (testname) {
+    checkClosed("filemenu", testname);
+  }
+},
+{
+  testname: "unset focus the menubar",
+  condition: function() { return (navigator.platform.indexOf("Win") == 0) },
+  events: function() {
+    return [ "DOMMenuBarInactive menubar", "DOMMenuItemInactive filemenu" ];
+  },
+  test: function() {
+    synthesizeKey("VK_ALT", {  });
+  }
 }
 
 ];
 
 ]]>
 </script>