Update web-platform-tests to revision a46616a5b18e83587ddbbed756c7b96cbb4b015d

This commit is contained in:
Josh Matthews 2017-06-19 19:07:14 -04:00 committed by Ms2ger
parent 3f07cfec7c
commit 578498ba24
4001 changed files with 159517 additions and 30260 deletions

View file

@ -14,31 +14,21 @@
var t = async_test('User allows access, check that success callback is called or error callback is called with correct code.'),
onSuccess, onError, hasMethodReturned = false;
onSuccess = t.step_func(function(pos) {
// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00031
test(function() {
t.step(function() {
onSuccess = t.step_func_done(function(pos) {
// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00031
assert_true(hasMethodReturned);
}, 'Check that getCurrentPosition returns synchronously before any callbacks are invoked.');
});
done();
});
onError = t.step_func(function(err) {
// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00031
test(function() {
onError = t.step_func_done(function(err) {
// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00031
assert_true(hasMethodReturned);
}, 'Check that getCurrentPosition returns synchronously before any callbacks are invoked.');
assert_false(isUsingPreemptivePermission);
assert_equals(err.code, err.POSITION_UNAVAILABLE, errorToString(err));
});
assert_true(!isUsingPreemptivePermission && err.code === err.POSITION_UNAVAILABLE);
done();
});
try {
geo.getCurrentPosition(onSuccess, onError);
hasMethodReturned = true;
} catch(e) {
t.step(function() {
assert_unreached('An exception was thrown unexpectedly: ' + e.message);
});
}
});
</script>