File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
https-everywhere-tests/test Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change 11// Test that HTTPS Everywhere component is installed and accessible
22
33const { Cc, Ci } = require ( "chrome" ) ;
4+ var tabs = require ( "sdk/tabs" ) ;
45
56let HTTPSEverywhere = Cc [ "@eff.org/https-everywhere;1" ]
67 . getService ( Ci . nsISupports )
@@ -21,15 +22,17 @@ exports["test httpse potentiallyApplicableRulesets"] = function(assert) {
2122}
2223
2324exports [ "test sample ruleset" ] = function ( assert , done ) {
24- var tabs = require ( "sdk/tabs" ) ;
25-
26- tabs . on ( 'ready' , function ( tab ) {
27- assert . equal ( tab . url , "https://www.reddit.com/robots.txt" ,
28- "Test that Reddit URLs are rewritten to HTTPS." ) ;
29- done ( ) ;
25+ tabs . open ( {
26+ url : "http://www.reddit.com/robots.txt" ,
27+ onOpen : function ( tab ) {
28+ tab . on ( 'load' , function ( tab ) {
29+ assert . equal ( tab . url , "http://www.reddit.com/robots.txt" ,
30+ "Test that Reddit URLs are rewritten to HTTPS." ) ;
31+ tab . close ( ) ;
32+ done ( ) ;
33+ } ) ;
34+ }
3035 } ) ;
31-
32- tabs . open ( "http://www.reddit.com/robots.txt" ) ;
3336}
3437
3538require ( "sdk/test" ) . run ( exports ) ;
You can’t perform that action at this time.
0 commit comments