Skip to content

Commit b99c45b

Browse files
committed
Merge pull request #134 from marco-c/no_https_in_test
Don't use HTTPS server for tests
2 parents 36c55ad + 314185e commit b99c45b

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

test/server.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var webPush = require('../index');
2-
var https = require('https');
2+
var http = require('http');
33
var fs = require('fs');
44
var path = require('path');
55
var colors = require('colors');
@@ -11,15 +11,8 @@ if (!process.env.GCM_API_KEY) {
1111
webPush.setGCMAPIKey(process.env.GCM_API_KEY);
1212
}
1313

14-
var pem = fs.readFileSync('test/cert.pem');
15-
16-
var options = {
17-
key: pem,
18-
cert: pem,
19-
};
20-
2114
function createServer(pushPayload, vapid) {
22-
var server = https.createServer(options, function(req, res) {
15+
var server = http.createServer(function(req, res) {
2316
if (req.method === 'GET') {
2417
if (req.url === '/') {
2518
req.url = '/index.html';

test/testSelenium.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ suite('selenium', function() {
4949
var profilePath = temp.mkdirSync('marco');
5050

5151
var profile = new firefox.Profile(profilePath);
52-
profile.acceptUntrustedCerts();
5352
profile.setPreference('security.turn_off_all_security_so_that_viruses_can_take_over_this_computer', true);
5453
profile.setPreference('extensions.checkCompatibility.nightly', false);
5554
// Only allow installation of third-party addons from the user's profile dir (needed to block the third-party
@@ -77,16 +76,16 @@ suite('selenium', function() {
7776
if (typeof netscape !== 'undefined') {
7877
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
7978
Components.utils.import('resource://gre/modules/Services.jsm');
80-
var uri = Services.io.newURI('https://127.0.0.1:' + port, null, null);
79+
var uri = Services.io.newURI('http://127.0.0.1:' + port, null, null);
8180
var principal = Services.scriptSecurityManager.getNoAppCodebasePrincipal(uri);
8281
Services.perms.addFromPrincipal(principal, 'desktop-notification', Services.perms.ALLOW_ACTION);
8382
}
8483
}, server.port);
8584

86-
driver.get('https://127.0.0.1:' + server.port);
85+
driver.get('http://127.0.0.1:' + server.port);
8786

8887
driver.executeScript(function(port) {
89-
serverAddress = 'https://127.0.0.1:' + port;
88+
serverAddress = 'http://127.0.0.1:' + port;
9089
go();
9190
}, server.port);
9291

0 commit comments

Comments
 (0)