[Exception... "'JavaScript component does not have a method named: "alert"' when calling method: [nsIPromptService::alert]" nsresult: "0x80570030 (NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED)" location: "JS frame :: chrome://messenger/content/FilterEdit

RESOLVED FIXED in Thunderbird 24.0

Status

Thunderbird
Filters
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: ISHIKAWA, Chiaki, Assigned: aceman)

Tracking

(Blocks: 1 bug)

Trunk
Thunderbird 24.0
All
Linux
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(4 attachments)

(Reporter)

Description

4 years ago
Created attachment 699961 [details]
Session log of test_can_cancel_quit_on_filter_changes

While testing thunderbird (debug build of comm-central source, but the
error should be visible in normal build also) by running 
"make mozmill" locally, I noticed about occurrences NS_ERROR_* thrown and
not caught.  
One of them is this bug. 

Exception is not caught: NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED

************************************************************
* Call to xpconnect wrapped JSObject produced this error:  *
[Exception... "'JavaScript component does not have a method named: "alert"' when calling method: [nsIPromptService::alert]"  nsresult: "0x80570030 (NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED)"  location: "JS frame :: chrome://messenger/content/FilterEditor.js :: saveFilter :: line 364"	 data: no]
************************************************************


version info of source files.
$ cd /home/ishikawa/TB-NEW/TB-3HG/new-src
$ hg identify
54a7a86bf250+ tip

$ cd mozilla || exit 1
$ pwd
/home/ishikawa/TB-NEW/TB-3HG/new-src/mozilla
$ hg identify
33064e13c3fd+ tip

Since the session log of a particular test target, "test_can_cancel_quit_on_filter_changes", is lengthy, I am attaching the log as an attachment.

TIA
(Reporter)

Updated

4 years ago
Blocks: 826967
(Reporter)

Comment 1

4 years ago
Created attachment 699969 [details]
The same session log with fixed stack trace.

I noticed that there is an ASSERTION message toward the end of the session. (Not related to this bug.)

Just for the sake of completeness,
I ran fix-linux-stack.pl (In comm-central it is below mozilla/tools/rb/fix-linux-stack.pl) under the same directory where the tested TB binary is located,
e.g.
under /TB-NEW/TB-3HG/objdir-tb3/mozilla/dist/bin

../../../../new-src/mozilla/tools/rb/fix-linux-stack.pl ~/Dropbox/t-alert.txt > ~/Dropbox/t-alert-fixed-stack.txt

and attaching it.

Comment 2

4 years ago
(In reply to ISHIKAWA, chiaki from comment #0)
> While testing thunderbird (debug build of comm-central source, but the
> error should be visible in normal build also) by running 
> "make mozmill" locally, I noticed about occurrences NS_ERROR_* thrown and
> not caught.  
> One of them is this bug. 
> 
> Exception is not caught: NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED
> 
> ************************************************************
> * Call to xpconnect wrapped JSObject produced this error:  *
> [Exception... "'JavaScript component does not have a method named: "alert"'
> when calling method: [nsIPromptService::alert]"  nsresult: "0x80570030
> (NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED)"  location: "JS frame ::
> chrome://messenger/content/FilterEditor.js :: saveFilter :: line 364"	 data:
> no]
> ************************************************************
This error appears to be related to attempting to save a duplicate filter name. Is this the intention of the test? Perhaps mozmill replaces the prompt service to avoid blocking the UI.
There's a mock prompt service that's replacing nsIPromptService:

http://hg.mozilla.org/comm-central/annotate/8a07c456aaa6/mail/test/mozmill/shared-modules/test-prompt-helpers.js#l77

It doesn't have an alert() function, but probably should do. A good question first though, is to find out what it is trying to prompt about and see if that relates to the test at all (hint: add an alert function and dump the message passed to it).
(Reporter)

Comment 4

4 years ago
(In reply to Mark Banner (:standard8) from comment #3)
> A good question
> first though, is to find out what it is trying to prompt about and see if
> that relates to the test at all (hint: add an alert function and dump the
> message passed to it).

If someone can add this alert() function in the test-prompt-helpers.js function,
I would be happy to run the test with the resulting js file.

I searched for 'alert' using http://mxr.mozilla.org/comm-central/ident?i=alert&filter=

but I am not sure which function to emulate. (there are versions of alert() that take different number of arguments, even.)

TIA
(Assignee)

Comment 5

4 years ago
Created attachment 748522 [details] [diff] [review]
patch

I think the duplicate filter should not be created for the test to work.

I also think that the filter window tests from this file should be moved to a separate directory as they are quite hidden now in 'folder-widget'. And we plan to have more filter editor mozmill tests so they should be grouped logically.
Assignee: nobody → acelists
Status: NEW → ASSIGNED
Attachment #748522 - Flags: review?(kent)
Attachment #748522 - Flags: feedback?(ishikawa)

Comment 6

4 years ago
Comment on attachment 748522 [details] [diff] [review]
patch

I'm going to pass on the review of this. I'm afraid I do very little with mozmill tests, and I certainly am not qualified to review them. I suppose I should do more, but now is not the time.
Attachment #748522 - Flags: review?(kent)
(Assignee)

Comment 7

4 years ago
Comment on attachment 748522 [details] [diff] [review]
patch

Ok, no problem. I just wonder why the exception did not cause the test to fail. Instead it finished sucessfully.
Attachment #748522 - Flags: review?(mconley)
(Reporter)

Comment 8

4 years ago
(In reply to :aceman from comment #5)
> Created attachment 748522 [details] [diff] [review]
> patch
> 
> I think the duplicate filter should not be created for the test to work.
> 
> I also think that the filter window tests from this file should be moved to
> a separate directory as they are quite hidden now in 'folder-widget'. And we
> plan to have more filter editor mozmill tests so they should be grouped
> logically.

:aceman, I am going to test the patch locally and report back the test result (whether the error occurs or not, etc.)

TIA
(Reporter)

Comment 9

4 years ago
Created attachment 749600 [details]
Patch fixed the problem.

Using the patch posted by :aceman, the particular problem disappeared. I am attaching the excerpt of the log.
DEBUG BUILD printed OTHER warnings and leaks, but I don't think they are related to the particular bug that was fixed.

TIA!
(Reporter)

Updated

4 years ago
Attachment #748522 - Flags: feedback?(ishikawa) → feedback+
Comment on attachment 748522 [details] [diff] [review]
patch

Review of attachment 748522 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM from inspection. Thanks aceman!
Attachment #748522 - Flags: review?(mconley) → review+
(Assignee)

Updated

4 years ago
Keywords: checkin-needed
https://hg.mozilla.org/comm-central/rev/f466188584ce
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Flags: in-testsuite+
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 24.0
You need to log in before you can comment on or make changes to this bug.