Closed
Bug 877441
Opened 13 years ago
Closed 13 years ago
make head.js file to reduce copy-paste in psm unit tests
Categories
(Core :: Security: PSM, defect)
Tracking
()
RESOLVED
FIXED
mozilla24
People
(Reporter: cviecco, Assigned: cviecco)
Details
Attachments
(1 file, 4 obsolete files)
|
10.86 KB,
patch
|
cviecco
:
review+
|
Details | Diff | Splinter Review |
No description provided.
| Assignee | ||
Comment 1•13 years ago
|
||
version 1 only common stuff. Wished more could get in.
Attachment #755655 -
Flags: feedback?(dkeeler)
| Assignee | ||
Comment 2•13 years ago
|
||
try push (all platforms, only xpcshell tests)
https://tbpl.mozilla.org/?tree=Try&rev=8c8fa0549d0
Comment 3•13 years ago
|
||
Comment on attachment 755655 [details] [diff] [review]
unit-psm-head (v1)
Review of attachment 755655 [details] [diff] [review]:
-----------------------------------------------------------------
Looks great. How about an addCertFromFile function like this:
function addCertFromFile(filename, trustString) {
let certdb = Cc["@mozilla.org/security/x509certdb;1"]
.getService(Ci.nsIX509CertDB);
let certFile = do_get_file(filename, false);
let der = readFile(certFile);
certdb.addCert(der, trustString, null);
}
::: security/manager/ssl/tests/unit/head.js
@@ +6,5 @@
> +const { 'classes': Cc, 'interfaces': Ci, 'utils': Cu, 'results': Cr } = Components;
> +
> +let tempScope = {};
> +Cu.import("resource://gre/modules/NetUtil.jsm", tempScope);
> +let NetUtil = tempScope.NetUtil;
In terms of temporary scope, this is what I've been doing:
let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
::: security/manager/ssl/tests/unit/test_datasignatureverifier.js
@@ +1,2 @@
> +//const Cc = Components.classes;
> +//const Ci = Components.interfaces;
Just remove these entirely?
::: security/manager/ssl/tests/unit/xpcshell.ini
@@ +3,1 @@
> tail =
these lines look like they already had a trailing space - I would say go ahead an remove them (the spaces)
Attachment #755655 -
Flags: feedback?(dkeeler) → feedback+
| Assignee | ||
Comment 4•13 years ago
|
||
Attachment #755655 -
Attachment is obsolete: true
| Assignee | ||
Comment 5•13 years ago
|
||
removal of comment change from v2
Attachment #755678 -
Attachment is obsolete: true
| Assignee | ||
Updated•13 years ago
|
Attachment #755679 -
Flags: review?(bsmith)
Comment 6•13 years ago
|
||
Comment on attachment 755679 [details] [diff] [review]
unit-psm-head (v2.1)
Review of attachment 755679 [details] [diff] [review]:
-----------------------------------------------------------------
Nit: IMO, "head_psm.js" is a better name because it is easier to distinguish from other "head.js" files open in other editor tabs/buffers.
::: security/manager/ssl/tests/unit/head.js
@@ +1,3 @@
> +/*
> + Some license here (or not, bsmith?)
> +*/
I guess just use the standard MPL block and mode line (adjusted C++ -> JS):
https://developer.mozilla.org/en-US/docs/Developer_Guide/Coding_Style#Mode_Line
Attachment #755679 -
Flags: review?(bsmith) → review+
| Assignee | ||
Comment 7•13 years ago
|
||
Attachment #755679 -
Attachment is obsolete: true
Attachment #756135 -
Flags: review+
| Assignee | ||
Comment 8•13 years ago
|
||
keeping r+ from bsmith
Attachment #756135 -
Attachment is obsolete: true
Attachment #756139 -
Flags: review+
| Assignee | ||
Comment 9•13 years ago
|
||
| Assignee | ||
Comment 10•13 years ago
|
||
Comment 11•13 years ago
|
||
Assignee: nobody → cviecco
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in
before you can comment on or make changes to this bug.
Description
•