Bug 1553778 - adjust test-ttachment-menus.js and test-attachment.js for the toolbarbutton de-xbl. rs=bustage-fix
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Fri, 24 May 2019 15:23:12 +0300
changeset 35683 222e2a74d5dab0d18f6b46308923cbd70abdaa8e
parent 35682 1aa9b4cb10abaf12f2c3eadae52c6ae32f3f10d2
child 35684 8187a5f97b447dbc16ccbd525a81c0ec9e200df7
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersbustage-fix
bugs1553778
Bug 1553778 - adjust test-ttachment-menus.js and test-attachment.js for the toolbarbutton de-xbl. rs=bustage-fix
mail/test/mozmill/attachment/test-attachment-menus.js
mail/test/mozmill/attachment/test-attachment.js
--- a/mail/test/mozmill/attachment/test-attachment-menus.js
+++ b/mail/test/mozmill/attachment/test-attachment-menus.js
@@ -297,18 +297,18 @@ function assert_enabled(id, enabled) {
 function check_toolbar_menu_states_single(expected) {
   assert_shown("attachmentSaveAllSingle", true);
   assert_shown("attachmentSaveAllMultiple", false);
 
   if (expected.save === false) {
     assert_enabled("attachmentSaveAllSingle", false);
   } else {
     assert_enabled("attachmentSaveAllSingle", true);
-    mc.click(mc.aid("attachmentSaveAllSingle",
-                    {"class": "toolbarbutton-menubutton-dropmarker"}));
+    mc.click(new elementslib.Elem(mc.e("attachmentSaveAllSingle").
+      querySelector(".toolbarbutton-menubutton-dropmarker")));
     wait_for_popup_to_open(mc.e("attachmentSaveAllSingleMenu"));
 
     try {
       assert_enabled("button-openAttachment", expected.open);
       assert_enabled("button-saveAttachment", expected.save);
       assert_enabled("button-detachAttachment", expected.detach);
       assert_enabled("button-deleteAttachment", expected.delete_);
     } catch (e) {
@@ -327,18 +327,19 @@ function check_toolbar_menu_states_singl
 function check_toolbar_menu_states_multiple(expected) {
   assert_shown("attachmentSaveAllSingle", false);
   assert_shown("attachmentSaveAllMultiple", true);
 
   if (expected.save === false) {
     assert_enabled("attachmentSaveAllMultiple", false);
   } else {
     assert_enabled("attachmentSaveAllMultiple", true);
-    mc.click(mc.aid("attachmentSaveAllMultiple",
-                    {"class": "toolbarbutton-menubutton-dropmarker"}));
+    mc.click(new elementslib.Elem(mc.e("attachmentSaveAllMultiple").
+      querySelector(".toolbarbutton-menubutton-dropmarker")));
+    
     wait_for_popup_to_open(mc.e("attachmentSaveAllMultipleMenu"));
 
     try {
       assert_enabled("button-openAllAttachments", expected.open);
       assert_enabled("button-saveAllAttachments", expected.save);
       assert_enabled("button-detachAllAttachments", expected.detach);
       assert_enabled("button-deleteAllAttachments", expected.delete_);
     } catch (e) {
--- a/mail/test/mozmill/attachment/test-attachment.js
+++ b/mail/test/mozmill/attachment/test-attachment.js
@@ -30,22 +30,19 @@ var textAttachment =
   "that happens someone like myself who has gone through an ordeal and who " +
   "genuinely needs hot coffee to pick him up and keep him functioning when " +
   "he has to function will get the hot coffee whether he happens to have a " +
   "poscred readily available or not.";
 
 var binaryAttachment = textAttachment;
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-  let wh = collector.getModule("window-helpers");
-  wh.installInto(module);
-  let composeHelper = collector.getModule("compose-helpers");
-  composeHelper.installInto(module);
+  for (let lib of MODULE_REQUIRES) {
+    collector.getModule(lib).installInto(module);
+  }
 
   folder = create_folder("AttachmentA");
 
   var attachedMessage = msgGen.makeMessage({
     body: { body: "I'm an attached email!" },
     attachments: [{ body: textAttachment,
                     filename: "inner attachment.txt",
                     format: "" }],
@@ -335,18 +332,18 @@ function test_attachment_list_expansion(
   subtest_attachment_list_toggle("attachmentToggle");
   subtest_attachment_list_toggle("attachmentIcon");
   subtest_attachment_list_toggle("attachmentCount");
   subtest_attachment_list_toggle("attachmentSize");
   subtest_attachment_list_toggle("attachmentBar");
 
   // Ensure that clicking the "Save All" button doesn't expand the attachment
   // list.
-  mc.click(mc.aid("attachmentSaveAllSingle",
-                  {class: "toolbarbutton-menubutton-dropmarker"}));
+  mc.click(new elementslib.Elem(mc.e("attachmentSaveAllSingle").
+    querySelector(".toolbarbutton-menubutton-dropmarker")));
   assert_true(mc.e("attachmentList").collapsed, "Attachment list should be " +
               "collapsed after clicking save button!");
 }
 
 function test_attachment_list_starts_expanded() {
   ensure_starts_expanded(true);
   be_in_folder(folder);