electron/spec/api-web-frame-spec.js
2016-03-30 17:00:31 -07:00

19 lines
614 B
JavaScript

const assert = require('assert')
const path = require('path')
const webFrame = require('electron').webFrame
describe('webFrame module', function () {
var fixtures = path.resolve(__dirname, 'fixtures')
describe('webFrame.registerURLSchemeAsPrivileged', function () {
it('supports fetch api', function (done) {
webFrame.registerURLSchemeAsPrivileged('file')
var url = 'file://' + fixtures + '/assets/logo.png'
fetch(url).then(function (response) {
assert(response.ok)
done()
}).catch(function (err) {
done('unexpected error : ' + err)
})
})
})
})