Skip to content

Commit

Permalink
Merge pull request #3151 from tiffanylu/tmsSpec
Browse files Browse the repository at this point in the history
test fixes for TileMapServiceImageryProvider
  • Loading branch information
pjcozzi committed Oct 30, 2015
2 parents 223ed22 + 46d7a7c commit 28b7ed7
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions Specs/Scene/TileMapServiceImageryProviderSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,23 @@ defineSuite([
var provider = new TileMapServiceImageryProvider({
url : 'made/up/tms/server'
});
expect(provider.credit).toBeUndefined();
return pollToPromise(function() {
return provider.ready;
}).then(function() {
expect(provider.credit).toBeUndefined();
});
});

it('turns the supplied credit into a logo', function() {
var providerWithCredit = new TileMapServiceImageryProvider({
url : 'made/up/gms/server',
credit : 'Thanks to our awesome made up source of this imagery!'
});
expect(providerWithCredit.credit).toBeDefined();
return pollToPromise(function() {
return providerWithCredit.ready;
}).then(function() {
expect(providerWithCredit.credit).toBeDefined();
});
});

it('routes resource request through a proxy if one is specified', function() {
Expand Down Expand Up @@ -481,7 +489,7 @@ defineSuite([

expect(provider.rectangle.west).toEqual(expectedSW.longitude);
expect(provider.rectangle.south).toEqual(expectedSW.latitude);
expect(provider.rectangle.east).toEqual(expectedNE.longitude);
expect(provider.rectangle.east).toBeCloseTo(expectedNE.longitude, CesiumMath.EPSILON14);
expect(provider.rectangle.north).toEqual(expectedNE.latitude);
});
});
Expand Down Expand Up @@ -520,9 +528,9 @@ defineSuite([
var expectedSW = Cartographic.fromDegrees(-123.0, -10.0);
var expectedNE = Cartographic.fromDegrees(-110.0, 11.0);

expect(provider.rectangle.west).toEqual(expectedSW.longitude);
expect(provider.rectangle.west).toBeCloseTo(expectedSW.longitude, CesiumMath.EPSILON14);
expect(provider.rectangle.south).toEqual(expectedSW.latitude);
expect(provider.rectangle.east).toEqual(expectedNE.longitude);
expect(provider.rectangle.east).toBeCloseTo(expectedNE.longitude, CesiumMath.EPSILON14);
expect(provider.rectangle.north).toEqual(expectedNE.latitude);
});
});
Expand Down Expand Up @@ -561,9 +569,9 @@ defineSuite([
var expectedSW = Cartographic.fromDegrees(-123.0, -10.0);
var expectedNE = Cartographic.fromDegrees(-110.0, 11.0);

expect(provider.rectangle.west).toEqual(expectedSW.longitude);
expect(provider.rectangle.west).toBeCloseTo(expectedSW.longitude, CesiumMath.EPSILON14);
expect(provider.rectangle.south).toEqual(expectedSW.latitude);
expect(provider.rectangle.east).toEqual(expectedNE.longitude);
expect(provider.rectangle.east).toBeCloseTo(expectedNE.longitude, CesiumMath.EPSILON14);
expect(provider.rectangle.north).toEqual(expectedNE.latitude);
});
});
Expand Down Expand Up @@ -602,9 +610,9 @@ defineSuite([
var expectedSW = Cartographic.fromDegrees(-123.0, -10.0);
var expectedNE = Cartographic.fromDegrees(-110.0, 11.0);

expect(provider.rectangle.west).toEqual(expectedSW.longitude);
expect(provider.rectangle.west).toBeCloseTo(expectedSW.longitude, CesiumMath.EPSILON14);
expect(provider.rectangle.south).toEqual(expectedSW.latitude);
expect(provider.rectangle.east).toEqual(expectedNE.longitude);
expect(provider.rectangle.east).toBeCloseTo(expectedNE.longitude, CesiumMath.EPSILON14);
expect(provider.rectangle.north).toEqual(expectedNE.latitude);
});
});
Expand Down

0 comments on commit 28b7ed7

Please sign in to comment.