Closed Bug 521305 Opened 10 years ago Closed 8 years ago

mochitest-browser-chrome: browser_sanitizer.js reports |Exception... "'JavaScript component does not have a method named: "cancel"' when calling method: [nsICancelable::cancel]" nsresult: "0x80570030 (NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED)"|

Categories

(SeaMonkey :: Passwords & Permissions, defect, P3, minor)

Tracking

(seamonkey2.7 wontfix, seamonkey2.8 wontfix, seamonkey2.9 wontfix)

VERIFIED FIXED
seamonkey2.10
Tracking Status
seamonkey2.7 --- wontfix
seamonkey2.8 --- wontfix
seamonkey2.9 --- wontfix

People

(Reporter: sgautherie, Assigned: sgautherie)

References

(Blocks 1 open bug, )

Details

(Whiteboard: [would-be orange])

Attachments

(1 file)

For example:
{
http://tinderbox.mozilla.org/showlog.cgi?log=SeaMonkey2.0/1254416492.1254423365.2293.gz&fulltext=1
WINNT 5.2 comm-1.9.1 unit test on 2009/10/01 10:01:32

TEST-INFO | chrome://mochikit/content/browser/suite/smile/test/browser_Application.js | Console message:
TEST-INFO | chrome://mochikit/content/browser/suite/smile/test/browser_Application.js | Console message: [JavaScript Error: "[Exception... "'JavaScript component does not have a method named: "cancel"' when calling method: [nsICancelable::cancel]"  nsresult: "0x80570030 (NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED)"  location: "JS frame :: chrome://mochikit/content/browser/suite/modules/test/browser_sanitizer.js :: anonymous :: line 229"  data: no]" {file: "chrome://mochikit/content/browser/suite/modules/test/browser_sanitizer.js" line: 229}]
TEST-INFO | chrome://mochikit/content/browser/suite/smile/test/browser_Application.js | Console message: [JavaScript Error: "[Exception... "'JavaScript component does not have a method named: "cancel"' when calling method: [nsICancelable::cancel]"  nsresult: "0x80570030 (NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED)"  location: "JS frame :: chrome://mochikit/content/browser/suite/modules/test/browser_sanitizer.js :: anonymous :: line 229"  data: no]" {file: "chrome://mochikit/content/browser/suite/modules/test/browser_sanitizer.js" line: 229}]
TEST-INFO | chrome://mochikit/content/browser/suite/smile/test/browser_Application.js | Console message:
}

There's 2 loops in the test: 1 (same) exception each.

Code is
{
      // Stupid DM...
      this.dm.cancelDownload(this.dl.id);
}

Just in case, we might want to fix this exception before looking further into bug 521263.

PS: The reports leak to the next test. I'm about to fix that in bug 521263.
I don't see these errors when running both tests locally in Linux trunk, has this been fixed?
(In reply to comment #1)
> I don't see these errors when running both tests locally in Linux trunk, has
> this been fixed?

http://tinderbox.mozilla.org/showlog.cgi?log=SeaMonkey/1283778565.1283780985.4633.gz seems to agree, let's mark it INCOMPLETE for now.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → INCOMPLETE
Whiteboard: [orange]
(In reply to comment #1)
> I don't see these errors when running both tests locally in Linux trunk, has
> this been fixed?

Interesting.!.

(In reply to comment #2)
> http://tinderbox.mozilla.org/showlog.cgi?log=SeaMonkey/1283778565.1283780985.4633.gz
> seems to agree

But full log has it:
http://tinderbox.mozilla.org/showlog.cgi?log=SeaMonkey/1283778565.1283780985.4633.gz&fulltext=1
Linux comm-central-trunk debug test mochitest-other on 2010/09/06 06:09:25

as do all platforms:
http://tinderbox.mozilla.org/showlog.cgi?log=SeaMonkey/1283943339.1283945703.24249.gz&fulltext=1
Linux comm-central-trunk debug test mochitest-other on 2010/09/08 03:55:39
http://tinderbox.mozilla.org/showlog.cgi?log=SeaMonkey/1283942229.1283943731.13692.gz&fulltext=1
OS X 10.5 comm-central-trunk debug test mochitest-other on 2010/09/08 03:37:09
http://tinderbox.mozilla.org/showlog.cgi?log=SeaMonkey/1283933530.1283937781.11387.gz&fulltext=1
WINNT 5.2 comm-central-trunk debug test mochitest-other on 2010/09/08 01:12:10
Status: RESOLVED → REOPENED
OS: Windows Server 2003 → All
Resolution: INCOMPLETE → ---
Bug still there (in SM 2.10a1)): reproduced locally while fixing bug 725529.
{
TEST-INFO | chrome://mochitests/content/browser/suite/modules/test/browser_sanitizer.js | Console message: 

TEST-INFO | chrome://mochitests/content/browser/suite/modules/test/browser_sanitizer.js | Console message: [JavaScript Error: "[Exception... "'JavaScript component does not have a method named: "cancel"' when calling method: [nsICancelable::cancel]"  nsresult: "0x80570030 (NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED)"  location: "JS frame :: chrome://mochitests/content/browser/suite/modules/test/browser_sanitizer.js :: <TOP_LEVEL> :: line 229"  data: no]" {file: "chrome://mochitests/content/browser/suite/modules/test/browser_sanitizer.js" line: 229}]

TEST-INFO | chrome://mochitests/content/browser/suite/modules/test/browser_sanitizer.js | Console message: [JavaScript Error: "[Exception... "'JavaScript component does not have a method named: "cancel"' when calling method: [nsICancelable::cancel]"  nsresult: "0x80570030 (NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED)"  location: "JS frame :: chrome://mochitests/content/browser/suite/modules/test/browser_sanitizer.js :: <TOP_LEVEL> :: line 229"  data: no]" {file: "chrome://mochitests/content/browser/suite/modules/test/browser_sanitizer.js" line: 229}]

TEST-INFO | chrome://mochitests/content/browser/suite/modules/test/browser_sanitizer.js | Console message: 
}
Status: REOPENED → NEW
Keywords: helpwanted
Whiteboard: [orange] → [would-be orange]
chrome://mochitests/content/browser/suite/modules/test/browser_sanitizer.js" line: 229

      this.dl = this.dm.addDownload(Components.interfaces.nsIDownloadManager.DOWNLOAD_CANCELED, uri,
                                    dest, "Sanitizer!", null, Math.round(Date.now() * 1000), null, {});

http://mxr.mozilla.org/mozilla-central/source/toolkit/components/downloads/nsIDownloadManager.idl#151

  nsIDownload addDownload(in short aDownloadType, 
                          in nsIURI aSource,
                          in nsIURI aTarget,
                          in AString aDisplayName,
                          in nsIMIMEInfo aMIMEInfo,
                          in PRTime aStartTime,
                          in nsILocalFile aTempFile,
                          in nsICancelable aCancelable);

The last argument should be a nsICancelable but we feed it a null object {}.

All our other tests (and toolkit tests) do something like this:

    const nsIWBP = Components.interfaces.nsIWebBrowserPersist;
    var persist = Components.classes["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"]
                            .createInstance(Components.interfaces.nsIWebBrowserPersist);
    persist.persistFlags = nsIWBP.PERSIST_FLAGS_REPLACE_EXISTING_FILES |
                           nsIWBP.PERSIST_FLAGS_BYPASS_CACHE |
                           nsIWBP.PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION;

And then uses the persist as the last argument  (nsIWebBrowserPersist inherits from nsICancelable)
(In reply to Philip Chee from comment #5)
> All our other tests (and toolkit tests) do something like this:

Thanks for the pointers!

***

http://mxr.mozilla.org/comm-central/search?string=addDownload&case=1&find=%2Fsuite%2F.*%2Ftest

NB: "download.paused" is from bug 474622.
Assignee: nobody → sgautherie.bz
Status: NEW → ASSIGNED
Attachment #595821 - Flags: review?(jh)
Severity: normal → minor
Keywords: helpwanted
Priority: -- → P3
Hardware: x86 → All
Target Milestone: --- → seamonkey2.10
Comment on attachment 595821 [details] [diff] [review]
(Av1) Add a missing nsIWebBrowserPersist object to browser_sanitizer.js, Update related tests
[Checked in: See comment 8]

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

I was able to reproduce the failure and can confirm that the patch fixes the error (and the whole test suite in combination with bug 725529 patch Bv1). Good work!

[We should really set up a wiki page for explaining how to run individual SM tests, with one example for each type.]

::: suite/modules/test/browser_sanitizer.js
@@ +233,5 @@
> +
> +      this.dl = this.dm.addDownload(
> +        Components.interfaces.nsIDownloadManager.DOWNLOAD_CANCELED,
> +        uri, dest, "Sanitizer!", null, Math.round(Date.now() * 1000), null,
> +        persist);

Bah, that's awful! This is a function call, not an array or object definition or similar. Please do proper wrapping, i.e. with at least the first parameter directly following the opening bracket, on the same line. Like in the other files and pretty much everywhere else.

r=me with that (and thanks for reusing nsIWBP, which I wouldn't have required but proposed, too).
Attachment #595821 - Flags: review?(jh) → review+
Comment on attachment 595821 [details] [diff] [review]
(Av1) Add a missing nsIWebBrowserPersist object to browser_sanitizer.js, Update related tests
[Checked in: See comment 8]

http://hg.mozilla.org/comm-central/rev/5e653213d94d
Av1, with comment 7 suggestion(s).
Attachment #595821 - Attachment description: (Av1) Add a missing nsIWebBrowserPersist object to browser_sanitizer.js, Update related tests → (Av1) Add a missing nsIWebBrowserPersist object to browser_sanitizer.js, Update related tests [Checked in: See comment 8]
No longer blocks: 521263
Flags: in-testsuite+
Status: ASSIGNED → RESOLVED
Closed: 9 years ago8 years ago
Resolution: --- → FIXED
(In reply to Jens Hatlak (:InvisibleSmiley) from comment #7)
> [We should really set up a wiki page for explaining how to run individual SM
> tests, with one example for each type.]

Let's see:

Running SM tests is (mostly) the "same" as running FF (or TB) tests: this is about Core documentation.
Running an individual test(s) is +/- documented.

Doing a very brief search, I find the following:
*https://developer.mozilla.org/en/Mozilla_automated_testing
 which is a brief explanation of the various test suites.
*https://developer.mozilla.org/en/Running_Mozilla_Tests
 which explains "make <testsuite>" on Tinderboxes only.
   (It should be easy to add syntaxes to select an individual test, as need be.)
 Some linked-to pages explain individual run.
   (Other pages may need to be extended.)

What would seem to be totally missing is a page to explain how to run (individual) packaged tests (locally).

Feel free to file bug(s) as needed.
http://tinderbox.mozilla.org/showlog.cgi?log=SeaMonkey/1328829863.1328834371.25138.gz
WINNT 5.2 comm-central-trunk debug test mochitest-other on 2012/02/09 15:24:23

V.Fixed
Status: RESOLVED → VERIFIED
(In reply to Serge Gautherie (:sgautherie) from comment #8)
> http://hg.mozilla.org/comm-central/rev/5e653213d94d

Please use r=InvisibleSmiley in the future. Thanks.

(In reply to Serge Gautherie (:sgautherie) from comment #9)
> What would seem to be totally missing is a page to explain how to run
> (individual) packaged tests (locally).

Not sure what you mean by "packaged" tests. I only know mochitest-chrome, mochitest-browser and xpcshell. For these I know how to prepare and run individual tests, and that's what I want to have documented (including build-time prerequisites).

I think with the existing (core) pages, the signal/noise ratio is way too high. I want to have a page that is down to the point, geared toward SM, and with examples that can be adapted easily. Of course the core pages will be linked from there, too.

> Feel free to file bug(s) as needed.

Nah, I'll just create a wiki page instead. I just wanted to express that this is on my to-do list.
(In reply to Jens Hatlak (:InvisibleSmiley) from comment #11)

> Please use r=InvisibleSmiley in the future. Thanks.

I'll try to remember, but no promise :-|

> Not sure what you mean by "packaged" tests.

I mean like (most of) the tests are now run on tinderboxes:
download executable and tests, "install" them, run them, without building anything locally.

> I'll just create a wiki page instead. I just wanted to express that
> this is on my to-do list.

Ah. Looking forward to that. (Let me know.)
You need to log in before you can comment on or make changes to this bug.