2016-02-17 00:46:49 +00:00
|
|
|
const assert = require('assert');
|
|
|
|
const path = require('path');
|
|
|
|
const webFrame = require('electron').webFrame;
|
2016-01-12 02:40:23 +00:00
|
|
|
|
|
|
|
describe('webFrame module', function() {
|
2016-02-17 01:09:41 +00:00
|
|
|
var fixtures = path.resolve(__dirname, 'fixtures');
|
2016-02-17 01:39:11 +00:00
|
|
|
describe('webFrame.registerURLSchemeAsPrivileged', function() {
|
|
|
|
it('supports fetch api', function(done) {
|
2016-01-12 02:40:23 +00:00
|
|
|
webFrame.registerURLSchemeAsPrivileged('file');
|
2016-02-17 01:09:41 +00:00
|
|
|
var url = "file://" + fixtures + "/assets/logo.png";
|
2016-02-17 01:39:11 +00:00
|
|
|
fetch(url).then(function(response) {
|
2016-01-12 02:40:23 +00:00
|
|
|
assert(response.ok);
|
2016-02-17 01:39:11 +00:00
|
|
|
done();
|
|
|
|
}).catch(function(err) {
|
|
|
|
done('unexpected error : ' + err);
|
2016-01-12 02:40:23 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|