Closed Bug 975763 Opened 10 years ago Closed 9 years ago

convert mochitest test_certificate_overrides.html to xpcshell test test_cert_override_bits_mismatches.js

Categories

(Core :: Security: PSM, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: briansmith, Assigned: keeler)

References

Details

Attachments

(1 file)

See bug 975122 comment 7 for what needs to be done. Whenever possible, we should be using xpcshell instead of mochitest to test networking/certificate functionality. Only when we're testing interaction with the DOM, the browser chrome, or other things should we use mochitest.
Doing some good-first-bug auditing, and just about nothing in security is really going to be a good first bug.
Whiteboard: [good first bug][mentor=cviecco] → [mentor=cviecco]
Mentor: cviecco
Whiteboard: [mentor=cviecco]
I'm morphing this bug. test_certificate_overrides.html is no longer necessary. The xpcshell test test_cert_overrides.js does everything it does and more.
Assignee: nobody → dkeeler
Mentor: cviecco
Status: NEW → ASSIGNED
Summary: Move testing of cert error overrides from mochitest/bugs/test_certificate_overrides.html to tests/unit/test_cert_overrides.js → remove mochitest/bugs/test_certificate_overrides.html (the functionality it tests is obviated by test_cert_overrides.js)
bug 975763 - remove unnecessary mochitest test_certificate_overrides.html r?mgoodwin

The xpcshell test test_cert_overrides.js does everything this test did and more.
Attachment #8667482 - Flags: review?(mgoodwin)
Comment on attachment 8667482 [details]
MozReview Request: bug 975763 - move test_certificate_overrides.html to test_cert_override_bits_mismatches.js r?mgoodwin

https://reviewboard.mozilla.org/r/20765/#review18715

Looks good to me.
Attachment #8667482 - Flags: review?(mgoodwin) → review+
Comment on attachment 8667482 [details]
MozReview Request: bug 975763 - move test_certificate_overrides.html to test_cert_override_bits_mismatches.js r?mgoodwin

bug 975763 - move unnecessary mochitest test_certificate_overrides.html to xpcshell test test_cert_overrides.js r?mgoodwin

The xpcshell test test_cert_overrides.js now does everything this test did and more.
Attachment #8667482 - Attachment description: MozReview Request: bug 975763 - remove unnecessary mochitest test_certificate_overrides.html r?mgoodwin → MozReview Request: bug 975763 - move unnecessary mochitest test_certificate_overrides.html to xpcshell test test_cert_overrides.js r?mgoodwin
Thanks for the review. However, I had a second look at the original test and found an additional aspect of nsICertOverrideService that it tested that I thought would be good to include in test_cert_overrides.js. If you could have another look at the update, that would be great.
Comment on attachment 8667482 [details]
MozReview Request: bug 975763 - move test_certificate_overrides.html to test_cert_override_bits_mismatches.js r?mgoodwin

bug 975763 - move test_certificate_overrides.html to test_cert_override_bits_mismatches.js r?mgoodwin

test_certificate_overrides.html didn't need to be a mochitest.
Attachment #8667482 - Attachment description: MozReview Request: bug 975763 - move unnecessary mochitest test_certificate_overrides.html to xpcshell test test_cert_overrides.js r?mgoodwin → MozReview Request: bug 975763 - move test_certificate_overrides.html to test_cert_override_bits_mismatches.js r?mgoodwin
It turns out adding those tests to test_cert_overrides.js made it take too long on B2G, so I just moved the new testcases to a separate file.
https://reviewboard.mozilla.org/r/20765/#review19261

Looks OK to me.

::: security/manager/ssl/tests/unit/test_cert_override_bits_mismatches.js:21
(Diff revision 3)
> +    certOverrideService.clearValidityOverride(host, 8443);

Do we need this? We're clearing the validity override for each iteration of the loop (in line 29).
https://reviewboard.mozilla.org/r/20765/#review19261

> Do we need this? We're clearing the validity override for each iteration of the loop (in line 29).

Oh yeah, good point.
Summary: remove mochitest/bugs/test_certificate_overrides.html (the functionality it tests is obviated by test_cert_overrides.js) → convert mochitest test_certificate_overrides.html to xpcshell test test_cert_override_bits_mismatches.js
https://hg.mozilla.org/mozilla-central/rev/86e01d1960c0
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
Blocks: 1149840
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: