File tree Expand file tree Collapse file tree 6 files changed +55
-0
lines changed
Expand file tree Collapse file tree 6 files changed +55
-0
lines changed Original file line number Diff line number Diff line change 1+ # Tests for HTTPS Everywhere
2+
3+ ## Prerequisites
4+ * Latest release of the Firefox Add-On SDK: https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/Installation
5+
6+ ## Instructions
7+ 1 . Create a clean Firefox profile and install the HTTPS Everywhere XPI that you wish to test (TODO: script this).
8+ 2 . Copy the profile to ` /tmp/test_profile ` (TODO: make this configurable).
9+ 3 . Activate the Add-on SDK.
10+ 4 . cd to your HTTPS Everywhere repository root and run ` ./test.sh ` .
11+ 5 . To add tests, put them in ` ./https-everywhere-tests/tests ` .
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " https-everywhere-tests" ,
3+ "title" : " https-everywhere-tests" ,
4+ "id" : " jid1-we5BQOfc6skSMg" ,
5+ "description" : " a basic add-on" ,
6+ "author" : " " ,
7+ "license" : " MPL 2.0" ,
8+ "version" : " 0.1"
9+ }
Original file line number Diff line number Diff line change 1+ // Test that HTTPS Everywhere component is installed and accessible
2+
3+ const { Cc, Ci } = require ( "chrome" ) ;
4+
5+ let HTTPSEverywhere = Cc [ "@eff.org/https-everywhere;1" ]
6+ . getService ( Ci . nsISupports )
7+ . wrappedJSObject ;
8+
9+ exports [ "test httpse installed" ] = function ( assert ) {
10+ assert . equal ( typeof HTTPSEverywhere , "object" ,
11+ "Test that HTTPSEverywhere is defined" ) ;
12+ assert . equal ( typeof HTTPSEverywhere . observe , "function" ,
13+ "Test that HTTPSEverywhere.observe is a function" ) ;
14+ } ;
15+
16+ exports [ "test httpse potentiallyApplicableRulesets" ] = function ( assert ) {
17+ let HTTPSRules = HTTPSEverywhere . https_rules ;
18+ assert . deepEqual ( HTTPSRules . potentiallyApplicableRulesets ( "www.eff.org" ) . length ,
19+ 1 ,
20+ "Test that HTTPSE finds one applicable rule for www.eff.org" ) ;
21+ }
22+
23+ require ( "sdk/test" ) . run ( exports ) ;
Original file line number Diff line number Diff line change 1+ var main = require ( "./main" ) ;
2+
3+ exports [ "test main" ] = function ( assert ) {
4+ assert . pass ( "Unit test running!" ) ;
5+ } ;
6+
7+ exports [ "test main async" ] = function ( assert , done ) {
8+ assert . pass ( "async Unit test running!" ) ;
9+ done ( ) ;
10+ } ;
11+
12+ require ( "sdk/test" ) . run ( exports ) ;
You can’t perform that action at this time.
0 commit comments