electron/spec/api-web-frame-spec.js

20 lines
621 B
JavaScript
Raw Normal View History

2016-03-25 20:03:49 +00:00
const assert = require('assert')
const path = require('path')
const webFrame = require('electron').webFrame
2016-01-12 02:40:23 +00:00
2016-03-25 20:03:49 +00:00
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'
2016-03-30 21:56:30 +00:00
window.fetch(url).then(function (response) {
2016-03-25 20:03:49 +00:00
assert(response.ok)
done()
}).catch(function (err) {
done('unexpected error : ' + err)
})
})
})
})