testing/xpcshell/node-http2/node_modules/http2-protocol/test/endpoint.js

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 var expect = require('chai').expect;
     2 var util = require('./util');
     4 var endpoint = require('../lib/endpoint');
     5 var Endpoint = endpoint.Endpoint;
     7 var settings = {
     8   SETTINGS_MAX_CONCURRENT_STREAMS: 100,
     9   SETTINGS_INITIAL_WINDOW_SIZE: 100000
    10 };
    12 describe('endpoint.js', function() {
    13   describe('scenario', function() {
    14     describe('connection setup', function() {
    15       it('should work as expected', function(done) {
    16         var c = new Endpoint(util.log.child({ role: 'client' }), 'CLIENT', settings);
    17         var s = new Endpoint(util.log.child({ role: 'client' }), 'SERVER', settings);
    19         util.log.debug('Test initialization over, starting piping.');
    20         c.pipe(s).pipe(c);
    22         setTimeout(function() {
    23           // If there are no exception until this, then we're done
    24           done();
    25         }, 10);
    26       });
    27     });
    28   });
    29   describe('bunyan serializer', function() {
    30     describe('`e`', function() {
    31       var format = endpoint.serializers.e;
    32       it('should assign a unique ID to each endpoint', function() {
    33         var c = new Endpoint(util.log.child({ role: 'client' }), 'CLIENT', settings);
    34         var s = new Endpoint(util.log.child({ role: 'client' }), 'SERVER', settings);
    35         expect(format(c)).to.not.equal(format(s));
    36         expect(format(c)).to.equal(format(c));
    37         expect(format(s)).to.equal(format(s));
    38       });
    39     });
    40   });
    41 });

mercurial