[Pkg-mozext-commits] [compactheader] 370/441: Version 2.0.6beta5: Added Turkish translation. Added test for initalization of other action button.
David Prévot
taffit at moszumanska.debian.org
Wed Mar 18 12:29:18 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository compactheader.
commit 649dcd328fd7a268f21b331c20c67fb3c89eb245
Author: Joachim Herb <Joachim.Herb at gmx.de>
Date: Sat Jun 23 18:44:13 2012 +0200
Version 2.0.6beta5: Added Turkish translation. Added test for initalization of other action button.
--HG--
branch : more_button_tooltip_update
---
chrome.manifest | 13 +-
chrome/CompactHeader/content/toolbar.js | 6 +-
chrome/CompactHeader/locale/tr/CompactHeader.dtd | 40 +++
chrome/CompactHeader/locale/tr/preferences.dtd | 48 ++++
test/compactheader/test-ewait.js | 307 +++++++++++++++++++++++
test/compactheader/test-other-actions-button.js | 145 +++++++++++
6 files changed, 552 insertions(+), 7 deletions(-)
diff --git a/chrome.manifest b/chrome.manifest
index 39d9f72..9ba6e63 100644
--- a/chrome.manifest
+++ b/chrome.manifest
@@ -6,17 +6,18 @@ skin CompactHeader-os classic/1.0 chrome/CompactHeader/skin/gnome/ os=Li
skin CompactHeader-os classic/1.0 chrome/CompactHeader/skin/windows/ os=WINNT
skin CompactHeader-os classic/1.0 chrome/CompactHeader/skin/mac/ os=Darwin
-locale CompactHeader en-US chrome/CompactHeader/locale/en-US/
-locale CompactHeader de chrome/CompactHeader/locale/de/
-locale CompactHeader it chrome/CompactHeader/locale/it/
+locale CompactHeader cs chrome/CompactHeader/locale/cs/
locale CompactHeader da chrome/CompactHeader/locale/da/
-locale CompactHeader fr chrome/CompactHeader/locale/fr/
+locale CompactHeader de chrome/CompactHeader/locale/de/
+locale CompactHeader en-US chrome/CompactHeader/locale/en-US/
locale CompactHeader es-ES chrome/CompactHeader/locale/es-ES/
+locale CompactHeader fr chrome/CompactHeader/locale/fr/
+locale CompactHeader it chrome/CompactHeader/locale/it/
locale CompactHeader ja chrome/CompactHeader/locale/ja/
-locale CompactHeader ru chrome/CompactHeader/locale/ru/
locale CompactHeader pl chrome/CompactHeader/locale/pl/
+locale CompactHeader ru chrome/CompactHeader/locale/ru/
locale CompactHeader sr chrome/CompactHeader/locale/sr/
-locale CompactHeader cs chrome/CompactHeader/locale/cs/
+locale CompactHeader tr chrome/CompactHeader/locale/tr/
locale CompactHeader zh-CN chrome/CompactHeader/locale/zh-CN/
overlay chrome://messenger/content/msgHdrViewOverlay.xul chrome://CompactHeader/content/compactHeaderOverlay.xul appversion<9.0a1
diff --git a/chrome/CompactHeader/content/toolbar.js b/chrome/CompactHeader/content/toolbar.js
index 9ee90ae..c4b1140 100644
--- a/chrome/CompactHeader/content/toolbar.js
+++ b/chrome/CompactHeader/content/toolbar.js
@@ -62,7 +62,7 @@ org.mozdev.compactHeader.toolbar = function() {
let gOtherMenuCommands = {
otherActionsOpenConversation: "cmd_openConversation",
- otherActionsOpenInNewWindow: "cmd_openConversation",
+ otherActionsOpenInNewWindow: "cmd_openMessage",
otherActionsOpenInNewTab: "cmd_openMessage",
viewSourceMenuItem: "cmd_viewPageSource",
markAsReadMenuItem: "cmd_markAsRead",
@@ -175,6 +175,8 @@ org.mozdev.compactHeader.toolbar = function() {
var newParent = document.getElementById(target) ||
document.getElementById("header-view-toolbox").palette.getElementsByAttribute("id", target)[0];
+ org.mozdev.compactHeader.debug.log("looking for CompactHeader_hdrOtherActionsButton");
+
if (newParent != null) {
var myElement;
myElement= document.getElementById("otherActionsPopup");
@@ -182,7 +184,9 @@ org.mozdev.compactHeader.toolbar = function() {
newParent.appendChild(myElement);
for (let menu in gOtherMenuCommands) {
let menuEl = document.getElementById(menu);
+ org.mozdev.compactHeader.debug.log("command to " + menu);
if (menuEl) {
+ org.mozdev.compactHeader.debug.log("fillToolboxPalette add command to " + menu + ": " + gOtherMenuCommands[menu]);
menuEl.setAttribute("command", gOtherMenuCommands[menu]);
}
}
diff --git a/chrome/CompactHeader/locale/tr/CompactHeader.dtd b/chrome/CompactHeader/locale/tr/CompactHeader.dtd
new file mode 100644
index 0000000..d73b896
--- /dev/null
+++ b/chrome/CompactHeader/locale/tr/CompactHeader.dtd
@@ -0,0 +1,40 @@
+<!-- ***** BEGIN LICENSE BLOCK *****
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS IS" basis,
+ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ for the specific language governing rights and limitations under the
+ License.
+
+ The Original Code is Mozilla Communicator client code, released
+ March 31, 1998.
+
+ The Initial Developer of the Original Code is
+ Netscape Communications Corporation.
+ Portions created by the Initial Developer are Copyright (C) 1998-1999
+ the Initial Developer. All Rights Reserved.
+
+ Contributor(s):
+
+ Alternatively, the contents of this file may be used under the terms of
+ either the GNU General Public License Version 2 or later (the "GPL"), or
+ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ in which case the provisions of the GPL or the LGPL are applicable instead
+ of those above. If you wish to allow use of your version of this file only
+ under the terms of either the GPL or the LGPL, and not to allow others to
+ use your version of this file under the terms of the MPL, indicate your
+ decision by deleting the provisions above and replace them with the notice
+ and other provisions required by the GPL or the LGPL. If you do not delete
+ the provisions above, a recipient may use your version of this file under
+ the terms of any one of the MPL, the GPL or the LGPL.
+
+ ***** END LICENSE BLOCK *****
+-->
+<!ENTITY CompactHeader_hideDetailsButton.label "Detayları gizle">
+<!ENTITY CompactHeader_toggleDetails.key "h">
+<!ENTITY CompactHeader_showDetailsButton.label "Detayları göster">
diff --git a/chrome/CompactHeader/locale/tr/preferences.dtd b/chrome/CompactHeader/locale/tr/preferences.dtd
new file mode 100644
index 0000000..8bbe602
--- /dev/null
+++ b/chrome/CompactHeader/locale/tr/preferences.dtd
@@ -0,0 +1,48 @@
+<!-- ***** BEGIN LICENSE BLOCK *****
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS IS" basis,
+ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ for the specific language governing rights and limitations under the
+ License.
+
+ The Original Code is Mozilla Communicator client code, released
+ March 31, 1998.
+
+ The Initial Developer of the Original Code is
+ Netscape Communications Corporation.
+ Portions created by the Initial Developer are Copyright (C) 1998-1999
+ the Initial Developer. All Rights Reserved.
+
+ Contributor(s):
+
+ Alternatively, the contents of this file may be used under the terms of
+ either the GNU General Public License Version 2 or later (the "GPL"), or
+ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ in which case the provisions of the GPL or the LGPL are applicable instead
+ of those above. If you wish to allow use of your version of this file only
+ under the terms of either the GPL or the LGPL, and not to allow others to
+ use your version of this file under the terms of the MPL, indicate your
+ decision by deleting the provisions above and replace them with the notice
+ and other provisions required by the GPL or the LGPL. If you do not delete
+ the provisions above, a recipient may use your version of this file under
+ the terms of any one of the MPL, the GPL or the LGPL.
+
+ ***** END LICENSE BLOCK *****
+-->
+<!ENTITY CompactHeader_dialog.title "CompactHeader Tercihleri">
+<!ENTITY CompactHeader_checkbox.Compact.TwolineView.caption "Kompakt görünümde iki satır göster">
+<!ENTITY CompactHeader_menu.Linkify.caption "Rss beslemelerindeki konulara bağlantı">
+<!ENTITY CompactHeader_menu.ShowOnlyAddress.caption "Sadece adresleri göster">
+<!ENTITY CompactHeader_menu.flatButtons.caption "Düz düğmeler">
+<!ENTITY CompactHeader_radiobox.ToolbarPosition.caption "Başlık Çubuğu Pozisyonu">
+<!ENTITY CompactHeader_radiobox.ToolbarPosition.right "sağ">
+<!ENTITY CompactHeader_radiobox.ToolbarPosition.top "üst">
+<!ENTITY CompactHeader_radiobox.ToolbarPosition.left "sol">
+<!ENTITY CompactHeader_radiobox.ToolbarPosition.none "görünmez">
+<!ENTITY CompactHeader_menu.dblclick_header.caption "Başlığı çift tıklamayla aç-kapat">
diff --git a/test/compactheader/test-ewait.js b/test/compactheader/test-ewait.js
new file mode 100644
index 0000000..1afa496
--- /dev/null
+++ b/test/compactheader/test-ewait.js
@@ -0,0 +1,307 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Thunderbird Mail Client.
+ *
+ * The Initial Developer of the Original Code is
+ * the Mozilla Foundation.
+ * Portions created by the Initial Developer are Copyright (C) 2011
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Blake Winton <bwinton at latte.ca>
+ * Dan Mosedale <dmose at mozillamessaging.com>
+ * Joachim Herb <Joachim.Herb at gmx.de>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*
+ * Test that we can add a tag to a message without messing up the header.
+ */
+var MODULE_NAME = 'test-header-toolbar';
+
+var RELATIVE_ROOT = '../shared-modules';
+var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers',
+ 'address-book-helpers'];
+
+var elib = {};
+Cu.import('resource://mozmill/modules/elementslib.js', elib);
+var controller = {};
+Cu.import('resource://mozmill/modules/controller.js', controller);
+Cu.import("resource://gre/modules/Services.jsm");
+
+var folder;
+
+const USE_SHEET_PREF = "toolbar.customization.usesheet";
+
+function setupModule(module) {
+ let fdh = collector.getModule('folder-display-helpers');
+ fdh.installInto(module);
+ let wh = collector.getModule('window-helpers');
+ wh.installInto(module);
+ let abh = collector.getModule('address-book-helpers');
+ abh.installInto(module);
+
+ folder = create_folder("TestEwait");
+
+ let msg = create_message();
+ add_message_to_folder(folder, msg);
+}
+
+function teardownModule() {
+ Services.prefs.clearUserPref(USE_SHEET_PREF);
+}
+
+function test_with_sheet_dragndrop(){
+ select_message_in_folder(0);
+ Services.prefs.setBoolPref(USE_SHEET_PREF, true);
+ let ctc = open_header_pane_toolbar_customization(mc);
+
+ let firstButton = mc.e("wrapper-hdrTrashButton")
+ let listener = mc.e("header-view-toolbar");
+ let target = ctc.e("palette-box");
+
+ drag_n_drop_element(firstButton, mc.window, target,
+ ctc.window, 0.5, 0.5, listener)
+
+ let secondButton = ctc.e("wrapper-spacer");
+ target = mc.e("header-view-toolbar");
+ listener = ctc.e("palette-box");
+
+ drag_n_drop_element(secondButton, ctc.window, target,
+ mc.window, 0.99, 0.5, listener)
+
+ close_header_pane_toolbar_customization(ctc);
+
+ firstButton = mc.e("hdrTrashButton")
+ assert_equals(firstButton, null);
+}
+
+
+/**
+ * Select message in current (global) folder.
+ */
+function select_message_in_folder(aMessageNum)
+{
+ be_in_folder(folder);
+
+ // select and open the first message
+ let curMessage = select_click_row(aMessageNum);
+
+ // make sure it loads
+ wait_for_message_display_completion(mc);
+ assert_selected_and_displayed(mc, curMessage);
+
+ return curMessage;
+}
+
+/*
+ * Open the header pane toolbar customization dialog.
+ */
+function open_header_pane_toolbar_customization(aController)
+{
+ let ctc;
+ aController.click(aController.eid("CustomizeHeaderToolbar"));
+ // Depending on preferences the customization dialog is
+ // either a normal window or embedded into a sheet.
+ if (Services.prefs.getBoolPref(USE_SHEET_PREF, true)) {
+ ctc = wait_for_frame_load(aController.e("customizeToolbarSheetIFrame"),
+ "chrome://global/content/customizeToolbar.xul"); }
+ else {
+ ctc = wait_for_existing_window("CustomizeToolbarWindow");
+ }
+ return ctc;
+}
+
+function close_header_pane_toolbar_customization(aController)
+{
+ aController.click(aController.eid("donebutton"));
+ // XXX There should be an equivalent for testing the closure of
+ // XXX the dialog embedded in a sheet, but I do not know how.
+ if (!Services.prefs.getBoolPref(USE_SHEET_PREF, true)) {
+ assert_true(aController.window.closed, "The customization dialog is not closed.");
+ }
+}
+
+
+// taken form test-mouse-event-helpers:
+
+/**
+ * Execute a drag and drop session.
+ * @param {XULElement} aDragObject
+ * the element from which the drag session should be started.
+ * @param {} aDragWindow
+ * the window the aDragObject is in
+ * @param {XULElement} aDropObject
+ * the element at which the drag session should be ended.
+ * @param {} aDropWindow
+ * the window the aDropObject is in
+ * @param {} aRelDropX
+ * the relative x-position the element is dropped over the aDropObject
+ * in percent of the aDropObject width
+ * @param {} aRelDropY
+ * the relative y-position the element is dropped over the aDropObject
+ * in percent of the aDropObject height
+ * @param {XULElement} aListener
+ * the element who's drop target should be captured and returned.
+ */
+function drag_n_drop_element(aDragObject, aDragWindow, aDropObject,
+ aDropWindow, aRelDropX, aRelDropY, aListener)
+{
+ let dt = synthesize_drag_start(aDragWindow, aDragObject, aListener);
+ assert_true(dt, "Drag target was undefined");
+
+ synthesize_drag_over(aDropWindow, aDropObject, dt);
+
+ synthesize_drop(aDropWindow, aDropObject, dt,
+ { screenX : aDropObject.boxObject.screenX +
+ (aDropObject.boxObject.width * aRelDropX),
+ screenY : aDropObject.boxObject.screenY +
+ (aDropObject.boxObject.width * aRelDropY)
+ });
+}
+
+/**
+ * Starts a drag new session.
+ * @param {} aWindow
+ * @param {XULElement} aDispatcher
+ * the element from which the drag session should be started.
+ * @param {XULElement} aListener
+ * the element who's drop target should be captured and returned.
+ * @return {nsIDataTransfer}
+ * returns the DataTransfer Object of captured by aListener.
+ */
+function synthesize_drag_start(aWindow, aDispatcher, aListener)
+{
+ let dt;
+
+ var trapDrag = function(event) {
+
+ if ( !event.dataTransfer )
+ throw "no DataTransfer";
+
+ dt = event.dataTransfer;
+
+ //event.stopPropagation();
+ event.preventDefault();
+ };
+
+ aListener.addEventListener("dragstart", trapDrag, true);
+
+ EventUtils.synthesizeMouse(aDispatcher, 5, 5, {type:"mousedown"}, aWindow);
+ EventUtils.synthesizeMouse(aDispatcher, 5, 10, {type:"mousemove"}, aWindow);
+ EventUtils.synthesizeMouse(aDispatcher, 5, 15, {type:"mousemove"}, aWindow);
+
+ aListener.removeEventListener("dragstart", trapDrag, true);
+
+ return dt;
+}
+
+/**
+ * Synthesizes a drag over event.
+ * @param {} aWindow
+ * @param {XULElement} aDispatcher
+ * the element from which the drag session should be started.
+ * @param {nsIDataTransfer} aDt
+ * the DataTransfer Object of captured by listener.
+ * @param {} aArgs
+ * arguments passed to the mouse event.
+ */
+function synthesize_drag_over(aWindow, aDispatcher, aDt, aArgs)
+{
+ _synthesizeDragEvent("dragover", aWindow, aDispatcher, aDt, aArgs);
+}
+
+/**
+ * Synthesizes a drag end event.
+ * @param {} aWindow
+ * @param {XULElement} aDispatcher
+ * the element from which the drag session should be started.
+ * @param {nsIDataTransfer} aDt
+ * the DataTransfer Object of captured by listener.
+ * @param {} aArgs
+ * arguments passed to the mouse event.
+ */
+function synthesize_drag_end(aWindow, aDispatcher, aListener, aDt, aArgs)
+{
+ _synthesizeDragEvent("dragend", aWindow, aListener, aDt, aArgs);
+
+ //Ensure drag has ended.
+ EventUtils.synthesizeMouse(aDispatcher, 5, 5, {type:"mousemove"}, aWindow);
+ EventUtils.synthesizeMouse(aDispatcher, 5, 10, {type:"mousemove"}, aWindow);
+ EventUtils.synthesizeMouse(aDispatcher, 5, 5, {type:"mouseup"}, aWindow);
+}
+
+/**
+ * Synthesizes a drop oevent.
+ * @param {} aWindow
+ * @param {XULElement} aDispatcher
+ * the element from which the drag session should be started.
+ * @param {nsIDataTransfer} aDt
+ * the DataTransfer Object of captured by listener.
+ * @param {} aArgs
+ * arguments passed to the mouse event.
+ */
+function synthesize_drop(aWindow, aDispatcher, aDt, aArgs)
+{
+ _synthesizeDragEvent("drop", aWindow, aDispatcher, aDt, aArgs);
+
+ // Ensure drag has ended.
+ EventUtils.synthesizeMouse(aDispatcher, 5, 5, {type:"mousemove"}, aWindow);
+ EventUtils.synthesizeMouse(aDispatcher, 5, 10, {type:"mousemove"}, aWindow);
+ EventUtils.synthesizeMouse(aDispatcher, 5, 5, {type:"mouseup"}, aWindow);
+}
+
+/**
+ * Private function: Synthesizes a specified drag event.
+ * @param {} aType
+ * the type of the drag event to be synthesiyzed.
+ * @param {} aWindow
+ * @param {XULElement} aDispatcher
+ * the element from which the drag session should be started.
+ * @param {nsIDataTransfer} aDt
+ * the DataTransfer Object of captured by listener.
+ * @param {} aArgs
+ * arguments passed to the mouse event.
+ */
+function _synthesizeDragEvent(aType, aWindow, aDispatcher, aDt, aArgs)
+{
+ let screenX;
+ if (aArgs && ("screenX" in aArgs))
+ screenX = aArgs.screenX;
+ else
+ screenX = aDispatcher.boxObject.ScreenX;
+
+ let screenY;
+ if (aArgs && ("screenY" in aArgs))
+ screenY = aArgs.screenY;
+ else
+ screenY = aDispatcher.boxObject.ScreenY;
+
+ let event = aWindow.document.createEvent("DragEvents");
+ event.initDragEvent(aType, true, true, aWindow, 0,
+ screenX, screenY, 0, 0, false, false, false, false, 0, null, aDt);
+ aDispatcher.dispatchEvent(event);
+}
diff --git a/test/compactheader/test-other-actions-button.js b/test/compactheader/test-other-actions-button.js
new file mode 100644
index 0000000..493f01b
--- /dev/null
+++ b/test/compactheader/test-other-actions-button.js
@@ -0,0 +1,145 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Thunderbird Mail Client.
+ *
+ * The Initial Developer of the Original Code is
+ * the Mozilla Foundation.
+ * Portions created by the Initial Developer are Copyright (C) 2009
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Joachim Herb <Joachim.Herb at gmx.de>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+var MODULE_NAME = 'test-other-actions-button';
+
+var RELATIVE_ROOT = '../shared-modules';
+var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers',
+ 'address-book-helpers', 'mouse-event-helpers',
+ 'compactheader-helpers'];
+
+var elib = {};
+Cu.import('resource://mozmill/modules/elementslib.js', elib);
+var controller = {};
+Cu.import('resource://mozmill/modules/controller.js', controller);
+
+// The WindowHelper module
+var WindowHelper;
+
+var folder1;
+
+function setupModule(module) {
+ let fdh = collector.getModule('folder-display-helpers');
+ fdh.installInto(module);
+ WindowHelper = collector.getModule('window-helpers');
+ WindowHelper.installInto(module);
+ let abh = collector.getModule('address-book-helpers');
+ abh.installInto(module);
+ let meh = collector.getModule('mouse-event-helpers');
+ meh.installInto(module);
+ let chh = collector.getModule('compactheader-helpers');
+ chh.installInto(module);
+
+ folder1 = create_folder("testOtherActionButton");
+
+ let thread1 = create_thread(2);
+ add_sets_to_folders([folder1], [thread1]);
+
+ let msg = create_message();
+ add_message_to_folder(folder1, msg);
+
+ let msg2 = create_message();
+ add_message_to_folder(folder1, msg2);
+
+ let abwc = openAddressBook();
+ close3PaneWindow();
+ mc = open3PaneWindow();
+ abwc.window.close();
+
+ select_message_in_folder(folder1, 0, mc);
+}
+
+/* click the more button in compact view should change to expanded
+ * header view
+ */
+function test_other_actions_button() {
+ select_message_in_folder(folder1, 0, mc);
+ open_preferences_dialog(mc, set_preferences_twoline);
+ mc.sleep(10);
+ restore_and_check_default_buttons(mc);
+ collapse_and_assert_header(mc);
+ set_and_assert_toolbox_position(mc, 'right');
+
+ // It is necessary to press the Other Actions Button to get the popup menu populated
+ mc.click(mc.eid("CompactHeader_hdrOtherActionsButton"));
+ mc.ewait("CompactHeader_hidecohePreferencesButton");
+ mc.click(mc.eid("CompactHeader_hdrOtherActionsButton"));
+
+ let menuItems = {
+ "otherActionsOpenConversation": false, // always disabled, probably because messages are not indexed
+ "otherActionsOpenInNewWindow": true,
+ "otherActionsOpenInNewTab": true,
+ "CompactHeader_hdrPane-markFlagged": true,
+ "viewSourceMenuItem": true,
+ //"markAsReadMenuItem": true, // this does not work, because the message is already set to read
+ "markAsUnreadMenuItem": true,
+ "saveAsMenuItem": true,
+ "otherActionsPrint": true
+ };
+
+ for (let menu in menuItems) {
+ let menuEl = mc.e(menu);
+ assert_equals(menuEl.hasAttribute("disabled"), !menuItems[menu], menu);
+ }
+
+ select_none();
+ assert_nothing_selected();
+
+ // It is necessary to press the Other Actions Button to get the popup menu populated
+ mc.click(mc.eid("CompactHeader_hdrOtherActionsButton"));
+ mc.ewait("CompactHeader_hidecohePreferencesButton");
+ mc.click(mc.eid("CompactHeader_hdrOtherActionsButton"));
+
+ for (let menu in menuItems) {
+ let menuEl = mc.e(menu);
+ assert_equals(menuEl.getAttribute("disabled"), "true", menu);
+ }
+
+ select_message_in_folder(folder1, 3, mc);
+ select_control_click_row(0);
+ assert_selected_and_displayed(0, 3);
+
+ mc.click(mc.eid("CompactHeader_hdrOtherActionsButton"));
+ mc.ewait("CompactHeader_hidecohePreferencesButton");
+ mc.click(mc.eid("CompactHeader_hdrOtherActionsButton"));
+
+ for (let menu in menuItems) {
+ let menuEl = mc.e(menu);
+ assert_equals(menuEl.hasAttribute("disabled"), !menuItems[menu], menu);
+ }
+
+}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/compactheader.git
More information about the Pkg-mozext-commits
mailing list