[Pkg-mozext-commits] [compactheader] 239/441: Added another testcase
David Prévot
taffit at moszumanska.debian.org
Wed Mar 18 12:29:03 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 93c72387404493b7657e25a55e9cf7e4f9cb978f
Author: Joachim.Herb at gmx.de <Joachim.Herb at gmx.de>
Date: Sat Jul 30 23:56:55 2011 +0200
Added another testcase
--HG--
branch : mozmill
---
test/compactheader/test-compactheader-toolbar.js | 138 +++++++++++++++++++++--
test/download.sh | 16 +--
2 files changed, 134 insertions(+), 20 deletions(-)
diff --git a/test/compactheader/test-compactheader-toolbar.js b/test/compactheader/test-compactheader-toolbar.js
index c92f5f9..efa5e9d 100644
--- a/test/compactheader/test-compactheader-toolbar.js
+++ b/test/compactheader/test-compactheader-toolbar.js
@@ -37,9 +37,6 @@
*
* ***** 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';
@@ -96,7 +93,7 @@ function setupModule(module) {
* Make sure that opening the header toolbar customization dialog
* does not break the get messages button in main toolbar
*/
-function test_get_msg_button_customize_header_toolbar(){
+function disable_test_get_msg_button_customize_header_toolbar(){
select_message_in_folder(0);
// It is necessary to press the Get Message Button to get the popup menu populated
@@ -129,7 +126,7 @@ function test_get_msg_button_customize_header_toolbar(){
/**
* Test header pane toolbar customization: Check for default button sets
*/
-function test_customize_header_toolbar_check_default()
+function disable_test_customize_header_toolbar_check_default()
{
let curMessage = select_message_in_folder(0);
let hdrToolbar = mc.eid("header-view-toolbar").node;
@@ -168,7 +165,7 @@ function test_customize_header_toolbar_check_default()
///**
// * Test header pane toolbar customization: Reorder buttons
// */
-function test_customize_header_toolbar_reorder_buttons()
+function disable_test_customize_header_toolbar_reorder_buttons()
{
let curMessage = select_message_in_folder(0);
@@ -217,7 +214,7 @@ function test_customize_header_toolbar_reorder_buttons()
// * Test header pane toolbar customization: Change buttons in
// * separate mail window
// */
-function test_customize_header_toolbar_separate_window()
+function disable_test_customize_header_toolbar_separate_window()
{
let curMessage = select_message_in_folder(0);
@@ -289,7 +286,7 @@ function test_customize_header_toolbar_separate_window()
/**
* Test header pane toolbar customization: Remove buttons
*/
-function test_customize_header_toolbar_remove_buttons(){
+function disable_test_customize_header_toolbar_remove_buttons(){
// Save currentset of toolbar for adding the buttons back
// at the end.
var lCurrentset;
@@ -369,9 +366,130 @@ function test_customize_header_toolbar_remove_buttons(){
}
/**
+ * Test header pane toolbar customization: Add all buttons to toolbar
+ */
+function test_customize_header_toolbar_add_all_buttons(){
+
+ select_message_in_folder(0);
+
+ // Restore the default buttons to get defined starting conditions.
+ restore_and_check_default_buttons(mc);
+
+ let toolbar = mc.eid("header-view-toolbar").node;
+ let lCurrentset = filterInvisibleButtons(mc, toolbar.currentSet).split(",");
+
+ // Get all buttons in the palette and move them to toolbar
+ let ctc = open_header_pane_toolbar_customization(mc);
+ let palette = ctc.e("palette-box");
+ let tmp = ctc.window.document.getElementById("palette-box").
+ getElementsByTagName("toolbarpaletteitem");
+
+ let wrappedButtons = new Array;
+ let buttons = new Array;
+ for (let i=0; i<tmp.length; i++) {
+ let type = tmp[i].getAttribute("type");
+ if ((type != "separator") &&
+ (type != "spring") &&
+ (type != "spacer")
+ ) {
+ wrappedButtons.push(tmp[i].id)
+ buttons.push(tmp[i].id.replace(new RegExp("wrapper-"), ""));
+ }
+ }
+
+ for (let i=0; i<wrappedButtons.length; i++) {
+ let button = ctc.e(wrappedButtons[i]);
+ // Drop each button to the right end of the toolbar.
+ drag_n_drop_element(button, ctc.window, toolbar, mc.window, 0.99, 0.5, palette);
+ }
+ close_header_pane_toolbar_customization(ctc);
+
+
+ // All buttons have shown up in the toolbar
+ let fullButtonSet = lCurrentset.concat(buttons).join(",");
+ assert_equals(filterInvisibleButtons(mc, toolbar.currentSet),
+ fullButtonSet);
+
+ // No buttons are left in the palette
+ // Get all buttons in the palette and move them to toolbar
+ let ctc = open_header_pane_toolbar_customization(mc);
+ let palette = ctc.e("palette-box");
+ let tmp = ctc.window.document.getElementById("palette-box").
+ getElementsByTagName("toolbarpaletteitem");
+
+ let leftButtons = new Array;
+ for (let i=0; i<tmp.length; i++) {
+ let type = tmp[i].getAttribute("type");
+ if ((type != "separator") &&
+ (type != "spring") &&
+ (type != "spacer")
+ ) {
+ leftButtons.push(tmp[i].id)
+ }
+ }
+ assert_equals(leftButtons.length, 0);
+ close_header_pane_toolbar_customization(ctc);
+
+ // Move the buttons back to palette
+ let ctc = open_header_pane_toolbar_customization(mc);
+ let target = ctc.e("palette-box");
+ for (let i=0; i<wrappedButtons.length; i++) {
+ let button = mc.e(wrappedButtons[i]);
+ drag_n_drop_element(button, mc.window, target, ctc.window, 0.5, 0.5, toolbar);
+ }
+ close_header_pane_toolbar_customization(ctc);
+
+ // Only defaults button are left in the toolbar
+ let hdrBarDefaultSet = toolbar.getAttribute("defaultset");
+ assert_equals(filterInvisibleButtons(mc, toolbar.currentSet),
+ filterInvisibleButtons(mc, hdrBarDefaultSet));
+ assert_equals(filterInvisibleButtons(mc, toolbar.getAttribute("currentset")),
+ filterInvisibleButtons(mc, hdrBarDefaultSet));
+
+ // All buttons have shown up in the palette
+ let ctc = open_header_pane_toolbar_customization(mc);
+ let backButtons = new Array;
+ let tmp = ctc.window.document.getElementById("palette-box").
+ getElementsByTagName("toolbarpaletteitem");
+ for (let i=0; i<tmp.length; i++) {
+ let type = tmp[i].getAttribute("type");
+ if ((type != "separator") &&
+ (type != "spring") &&
+ (type != "spacer")
+ ) {
+ backButtons.push(tmp[i].id)
+ }
+ }
+ assert_equals(backButtons.join(","), wrappedButtons.join(","));
+ close_header_pane_toolbar_customization(ctc);
+
+ // Reopen customization dialog and
+ // all buttons are still in the palette
+ let ctc = open_header_pane_toolbar_customization(mc);
+
+ let backButtons = new Array;
+ let tmp = ctc.window.document.getElementById("palette-box").
+ getElementsByTagName("toolbarpaletteitem");
+ for (let i=0; i<tmp.length; i++) {
+ let type = tmp[i].getAttribute("type");
+ if ((type != "separator") &&
+ (type != "spring") &&
+ (type != "spacer")
+ ) {
+ backButtons.push(tmp[i].id)
+ }
+ }
+ assert_equals(backButtons.join(","), wrappedButtons.join(","));
+
+ close_header_pane_toolbar_customization(ctc);
+
+}
+
+
+/**
* Test header pane toolbar customization dialog layout
*/
-function test_customize_header_toolbar_dialog_style(){
+function disable_test_customize_header_toolbar_dialog_style(){
select_message_in_folder(0);
// Restore the default buttons to get defined starting conditions.
@@ -408,7 +526,7 @@ function test_customize_header_toolbar_dialog_style(){
/**
* Test header pane toolbar customization dialog for button style changes
*/
-function test_customize_header_toolbar_change_button_style(){
+function disable_test_customize_header_toolbar_change_button_style(){
select_message_in_folder(0);
// Restore the default buttons to get defined starting conditions.
diff --git a/test/download.sh b/test/download.sh
index 0bc17bf..f53f928 100755
--- a/test/download.sh
+++ b/test/download.sh
@@ -3,29 +3,25 @@
if [ $OSTYPE == msys ] ; then
export FTP_DIR=https://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/5.0-candidates/build1/unsigned/win32/en-US/
export APP=thunderbird-5.0.zip
- export TESTS=thunderbird-5.0.tests.zip
- export XPI=../../../AMO/CompactHeader-1.4.2beta3.xpi
- export TESTDIR=test-5.0
export UNPACK="unzip"
export UNPACKARGS="-o"
export UNPACKTARGETOPT="-d"
export APPBIN="thunderbird.exe"
-elif [[ $OSTYPE == *linux* ]] ; then
+elif [[ $OSTYPE == *linux* ]] ; then
# export FTP_DIR=https://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/5.0-candidates/build1/linux-i686/en-US/
export FTP_DIR=https://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/5.0-candidates/build1/linux-x86_64/en-US/
export APP=thunderbird-5.0.tar.bz2
- export TESTS=thunderbird-5.0.tests.zip
- export XPI=../../../AMO/CompactHeader-1.4.2beta3.xpi
- export TESTDIR=test-5.0
export UNPACK="tar"
export UNPACKARGS="xjvf"
export UNPACKTARGETOPT="-C"
export APPBIN="thunderbird"
-else
+else
echo "OS not supported"
return 1;
fi
-
+export TESTS=thunderbird-5.0.tests.zip
+export XPI=../../../AMO/CompactHeader-1.4.2beta3.xpi
+export TESTDIR=test-5.0
wget -P ftp -N $FTP_DIR/$APP
wget -P ftp -N $FTP_DIR/$TESTS
@@ -43,7 +39,7 @@ else
fi
# copy drag'n'drop helpers to shared-modules until they are added to thunderbird source
-cp -v shared-modules/test-mouse-event-helpers.js $TESTDIR/mozmill/shared-modules
+cp -v shared-modules/* $TESTDIR/mozmill/shared-modules
cd $TESTDIR/mozmill
--
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