Closed
Bug 1163038
Opened 9 years ago
Closed 9 years ago
test_gfxBlacklist* xpcshell tests pass locally without running
Categories
(Core :: Graphics, defect)
Tracking
()
RESOLVED
FIXED
mozilla42
People
(Reporter: milan, Assigned: milan)
Details
Attachments
(2 files, 2 obsolete files)
4.30 KB,
patch
|
milan
:
review+
milan
:
checkin+
|
Details | Diff | Splinter Review |
31.18 KB,
patch
|
milan
:
review+
RyanVM
:
checkin+
|
Details | Diff | Splinter Review |
From what I can tell, this is common in all the test_gfxBlacklist*.js xpcshell tests: try { var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo); } catch (e) { do_test_finished(); return; } which always throws when run locally, so we quietly finish the test and pass without actually ever testing anything.
Assignee | ||
Comment 1•9 years ago
|
||
Ehsan, Jeff volunteered your name when xpcshell tests are in question :) I see other tests that successfully get the gfx/info (test_location.js under search), but not these. Running under debug, using Ci.nsIGfxInfo, Ci.nsIGfxInfo2 or Ci.nsIGfxInfoDebug all work for test_location.js, but not for any of the test_gfxBlacklist*.js ones.
Flags: needinfo?(ehsan)
Comment 2•9 years ago
|
||
Is this one example? <https://dxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OK.js> From a quick look, it looks like nothing in that test defines Cc and Ci, and I bet we throw because of that. Can you try adding the following to the beginning of this file and see if it fixes the issue? const Cc = Components.classes; const Ci = Components.interfaces; Also, I'm not sure why that line is wrapped in a try/catch block. Is that code ever expected to throw? If not, you should make sure it's not wrapped in a try/catch block, otherwise failures such as this will be silently ignored.
Flags: needinfo?(ehsan)
Assignee | ||
Comment 3•9 years ago
|
||
Yes, that's one example. Cc and Ci are defined somewhere, and replacing them with the long form work the same. This part works: var s = Cc["@mozilla.org/gfx/info;1"]; but then this part fails: s.getService(Ci.nsIGfxInfo); The same kind of code works just fine in other places (e.g., https://dxr.mozilla.org/mozilla-central/source/toolkit/components/search/tests/xpcshell/test_location.js#42), so it appears something is not initialized properly - was wondering if it was obvious to you as to what that was.
Flags: needinfo?(ehsan)
Comment 4•9 years ago
|
||
Spoke with Milan about this in person. There are other occurrences of Cc and Ci in these tests, and I suggested adding the const definitions to a head.js file.
Flags: needinfo?(ehsan)
Assignee | ||
Comment 5•9 years ago
|
||
The head file for this directory is head_addons.js, and doing something like: const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components; in that file gets us further in these tests.
Assignee | ||
Comment 6•9 years ago
|
||
Change the .xml OSX version to 10.6, we don't really support 10.5 in the code.
Assignee | ||
Comment 7•9 years ago
|
||
Attachment #8605911 -
Attachment is obsolete: true
Attachment #8606360 -
Flags: review+
Assignee | ||
Comment 8•9 years ago
|
||
As we fix all of them, we can then move the repeated code from individual tests to head_addon.js file.
Keywords: leave-open
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Assignee | ||
Updated•9 years ago
|
Attachment #8606360 -
Flags: checkin+
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → milan
Assignee | ||
Updated•9 years ago
|
Attachment #8606360 -
Attachment description: test_gfxBlocklist_OK.js test passing. r=me (Ehsan's code) → Part 1. test_gfxBlocklist_OK.js test passing. r=me (Ehsan's code)
Assignee | ||
Comment 11•9 years ago
|
||
Kats, I know this isn't necessarily what you've reviewed before, but it's pretty standard stuff.
Attachment #8636195 -
Flags: review?(bugmail.mozilla)
Comment 12•9 years ago
|
||
Comment on attachment 8636195 [details] [diff] [review] Part 2. Most of the rest of the test_gfxBlacklist*js files. r=kats Review of attachment 8636195 [details] [diff] [review]: ----------------------------------------------------------------- ::: toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_prefs.js @@ +105,5 @@ > do_execute_soon(ensureBlacklistUnset); > } > function ensureBlacklistUnset() > { > + mapFile("/data/test_gfxBlacklist.xml", gTestserver); This one seems misplaced to me, but I might be misreading the test. Seems like the way it is in current m-c, it does a mapFile at the start of the test (line 14). Then it loads the mapped file (line 131) and that triggers the various test functions to run in sequence. As part of that sequence it maps and loads the other xml file (line 99). Your change makes it so that when the first load_blocklist is called on line 131 the file hasn't been mapped yet; it only gets mapped later in the sequence, when ensureBlacklistUnset is called here.
Attachment #8636195 -
Flags: review?(bugmail.mozilla) → review+
Assignee | ||
Comment 13•9 years ago
|
||
You're right, the test_gfxBlacklist_prefs.js is not supposed to be part of this patch, this was a partial edit...
Assignee | ||
Comment 14•9 years ago
|
||
The actual patch, without the _prefs.js file that wasn't meant to be in, and with minor changes, so I'm carrying r+. https://treeherder.mozilla.org/#/jobs?repo=try&revision=575f5062bc37
Attachment #8636195 -
Attachment is obsolete: true
Attachment #8636617 -
Flags: review+
Assignee | ||
Updated•9 years ago
|
Attachment #8636617 -
Flags: checkin?
Assignee | ||
Updated•9 years ago
|
Keywords: leave-open → checkin-needed
Updated•9 years ago
|
Attachment #8636617 -
Flags: checkin? → checkin+
Comment 15•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/d962d014dda5
Keywords: checkin-needed
Comment 16•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/d962d014dda5
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox42:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
You need to log in
before you can comment on or make changes to this bug.
Description
•