B2G/gecko/modules/libjar/test/unit/test_jarchannel.js
/**
 * Basic reading test for asynchronously opened jar channel
 */
Basic reading test for asynchronously opened jar channel
Basic reading test for asynchronously opened jar channel
function testAsync() {
    var uri = jarBase + "/inner40.zip";
    var chan = ios.newChannel(uri, null, null);
    do_check_true(chan.contentLength < 0);
    chan.asyncOpen(new Listener(function(l) {
        do_check_true(chan.contentLength > 0);
        do_check_true(l.gotStartRequest);
        do_check_true(l.gotStopRequest);
        do_check_eq(l.available, chan.contentLength);
        run_next_test();
    }), null);
}
function testAsync ( ) { var uri = jarBase + "/inner40.zip" ; var chan = ios . newChannel ( uri , null , null ) ; do_check_true ( chan . contentLength < 0 ) ; chan . asyncOpen ( new Listener ( function ( l ) { do_check_true ( chan . contentLength > 0 ) ; do_check_true ( l . gotStartRequest ) ; do_check_true ( l . gotStopRequest ) ; do_check_eq ( l . available , chan . contentLength ) ; run_next_test ( ) ; } ) , null ) ; }
Basic reading test for asynchronously opened jar channel
Basic reading test for asynchronously opened jar channel