Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test fixes for TileMapServiceImageryProvider #3151

Merged
merged 2 commits into from
Oct 30, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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