Only test ol.interaction.DragAndDrop if FileReader is supported

This commit is contained in:
Frederic Junod
2017-06-06 08:55:07 +02:00
parent dfc4bff579
commit 22939abb0d
2 changed files with 5 additions and 2 deletions

View File

@@ -8,7 +8,7 @@ goog.require('ol.format.GeoJSON');
goog.require('ol.interaction.DragAndDrop');
describe('ol.interaction.DragAndDrop', function() {
where('FileReader').describe('ol.interaction.DragAndDrop', function() {
var viewport, map, interaction;
beforeEach(function() {
@@ -83,9 +83,11 @@ describe('ol.interaction.DragAndDrop', function() {
});
describe('#handleDrop_', function() {
var OrigFileReader = FileReader;
var OrigFileReader;
beforeEach(function() {
OrigFileReader = FileReader;
FileReader = function() {
ol.events.EventTarget.apply(this, arguments);
this.readAsText = function(file) {