Bug 1573382 - Plan for alarm dialog earlier, in testAlarmDialog.js. r=pmorris
authorGeoff Lankow <geoff@darktrojan.net>
Tue, 13 Aug 2019 21:56:39 +1200
changeset 27317 c4e99f8017a764dcb8f1d9688e9bed2456b2884c
parent 27316 e056b7118c3a6b26fd06234b3bd66a8ca88aa938
child 27318 aa7d58ca2f4bb006d8b18c0a50a59368d8596a99
push id16279
push usermozilla@jorgk.com
push dateTue, 13 Aug 2019 21:57:47 +0000
treeherdercomm-central@c4e99f8017a7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspmorris
bugs1573382
Bug 1573382 - Plan for alarm dialog earlier, in testAlarmDialog.js. r=pmorris
calendar/test/mozmill/eventDialog/testAlarmDialog.js
--- a/calendar/test/mozmill/eventDialog/testAlarmDialog.js
+++ b/calendar/test/mozmill/eventDialog/testAlarmDialog.js
@@ -55,45 +55,45 @@ function testAlarmDialog() {
     invokeEventDialog(controller, null, (event, iframe) => {
         let { eid: eventid } = helpersForController(event);
 
         setData(event, iframe, {
             allday: true,
             reminder: "1day",
         });
 
-        event.click(eventid("button-saveandclose"));
-    });
+        // Prepare to dismiss the alarm.
+        plan_for_modal_dialog("Calendar:AlarmWindow", alarm => {
+            let { eid: alarmid } = helpersForController(alarm);
+            alarm.waitThenClick(alarmid("alarm-dismiss-all-button"));
+        });
 
-    // Dismiss the alarm.
-    plan_for_modal_dialog("Calendar:AlarmWindow", alarm => {
-        let { eid: alarmid } = helpersForController(alarm);
-        alarm.waitThenClick(alarmid("alarm-dismiss-all-button"));
+        event.click(eventid("button-saveandclose"));
     });
     wait_for_modal_dialog("Calendar:AlarmWindow", TIMEOUT_MODAL_DIALOG);
 
     // Change the reminder duration, this resets the alarm.
     let eventBox = lookupEventBox("day", ALLDAY, undefined, 1, undefined, EVENTPATH);
     invokeEventDialog(controller, eventBox, (event, iframe) => {
         let { eid: eventid } = helpersForController(event);
 
         setData(event, iframe, { reminder: "2days" });
 
-        event.click(eventid("button-saveandclose"));
-    });
+        // Prepare to snooze the alarm.
+        plan_for_modal_dialog("Calendar:AlarmWindow", alarm => {
+            let { eid: alarmid } = helpersForController(alarm);
+            let snoozeAllButton = alarmid("alarm-snooze-all-button");
+            let popup = alarmid("alarm-snooze-all-popup").getNode();
+            let menuitems = popup.querySelectorAll(":scope > menuitem");
 
-    // Snooze the alarm.
-    plan_for_modal_dialog("Calendar:AlarmWindow", alarm => {
-        let { eid: alarmid } = helpersForController(alarm);
-        let snoozeAllButton = alarmid("alarm-snooze-all-button");
-        let popup = alarmid("alarm-snooze-all-popup").getNode();
-        let menuitems = popup.querySelectorAll(":scope > menuitem");
+            alarm.waitThenClick(snoozeAllButton);
+            menuitems[5].click();
+        });
 
-        alarm.waitThenClick(snoozeAllButton);
-        menuitems[5].click();
+        event.click(eventid("button-saveandclose"));
     });
     wait_for_modal_dialog("Calendar:AlarmWindow", TIMEOUT_MODAL_DIALOG);
 }
 
 function teardownModule(module) {
     deleteCalendars(controller, CALENDARNAME);
     closeAllEventDialogs();
 }