test for ignoreCertificateError

This commit is contained in:
deepak1556 2015-03-10 12:39:23 +05:30
parent 6856d203c5
commit dd706ea6e2
3 changed files with 30 additions and 10 deletions

View file

@ -1,6 +1,8 @@
assert = require 'assert' assert = require 'assert'
http = require 'http' http = require 'http'
https = require 'https'
path = require 'path' path = require 'path'
pem = require 'pem'
describe 'chromium feature', -> describe 'chromium feature', ->
fixtures = path.resolve __dirname, 'fixtures' fixtures = path.resolve __dirname, 'fixtures'
@ -9,16 +11,33 @@ describe 'chromium feature', ->
it 'does not crash', -> it 'does not crash', ->
process.atomBinding('v8_util').takeHeapSnapshot() process.atomBinding('v8_util').takeHeapSnapshot()
describe 'sending request of http protocol urls', -> describe 'sending request of https protocol urls', ->
it 'does not crash', (done) -> it 'does not crash', (done) ->
@timeout 5000 @timeout 5000
server = http.createServer (req, res) -> options = {
res.end() days: 1,
server.close() selfSigned: true
done() }
server.listen 0, '127.0.0.1', -> pem.createCertificate options, (err, keys) ->
{port} = server.address() server = https.createServer {key: keys.serviceKey, cert: keys.certificate}, (req, res) ->
$.get "http://127.0.0.1:#{port}" res.end('hello!')
server.close()
done()
server.listen 4300, '127.0.0.1', ->
{port} = server.address()
$.get "https://127.0.0.1:#{port}", (res) ->
assert.equal res, "hello!"
describe 'sending request of http protocol urls', ->
it 'does not crash', (done) ->
@timeout 5000
server = http.createServer (req, res) ->
res.end()
server.close()
done()
server.listen 0, '127.0.0.1', ->
{port} = server.address()
$.get "http://127.0.0.1:#{port}"
describe 'navigator.webkitGetUserMedia', -> describe 'navigator.webkitGetUserMedia', ->
it 'calls its callbacks', (done) -> it 'calls its callbacks', (done) ->

View file

@ -3,12 +3,12 @@
"productName": "Atom Shell Test App", "productName": "Atom Shell Test App",
"main": "static/main.js", "main": "static/main.js",
"version": "0.1.0", "version": "0.1.0",
"devDependencies": { "devDependencies": {
"formidable": "1.0.16", "formidable": "1.0.16",
"graceful-fs": "3.0.5", "graceful-fs": "3.0.5",
"q": "0.9.7",
"mocha": "2.1.0", "mocha": "2.1.0",
"pem": "^1.7.1",
"q": "0.9.7",
"runas": "2.x", "runas": "2.x",
"temp": "0.8.1", "temp": "0.8.1",
"walkdir": "0.0.7" "walkdir": "0.0.7"

View file

@ -7,6 +7,7 @@ var Menu = require('menu');
var window = null; var window = null;
app.commandLine.appendSwitch('js-flags', '--expose_gc'); app.commandLine.appendSwitch('js-flags', '--expose_gc');
app.commandLine.appendSwitch('ignore-certificate-errors');
ipc.on('message', function(event, arg) { ipc.on('message', function(event, arg) {
event.sender.send('message', arg); event.sender.send('message', arg);