<s> from nose . tools import eq_ <EOL> from js_helper import TestCase <EOL> from test_features import uses_feature <EOL> class TestXHR ( TestCase ) : <EOL> def test_synchronous_xhr ( self ) : <EOL> "<STR_LIT>" <EOL> self . run_script ( """<STR_LIT>""" ) <EOL> self . assert_silent ( ) <EOL> def test_async_xhr ( self ) : <EOL> self . run_script ( """<STR_LIT>""" ) <EOL> self . assert_failed ( ) <EOL> @ uses_feature ( "<STR_LIT>" ) <EOL> def test_moz_system ( self ) : <EOL> self . run_script ( """<STR_LIT>""" ) <EOL> self . assert_silent ( ) ; <EOL> @ uses_feature ( "<STR_LIT>" ) <EOL> def test_moz_system_sync ( self ) : <EOL> self . run_script ( """<STR_LIT>""" ) <EOL> self . assert_failed ( ) ; <EOL> class TestScope ( TestCase ) : <EOL> def test_extraneous_globals ( self ) : <EOL> """<STR_LIT>""" <EOL> self . run_script ( """<STR_LIT>""" ) <EOL> self . assert_silent ( ) <EOL> assert "<STR_LIT:foo>" not in self . final_context . data <EOL> assert "<STR_LIT:bar>" not in self . final_context . data <EOL> def do_expr ( self , expr , output ) : <EOL> self . setUp ( ) <EOL> self . run_script ( "<STR_LIT>" % expr ) <EOL> self . assert_var_eq ( "<STR_LIT:x>" , output ) <EOL> def test_number_global_conversions ( self ) : <EOL> """<STR_LIT>""" <EOL> yield self . do_expr , "<STR_LIT>" , <NUM_LIT:0> <EOL> yield self . do_expr , "<STR_LIT>" , <NUM_LIT> <EOL> yield self . do_expr , "<STR_LIT>" , <NUM_LIT> <EOL> yield self . do_expr , '<STR_LIT>' , <NUM_LIT> <EOL> yield self . do_expr , '<STR_LIT>' , <NUM_LIT> <EOL> yield self . do_expr , '<STR_LIT>' , True <EOL> yield self . do_expr , "<STR_LIT>" , True </s>
