Closed Bug 888526 Opened 11 years ago Closed 11 years ago

use the profile dir instead of the bin dir for contentpref xpcshell tests

Categories

(Toolkit :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla25

People

(Reporter: mihneadb, Assigned: mihneadb)

References

Details

Attachments

(1 file, 3 obsolete files)

      No description provided.
Attached patch use do_get_profile (obsolete) — Splinter Review
Assignee: nobody → mihneadb
Blocks: 887064
Attachment #769253 - Flags: review?(ehsan)
Comment on attachment 769253 [details] [diff] [review]
use do_get_profile

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

Hmm, I'm not sure if I'm the best reviewer for this patch.  The bug doesn't really describe what the problem is and how this patch tries to fix it, which doesn't help much either...
Attachment #769253 - Flags: review?(ehsan)
This is needed so we can run xpcshell tests concurrently. Currently this is not possible for the contentpref tests because they use the bin directory which is shared. This patch makes them use the profile dir which is individual to every test that is running.
Attached patch use the profile dir (obsolete) — Splinter Review
Attachment #772821 - Flags: review?(ted)
Attachment #769253 - Attachment is obsolete: true
Why are you limiting this to runningInParent then?
I can only call do_get_profile when runningInParent and there is only one ipc test (so no concurrency issues atm).
I could change the function so that when not runningInParent it uses the XPCSHELL_TEST_PROFILE_DIR env variable. Is that ok?
(In reply to comment #7)
> I can only call do_get_profile when runningInParent and there is only one ipc
> test (so no concurrency issues atm).
> I could change the function so that when not runningInParent it uses the
> XPCSHELL_TEST_PROFILE_DIR env variable. Is that ok?

I think we should just use do_get_profile() unconditionally.
(In reply to :Ehsan Akhgari (needinfo? me!) from comment #8)
> (In reply to comment #7)
> > I can only call do_get_profile when runningInParent and there is only one ipc
> > test (so no concurrency issues atm).
> > I could change the function so that when not runningInParent it uses the
> > XPCSHELL_TEST_PROFILE_DIR env variable. Is that ok?
> 
> I think we should just use do_get_profile() unconditionally.

Well as I said, that is not possible :).

http://mxr.mozilla.org/mozilla-central/source/testing/xpcshell/head.js#927
Comment on attachment 772821 [details] [diff] [review]
use the profile dir

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

::: toolkit/components/contentprefs/tests/unit/head_contentPrefs.js
@@ +85,5 @@
>     */
>    getProfileDir: function ContentPrefTest_getProfileDir() {
> +    if (runningInParent) {
> +      return do_get_profile();
> +    }

It seems like this is not going to do the right thing if it's running in a child process. Does this code get run in a child process? If so, you should fix it to work properly there. If not, then you can probably do a lot more code removal in this test.

::: toolkit/components/contentprefs/tests/unit_ipc/xpcshell.ini
@@ +2,5 @@
>  head = head_contentPrefs.js
>  tail = tail_contentPrefs.js
>  
> +# it these tests run in parallel you need to make getProfileDirectory
> +# return the correct profile in the _child_ process

I don't think putting a comment here is sufficient. We should fix the test.
Attachment #772821 - Flags: review?(ted) → review-
Does this make sense?
Attachment #774284 - Flags: review?(ted)
Attachment #772821 - Attachment is obsolete: true
Forgot to revert the manifest file.
Attachment #774286 - Flags: review?(ted)
Attachment #774284 - Attachment is obsolete: true
Attachment #774284 - Flags: review?(ted)
Comment on attachment 774286 [details] [diff] [review]
use the profile dir instead of the bin dir for contentpref xpcshell tests,

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

If this works then it's fine. I'm sure there's more code that could be removed, but it's not terribly important.
Attachment #774286 - Flags: review?(ted) → review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/90b078a81eef
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: