Re: Geolocation test-suite

Thanks for the comments Hari.

> 5. In the tests where heading values are checked, isn't a valid speed also
> required to be present? The spec. says that when speed is 0, heading should
> be NaN; So when speed is null, can heading be valid? (Tests affected are 68,
> 37, 103)
The spec states that both speed and heading are optional. Either can
be provided independently of the other. The only restriction is a
physical one - if the speed is zero, the heading must be NaN.

It think that all of your other comments are valid, and the tests
require updating.

However, there seems to me to be a more fundamental problem with many
of the tests. The tests use a setupDevice() function to 'control the
geolocation device'. If I understand correctly, this is to mock the
output of the underlying source of position information, eg a GPS or
network service. Having set this mock position, the tests then check
for the expected values passed to JavaScript. The problem is that the
spec says nothing about how an implementation should convert from the
output of its internal source of position information to the values
passed to JavaScript. This is purely an implementation detail of the
UA. For example, a compliant implementation, on receiving a speed of
-3 m/s from its internal source of position information, could provide
a value of null, 0 or 42 for position.coords.speed. So I'm not sure
the tests that use this feature are achieving anything useful.

Furthermore, if an implementer were to modify their UA to support this
mocking, it's likely that the code path being tested by the tests
would be very specific to the mocking. For example, when setupDevice()
is used to supply an illegal negative accuracy, the code that detects
this and causes the error callback to invoked is very likely to be
specific to the mocking, and not present in the normal flow of the UA.

Steve

--
Google UK Limited
Registered Office: Belgrave House, 76 Buckingham Palace Road, London SW1W 9TQ
Registered in England Number: 3977902

Received on Wednesday, 1 December 2010 16:48:08 UTC