test for ignoreCertificateError

This commit is contained in:
deepak1556 2015-03-10 12:39:23 +05:30
Родитель 6856d203c5
Коммит dd706ea6e2
3 изменённых файлов: 30 добавлений и 10 удалений

Просмотреть файл

@ -1,6 +1,8 @@
assert = require 'assert'
http = require 'http'
https = require 'https'
path = require 'path'
pem = require 'pem'
describe 'chromium feature', ->
fixtures = path.resolve __dirname, 'fixtures'
@ -9,16 +11,33 @@ describe 'chromium feature', ->
it 'does not crash', ->
process.atomBinding('v8_util').takeHeapSnapshot()
describe 'sending request of http protocol urls', ->
describe 'sending request of https 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}"
options = {
days: 1,
selfSigned: true
}
pem.createCertificate options, (err, keys) ->
server = https.createServer {key: keys.serviceKey, cert: keys.certificate}, (req, res) ->
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', ->
it 'calls its callbacks', (done) ->

Просмотреть файл

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

Просмотреть файл

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