Merge pull request #7440 from ahocevar/font-load

Attempt to make font loading tests more stable
This commit is contained in:
Andreas Hocevar
2017-11-10 10:09:42 +01:00
committed by GitHub
2 changed files with 9 additions and 6 deletions

View File

@@ -6,7 +6,7 @@ goog.require('ol.render.canvas');
describe('ol.render.canvas', function() {
var font = document.createElement('link');
font.href = 'https://fonts.googleapis.com/css?family=Inconsolata';
font.href = 'https://fonts.googleapis.com/css?family=Abel&text=wmytzilWMYTZIL%40%23%2F%26%3F%24%2510';
font.rel = 'stylesheet';
var head = document.getElementsByTagName('head')[0];
@@ -55,7 +55,7 @@ describe('ol.render.canvas', function() {
head.appendChild(font);
var spy = sinon.spy();
ol.events.listen(ol.render.canvas.labelCache, 'clear', spy);
checkFont('12px Inconsolata');
checkFont('12px Abel');
setTimeout(function() {
ol.events.unlisten(ol.render.canvas.labelCache, 'clear', spy);
head.removeChild(font);