Skip to content

Commit 783a577

Browse files
committed
Remove intermediate standard tests
1 parent 9af0bb3 commit 783a577

File tree

1 file changed

+3
-51
lines changed

1 file changed

+3
-51
lines changed

test/testSendNotification.js

Lines changed: 3 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,9 @@ suite('sendNotification', function() {
8484
salt: salt,
8585
padSize: 1,
8686
});
87-
} else if (req.headers['content-encoding'] === 'aesgcm128') {
88-
ece.saveKey('webpushKey', userCurve, 'P-256');
87+
} else if (cryptoHeader === 'crypto-key') {
88+
assert.equal(req.headers['content-encoding'], 'aesgcm', 'Content-Encoding header correct');
8989

90-
var decrypted = ece.decrypt(body, {
91-
keyid: 'webpushKey',
92-
dh: appServerPublicKey,
93-
salt: salt,
94-
authSecret: urlBase64.encode(intermediateUserAuth),
95-
padSize: 1,
96-
});
97-
} else if (req.headers['content-encoding'] === 'aesgcm') {
9890
ece.saveKey('webpushKey', userCurve, 'P-256');
9991

10092
var decrypted = ece.decrypt(body, {
@@ -105,7 +97,7 @@ suite('sendNotification', function() {
10597
padSize: 2,
10698
});
10799
} else {
108-
assert(false, 'Invalid crypto header or content-encoding header value');
100+
assert(false, 'Invalid crypto header value');
109101
}
110102
} else {
111103
assert.equal(req.headers[cryptoHeader].indexOf('keyid=p256dh;dh='), 0, 'Encryption-Key header correct');
@@ -202,23 +194,6 @@ suite('sendNotification', function() {
202194
});
203195
});
204196

205-
test('send/receive string (intermediate standard)', function() {
206-
return startServer('hello')
207-
.then(function() {
208-
return webPush.sendNotification('https://127.0.0.1:' + serverPort, {
209-
userPublicKey: urlBase64.encode(userPublicKey),
210-
userAuth: urlBase64.encode(intermediateUserAuth),
211-
payload: 'hello',
212-
});
213-
})
214-
.then(function(body) {
215-
assert(true, 'sendNotification promise resolved');
216-
assert.equal(body, 'ok');
217-
}, function(e) {
218-
assert(false, 'sendNotification promise rejected with: ' + e);
219-
});
220-
});
221-
222197
test('send/receive string (new standard)', function() {
223198
return startServer('hello')
224199
.then(function() {
@@ -468,29 +443,6 @@ suite('sendNotification', function() {
468443
});
469444
});
470445

471-
test('send notification with message (intermediate standard) with vapid', function() {
472-
return startServer('hello', undefined, undefined, undefined, true)
473-
.then(function() {
474-
return webPush.sendNotification('https://127.0.0.1:' + serverPort, {
475-
userPublicKey: urlBase64.encode(userPublicKey),
476-
userAuth: urlBase64.encode(intermediateUserAuth),
477-
payload: 'hello',
478-
vapid: {
479-
audience: 'https://www.mozilla.org/',
480-
subject: 'mailto:[email protected]',
481-
privateKey: vapidKeys.privateKey,
482-
publicKey: vapidKeys.publicKey,
483-
},
484-
});
485-
})
486-
.then(function(body) {
487-
assert(true, 'sendNotification promise resolved');
488-
assert.equal(body, 'ok');
489-
}, function(e) {
490-
assert(false, 'sendNotification promise rejected with ' + e);
491-
});
492-
});
493-
494446
test('send notification with message (new standard) with vapid', function() {
495447
return startServer('hello', undefined, undefined, undefined, true)
496448
.then(function() {

0 commit comments

Comments
 (0)