Merge pull request #1027 from tschaub/closure-util

Use the closure-util package.  Documentation will come when this is a more complete solution.  See #1027 for basic usage instructions.
This commit is contained in:
Tim Schaub
2013-09-15 15:36:13 -07:00
9 changed files with 164 additions and 32 deletions

View File

@@ -134,24 +134,24 @@ describe('ol.parser.KML', function() {
var p = new ol.parser.KML({extractStyles: true,
trackAttributes: ['speed', 'num']});
var obj = p.read(xml);
expect(obj.features.length).to.eql(170);
expect(obj.features.length).to.be(170);
var attr = obj.features[4].getAttributes();
// standard track point attributes
expect(attr['when'] instanceof Date).to.be.ok();
expect(attr['when'].getTime()).to.eql(1272736815000);
expect(attr['altitude']).to.eql(1006);
expect(attr['heading']).to.eql(230);
expect(attr['tilt']).to.eql(0);
expect(attr['roll']).to.eql(0);
expect(attr['name']).to.eql('B752');
expect(attr['adflag']).to.eql('A');
expect(attr['flightid']).to.eql('DAL2973');
expect(attr['speed']).to.eql('166');
expect(attr['num']).to.eql('50');
expect(attr.when).to.be.a(Date);
expect(attr.when.getTime()).to.be(1272736815000);
expect(attr.altitude).to.be(1006);
expect(attr.heading).to.be(230);
expect(attr.tilt).to.be(0);
expect(attr.roll).to.be(0);
expect(attr.name).to.be('B752');
expect(attr.adflag).to.be('A');
expect(attr.flightid).to.be('DAL2973');
expect(attr.speed).to.be('166');
expect(attr.num).to.be('50');
var geom = obj.features[4].getGeometry();
expect(geom.get(0)).to.eql(-93.0753620391713);
expect(geom.get(1)).to.eql(44.9879724110872);
expect(geom.get(2)).to.eql(1006);
expect(geom.get(0)).to.be(-93.0753620391713);
expect(geom.get(1)).to.be(44.9879724110872);
expect(geom.get(2)).to.be(1006);
done();
});
});

View File

@@ -3,6 +3,14 @@ goog.provide('ol.test.proj.EPSG3857');
describe('ol.proj.EPSG3857', function() {
beforeEach(function() {
ol.proj.common.add();
});
afterEach(function() {
ol.proj.clearAllProjections();
});
describe('getPointResolution', function() {
it('returns the correct point scale at the equator', function() {
@@ -44,4 +52,5 @@ describe('ol.proj.EPSG3857', function() {
goog.require('ol.proj');
goog.require('ol.proj.common');
goog.require('ol.proj.EPSG3857');

View File

@@ -3,24 +3,11 @@ goog.provide('ol.test.proj');
describe('ol.proj', function() {
beforeEach(function() {
sinon.spy(ol.proj, 'addTransform');
ol.proj.common.add();
});
afterEach(function() {
var argsForCall = ol.proj.addTransform.args;
for (var i = 0, ii = argsForCall.length; i < ii; ++i) {
try {
ol.proj.removeTransform.apply(ol.proj, argsForCall[i].splice(0, 2));
} catch (error) {
if (error instanceof goog.asserts.AssertionError) {
// The removeTransform function may have been called explicitly by the
// tests, so we pass.
} else {
throw error;
}
}
}
ol.proj.addTransform.restore();
ol.proj.clearAllProjections();
});
describe('projection equivalence', function() {
@@ -364,7 +351,7 @@ describe('ol.proj', function() {
goog.require('goog.array');
goog.require('goog.asserts.AssertionError');
goog.require('ol.Projection');
goog.require('ol.ProjectionUnits');
goog.require('ol.proj');
goog.require('ol.proj.common');

View File

@@ -12,6 +12,8 @@ describe('ol.renderer.webgl.ImageLayer', function() {
var imageExtent;
beforeEach(function() {
ol.proj.common.add();
map = new ol.Map({
target: document.createElement('div')
});
@@ -80,6 +82,7 @@ goog.require('goog.dispose');
goog.require('goog.vec.Mat4');
goog.require('goog.vec.Vec4');
goog.require('ol.Map');
goog.require('ol.proj.common');
goog.require('ol.layer.Image');
goog.require('ol.source.Image');
goog.require('ol.renderer.webgl.ImageLayer');