Last Comment Bug 792804 - Test failure: mailnews/news/test/unit/test_bug540288.js | [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsICacheSession.openCacheEntry]" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)"
: Test failure: mailnews/news/test/unit/test_bug540288.js | [Exception... "Comp...
Status: RESOLVED FIXED
:
Product: MailNews Core
Classification: Components
Component: Networking: NNTP (show other bugs)
: unspecified
: x86 Mac OS X
: -- blocker (vote)
: Thunderbird 18.0
Assigned To: Florian Quèze [:florian] [:flo]
:
:
Mentors:
Depends on:
Blocks: 695399
  Show dependency treegraph
 
Reported: 2012-09-20 05:24 PDT by Florian Quèze [:florian] [:flo]
Modified: 2012-09-20 08:25 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Fix (2.94 KB, patch)
2012-09-20 05:24 PDT, Florian Quèze [:florian] [:flo]
mconley: review+
Details | Diff | Splinter Review
diff -w (1.95 KB, patch)
2012-09-20 05:25 PDT, Florian Quèze [:florian] [:flo]
no flags Details | Diff | Splinter Review
Patch with review comments addressed [for check-in] (2.88 KB, patch)
2012-09-20 07:40 PDT, Florian Quèze [:florian] [:flo]
no flags Details | Diff | Splinter Review

Description Florian Quèze [:florian] [:flo] 2012-09-20 05:24:39 PDT
Created attachment 662977 [details] [diff] [review]
Fix

Since bug 695399 landed on mozilla-central, comm-central xpcshell tests are busted:
TEST-UNEXPECTED-FAIL | /home/cltbld/talos-slave/test/build/xpcshell/tests/mailnews/news/test/unit/test_bug540288.js | test failed (with xpcshell return code: 0), see following log:
TEST-UNEXPECTED-FAIL | /home/cltbld/talos-slave/test/build/xpcshell/tests/mailnews/news/test/unit/test_bug540288.js | [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsICacheSession.openCacheEntry]" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: /home/cltbld/talos-slave/test/build/xpcshell/tests/mailnews/news/test/unit/test_bug540288.js :: run_test :: line 76" data: no]

The attached patch fixes this test by using asyncOpenCacheEntry instead of openCacheEntry.
Comment 1 Florian Quèze [:florian] [:flo] 2012-09-20 05:25:39 PDT
Created attachment 662978 [details] [diff] [review]
diff -w

Same patch without the whitespace changes (diff -w) for easier reviewing.
Comment 2 Mike Conley (:mconley) 2012-09-20 07:08:29 PDT
Comment on attachment 662977 [details] [diff] [review]
Fix

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

Just two things. Other than that, this looks good to me.

::: mailnews/news/test/unit/test_bug540288.js
@@ +68,5 @@
>    server.start(NNTP_PORT);
>  
>    try {
>      // Add an empty message to the cache
> +    Cc["@mozilla.org/messenger/nntpservice;1"]

I guess there's no access to MailServices from here? I generally prefer to use that, with MailServices.nntp, as opposed to querying XPCOM for the service.

@@ +71,5 @@
>      // Add an empty message to the cache
> +    Cc["@mozilla.org/messenger/nntpservice;1"]
> +      .getService(Ci.nsINntpService).cacheSession
> +      .asyncOpenCacheEntry(kCacheKey, Ci.nsICache.ACCESS_WRITE, {
> +      onCacheEntryAvailable: function(cacheEntry, access, status) {

I think this block needs to be indented 2 spaces more, to differentiate it from the code above.
Comment 3 Florian Quèze [:florian] [:flo] 2012-09-20 07:40:12 PDT
Created attachment 663013 [details] [diff] [review]
Patch with review comments addressed [for check-in]
Comment 4 Florian Quèze [:florian] [:flo] 2012-09-20 08:25:31 PDT
https://hg.mozilla.org/comm-central/rev/712bbc279ec6

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