Bug 1039452 - Wait for the composition window to be focused before poping up menu. r+a=Standard8
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Tue, 09 Sep 2014 11:44:24 +0100
changeset 25464 e186316c0430cdb377621eda5f2ec606a72f3875
parent 25463 c193641bc0fa209fdfd4dff8874905974a4aa684
child 25465 a131772dfead70d5e9e5a3a6b09bc6eace8a1c47
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1039452
Bug 1039452 - Wait for the composition window to be focused before poping up menu. r+a=Standard8
mail/test/mozmill/composition/test-attachment-reminder.js
--- a/mail/test/mozmill/composition/test-attachment-reminder.js
+++ b/mail/test/mozmill/composition/test-attachment-reminder.js
@@ -68,22 +68,24 @@ function wait_for_reminder_state(aCwc, a
 /**
  * Check whether the manual reminder is in the proper state.
  *
  * @param aCwc      A compose window controller.
  * @param aChecked  Whether the reminder should be enabled.
  */
 function assert_manual_reminder_state(aCwc, aChecked) {
   // Check the reminder is really enabled.
+  wait_for_window_focused(aCwc.window);
   let attachment_menu = aCwc.click_menus_in_sequence(aCwc.e("button-attachPopup"),
                                                      [ ], true);
   let checkedValue = aChecked ? "true" : "false";
   assert_equals(aCwc.e("button-attachPopup_remindLaterItem").getAttribute("checked"),
                 checkedValue);
   aCwc.close_popup_sequence(attachment_menu);
+  wait_for_window_focused(aCwc.window);
 
   assert_equals(aCwc.e("cmd_remindLater").getAttribute("checked"), checkedValue);
 }
 
 /**
  * Test that the attachment reminder works, in general.
  */
 function test_attachment_reminder_appears_properly() {
@@ -209,18 +211,20 @@ function test_no_send_now_sends() {
 /**
  * Click the manual reminder in the menu.
  *
  * @param aCwc            A compose window controller.
  * @param aExpectedState  A boolean specifying what is the expected state
  *                        of the reminder menuitem after the click.
  */
 function click_manual_reminder(aCwc, aExpectedState) {
+  wait_for_window_focused(aCwc.window);
   aCwc.click_menus_in_sequence(aCwc.e("button-attachPopup"),
                                [ {id: "button-attachPopup_remindLaterItem"} ]);
+  wait_for_window_focused(aCwc.window);
   assert_manual_reminder_state(aCwc, aExpectedState);
 }
 
 /**
  * Bug 521128
  * Test proper behaviour of the manual reminder.
  */
 function test_manual_attachment_reminder() {