Bug 1631902 Comment 32 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

New version of part2 that updates and expands the `browser_import.js` test to cover the new import dialog.  Besides changes to that test file, there are only a few differences from the previous version of the patch, namely these:

```
--- a/calendar/base/content/import-export.js
+++ b/calendar/base/content/import-export.js
@@ -15,37 +15,38 @@ var MODE_WRONLY = 0x02;
 var MODE_CREATE = 0x08;
 var MODE_TRUNCATE = 0x20;
 
 /**
  * Loads events from a file into a calendar. If called without a file argument,
  * the user is asked to pick a file.
  *
  * @param {nsIFile} [fileArg] - Optional, a file to load events from.
- * @return {Promise<boolean>} True if the import succeeded, false if not (e.g.
- *                            user canceled the file picker dialog).
+ * @return {Promise<boolean>} True if the import dialog was opened, false if
+ *                              not (e.g. on cancel of file picker dialog).
  */
 async function loadEventsFromFile(fileArg) {
   let file = fileArg;
   if (!file) {
     file = await pickFileToImport();
     if (!file) {
       // Probably the user clicked "cancel" (no file and the promise was not
       // rejected in pickFileToImport).
-      return;
+      return false;
     }
   }
 
   Services.ww.openWindow(
     null,
     "chrome://calendar/content/calendar-ics-file-dialog.xhtml",
     "_blank",
     "chrome,titlebar,modal,centerscreen",
     file
   );
+  return true;
 }
```
Tests pass locally, have not tried a try run yet due to current bustage.
New version of part2 that updates and expands the `browser_import.js` test to cover the new import dialog.  Besides changes to that test file, there are only a few differences from the previous version of the patch, namely these:

```
--- a/calendar/base/content/import-export.js
+++ b/calendar/base/content/import-export.js
 
 /**
  * Loads events from a file into a calendar. If called without a file argument,
  * the user is asked to pick a file.
  *
  * @param {nsIFile} [fileArg] - Optional, a file to load events from.
- * @return {Promise<boolean>} True if the import succeeded, false if not (e.g.
- *                            user canceled the file picker dialog).
+ * @return {Promise<boolean>} True if the import dialog was opened, false if
+ *                              not (e.g. on cancel of file picker dialog).
  */
 async function loadEventsFromFile(fileArg) {
   let file = fileArg;
   if (!file) {
     file = await pickFileToImport();
     if (!file) {
       // Probably the user clicked "cancel" (no file and the promise was not
       // rejected in pickFileToImport).
-      return;
+      return false;
     }
   }
 
   Services.ww.openWindow(
     null,
     "chrome://calendar/content/calendar-ics-file-dialog.xhtml",
     "_blank",
     "chrome,titlebar,modal,centerscreen",
     file
   );
+  return true;
 }
```
Tests pass locally, have not tried a try run yet due to current bustage.

Back to Bug 1631902 Comment 32