Closed Bug 451952 Opened 16 years ago Closed 16 years ago

make test_idcheck.xul handle account-dependent mailnews windows

Categories

(SeaMonkey :: MailNews: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mnyromyr, Assigned: mnyromyr)

References

(Blocks 1 open bug)

Details

Attachments

(2 files, 6 obsolete files)

When writing test_idcheck.xul, I had to leave out 
  chrome://messenger/content/messenger.xul
  chrome://messenger/content/messengercompose/messengercompose.xul
  chrome://messenger/content/addressbook/addressbook.xul
because they require a mail account to work, hence the account wizard pops up, killing the test by timout.

This bug is about finding a way to check these main windows as well, maybe by setting up the account preferences in the test and deleting them again afterwards?
Version: unspecified → Trunk
This is something I haven't figured out yet. We've got various scenarios where doing chrome-level tests are going to want mail accounts etc setting up/to be available, and we won't really want the tests dependent on the previous leaving the data in an appropriate state.

For now, you could probably reuse some of the mail bloat test profile setup code, if I can get dmose to actually review it, and we'll figure out the rest later. Not sure how this would hook into the chrome test setup though.
This patch modifies the test profile preferences to contain at least one basic mail account (Local Folders for this special purpose), so that the account creation wizard does not chime in when testing ids.

Currently, this detects over 20 id collisions in mailnews/addressbook ui, which I will fix in subpatches here.
Assignee: nobody → mnyromyr
Attachment #337514 - Flags: superreview?(neil)
Attachment #337514 - Flags: review?(bugzilla)
Comment on attachment 337514 [details] [diff] [review]
activate double id check for mailnews

>+      // fake a mail account (Local folders in this case here)
>+      // to avoid the account creation wizard
nsIMessengerMigrator::createLocalMailAccount(false);

Or is that too simple?
(In reply to comment #3)
> (From update of attachment 337514 [details] [diff] [review])
> >+      // fake a mail account (Local folders in this case here)
> >+      // to avoid the account creation wizard
> nsIMessengerMigrator::createLocalMailAccount(false);
> 
> Or is that too simple?

Or just do it like we do for unit tests:

http://mxr.mozilla.org/comm-central/source/mailnews/test/resources/mailTestUtils.js#43
Attachment #337514 - Flags: superreview?(neil) → superreview-
Alas, unit test js files are not available to chrome tests, so I had to drag it into the chrome dir by some makefile voodoo...
Attachment #337514 - Attachment is obsolete: true
Attachment #338371 - Flags: superreview?(neil)
Attachment #338371 - Flags: review?(bugzilla)
Attachment #337514 - Flags: review?(bugzilla)
Attachment #338371 - Flags: superreview?(neil) → superreview+
Attached patch fix double ids in /mailnews, v1 (obsolete) — Splinter Review
Attachment #338400 - Flags: superreview?(neil)
Attachment #338400 - Flags: review?(iann_bugzilla)
Attached patch fix double ids, v1 (obsolete) — Splinter Review
(Forgot one file in /editor.)
Attachment #338400 - Attachment is obsolete: true
Attachment #338401 - Flags: superreview?(neil)
Attachment #338401 - Flags: review?(iann_bugzilla)
Attachment #338400 - Flags: superreview?(neil)
Attachment #338400 - Flags: review?(iann_bugzilla)
Comment on attachment 338401 [details] [diff] [review]
fix double ids, v1

>@@ -263,17 +261,16 @@ <commandset id="mailToolbarItems"
>   <command id="button_delete"/>
>   <command id="button_mark"/>
>   <command id="button_getNewMessages"/>
>   <command id="button_print"/>
>   <command id="button_next"/>
>   <command id="button_goBack"/>
>   <command id="button_goForward"/>
>   <command id="button_file"/>
>-  <command id="cmd_delete"/>
>   <command id="cmd_shiftDelete" oncommand="goDoCommand('cmd_shiftDelete');"/>
>   <command id="button_junk"/>
> </commandset>
I'm worried that this will break the delete key in certain edge cases, because it is updated when the focus changes (see FocusRingUpdate_Mail).

For example, put the focus in the empty quick search box, or on a special folder, and notice that the Delete menuitem is disabled. Then tab to the thread pane and press the delete key.
Attachment #338401 - Flags: superreview?(neil) → superreview-
Comment on attachment 338401 [details] [diff] [review]
fix double ids, v1

>-  <command id="cmd_delete"/>
Confirmed that this breaks updating the delete key when changing focus.

sr=me on the rest of the patch.
Like v2, but:
- checks messageWindow.xul, too
- moves charset list exception handling into its own function, 
  because we'll need it again when the languages pref panel gets in
  (it contains yet another RDF driven charset list)

Taking over sr, rerequesting r?.
Attachment #338371 - Attachment is obsolete: true
Attachment #338473 - Flags: superreview+
Attachment #338473 - Flags: review?(bugzilla)
Attachment #338371 - Flags: review?(bugzilla)
Attached patch fix double ids, v2 (obsolete) — Splinter Review
Same as v1, except special weirdoism for updating cmd_delete from somewhere else.

(Actually, I think that the way how goUpdateMailMenuItems works is not sane.)
Attachment #338401 - Attachment is obsolete: true
Attachment #338475 - Flags: superreview?(neil)
Attachment #338475 - Flags: review?(iann_bugzilla)
Attachment #338401 - Flags: review?(iann_bugzilla)
Comment on attachment 338475 [details] [diff] [review]
fix double ids, v2

>+  <command id="button_junk"/>
>   <command id="cmd_shiftDelete" oncommand="goDoCommand('cmd_shiftDelete');"/>
>-  <command id="button_junk"/>
Any particular reason to move this?

>+  <!-- avoid a double id cmd_delete, but make sure that the command update
>+       is available along with the other commands in this group -->
>+  <command commandupdater="true"
>+           events="mail-toolbar"
>+           oncommandupdate="goUpdateCommand('cmd_delete')"/>
Could you make this a commandset for consistency? Or just add the goUpdateCommand to the parent's oncommandupdate handler? Or maybe we should just fix FocusRingUpdate_Mail to update manually instead of via this commandset.
Same as v1, but moved the goUpdateCommand into the commandset handler. This does look much cleaner, indeed. 

If we need more instances of such special casing, we probably should just alter goUpdateMailMenuItems to check an attribute "updateid" before taking the element id...
Attachment #338475 - Attachment is obsolete: true
Attachment #338514 - Flags: superreview?(neil)
Attachment #338514 - Flags: review?(iann_bugzilla)
Attachment #338475 - Flags: superreview?(neil)
Attachment #338475 - Flags: review?(iann_bugzilla)
Attachment #338514 - Flags: superreview?(neil) → superreview+
No real changes from v3, just fixing the bustage which would have been caused by bug 444411. ;-)
Attachment #338514 - Attachment is obsolete: true
Attachment #338737 - Flags: superreview+
Attachment #338737 - Flags: review?(bugzilla)
Attachment #338514 - Flags: review?(iann_bugzilla)
Attachment #338737 - Attachment description: fix double ids, v4 → activate double id check for mailnews, v4
Attachment #338514 - Attachment is obsolete: false
Attachment #338514 - Flags: review?(iann_bugzilla)
Attachment #338473 - Attachment is obsolete: true
Attachment #338473 - Flags: review?(bugzilla)
Comment on attachment 338737 [details] [diff] [review]
activate double id check for mailnews, v4 [checked in]

r=me if you include the Makefile.in change from v2.
Attachment #338737 - Flags: review?(bugzilla) → review+
Attachment #338514 - Flags: review?(iann_bugzilla) → review+
Attachment #338514 - Flags: approval-seamonkey2.0a1+
Attachment #338737 - Flags: approval-seamonkey2.0a1+
Comment on attachment 338514 [details] [diff] [review]
fix double ids, v3 [checked in]

Landed on trunk as <http://hg.mozilla.org/comm-central/rev/6798c5a94726>.
Attachment #338514 - Attachment description: fix double ids, v3 → fix double ids, v3 [checked in]
Comment on attachment 338737 [details] [diff] [review]
activate double id check for mailnews, v4 [checked in]

Landed this along with the Makefile.in change of v2 on trunk as <http://hg.mozilla.org/comm-central/rev/cb70018a34dc>.
Attachment #338737 - Attachment description: activate double id check for mailnews, v4 → activate double id check for mailnews, v4 [checked in]
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Blocks: 455678
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: