<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/testharness-adapter.js"></script>
</head>
<body>
<script type="module">
import {GeolocationMock} from './resources/geolocation-mock.js';
description("Tests formatting of position.toString().");
const mockLatitude = 51.478;
const mockLongitude = -0.166;
const mockAccuracy = 100.0;
let position;
const mock = new GeolocationMock();
mock.setGeolocationPermission(true);
mock.setGeolocationPosition(mockLatitude,
mockLongitude,
mockAccuracy);
navigator.geolocation.getCurrentPosition(function(p) {
// shouldBe can't use local variables yet.
position = p;
assert_equals(position.coords.latitude, mockLatitude);
assert_equals(position.coords.longitude, mockLongitude);
assert_equals(position.coords.accuracy, mockAccuracy);
assert_equals(position.toString(), "[object GeolocationPosition]");
assert_equals(position.coords.toString(), "[object GeolocationCoordinates]");
finishJSTest();
}, function(e) {
testFailed('Error callback invoked unexpectedly');
finishJSTest();
});
</script>
</body>
</html>