summaryrefslogtreecommitdiffstats
path: root/testing/xpcshell/node-http2/test/endpoint.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /testing/xpcshell/node-http2/test/endpoint.js
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/xpcshell/node-http2/test/endpoint.js')
-rw-r--r--testing/xpcshell/node-http2/test/endpoint.js41
1 files changed, 41 insertions, 0 deletions
diff --git a/testing/xpcshell/node-http2/test/endpoint.js b/testing/xpcshell/node-http2/test/endpoint.js
new file mode 100644
index 0000000000..bdd2569d42
--- /dev/null
+++ b/testing/xpcshell/node-http2/test/endpoint.js
@@ -0,0 +1,41 @@
+var expect = require('chai').expect;
+var util = require('./util');
+
+var endpoint = require('../lib/protocol/endpoint');
+var Endpoint = endpoint.Endpoint;
+
+var settings = {
+ SETTINGS_MAX_CONCURRENT_STREAMS: 100,
+ SETTINGS_INITIAL_WINDOW_SIZE: 100000
+};
+
+describe('endpoint.js', function() {
+ describe('scenario', function() {
+ describe('connection setup', function() {
+ it('should work as expected', function(done) {
+ var c = new Endpoint(util.log.child({ role: 'client' }), 'CLIENT', settings);
+ var s = new Endpoint(util.log.child({ role: 'client' }), 'SERVER', settings);
+
+ util.log.debug('Test initialization over, starting piping.');
+ c.pipe(s).pipe(c);
+
+ setTimeout(function() {
+ // If there are no exception until this, then we're done
+ done();
+ }, 10);
+ });
+ });
+ });
+ describe('bunyan serializer', function() {
+ describe('`e`', function() {
+ var format = endpoint.serializers.e;
+ it('should assign a unique ID to each endpoint', function() {
+ var c = new Endpoint(util.log.child({ role: 'client' }), 'CLIENT', settings);
+ var s = new Endpoint(util.log.child({ role: 'client' }), 'SERVER', settings);
+ expect(format(c)).to.not.equal(format(s));
+ expect(format(c)).to.equal(format(c));
+ expect(format(s)).to.equal(format(s));
+ });
+ });
+ });
+});