blob: fc1c6ad86a94a100b8607b1c9c5870c9d1a26cb4 [file] [log] [blame]
<!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 that navigator.geolocation.watchPosition returns unique results within its script execution context.");
const mock = new GeolocationMock();
mock.setGeolocationPosition(51.478, -0.166, 100.0);
const watchID1 = navigator.geolocation.watchPosition(function() { });
const watchID2 = navigator.geolocation.watchPosition(function() { });
const watchID3 = navigator.geolocation.watchPosition(function() { });
assert_greater_than(watchID1, 0);
assert_greater_than(watchID2, 0);
assert_greater_than(watchID3, 0);
assert_not_equals(watchID1, watchID2);
assert_not_equals(watchID1, watchID3);
assert_not_equals(watchID2, watchID3);
finishJSTest();
</script>
</body>
</html>