Last Comment Bug 828587 - [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
: [Exception... "'JavaScript component does not have a method named: "alert"' w...
Status: RESOLVED FIXED
:
Product: Thunderbird
Classification: Client Software
Component: Filters (show other bugs)
: Trunk
: All Linux
: -- normal (vote)
: Thunderbird 24.0
Assigned To: :aceman
:
Mentors:
Depends on:
Blocks: 826967
  Show dependency treegraph
 
Reported: 2013-01-09 11:22 PST by ISHIKAWA, Chiaki
Modified: 2013-06-25 05:18 PDT (History)
6 users (show)
ryanvm: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Session log of test_can_cancel_quit_on_filter_changes (78.49 KB, text/plain)
2013-01-09 11:22 PST, ISHIKAWA, Chiaki
no flags Details
The same session log with fixed stack trace. (78.57 KB, text/plain)
2013-01-09 11:32 PST, ISHIKAWA, Chiaki
no flags Details
patch (3.27 KB, patch)
2013-05-12 06:01 PDT, :aceman
mconley: review+
ishikawa: feedback+
Details | Diff | Review
Patch fixed the problem. (54.80 KB, text/plain)
2013-05-14 18:05 PDT, ISHIKAWA, Chiaki
no flags Details

Description ISHIKAWA, Chiaki 2013-01-09 11:22:59 PST
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
Comment 1 ISHIKAWA, Chiaki 2013-01-09 11:32:52 PST
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 neil@parkwaycc.co.uk 2013-01-09 12:10:36 PST
(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.
Comment 3 Mark Banner (:standard8) 2013-01-10 14:12:55 PST
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).
Comment 4 ISHIKAWA, Chiaki 2013-01-11 07:06:18 PST
(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
Comment 5 :aceman 2013-05-12 06:01:59 PDT
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.
Comment 6 Kent James (:rkent) 2013-05-13 08:15:33 PDT
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.
Comment 7 :aceman 2013-05-13 08:55:24 PDT
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.
Comment 8 ISHIKAWA, Chiaki 2013-05-14 06:06:21 PDT
(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
Comment 9 ISHIKAWA, Chiaki 2013-05-14 18:05:48 PDT
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!
Comment 10 Mike Conley (:mconley) - (needinfo me!) 2013-06-02 08:35:54 PDT
Comment on attachment 748522 [details] [diff] [review]
patch

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

LGTM from inspection. Thanks aceman!
Comment 11 Ryan VanderMeulen [:RyanVM] 2013-06-03 05:41:19 PDT
https://hg.mozilla.org/comm-central/rev/f466188584ce

Note You need to log in before you can comment on or make changes to this bug.