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

@ -1,2 +1,3 @@
@zqzhang
@jdm
@mcasas
@zqzhang

View file

@ -43,12 +43,9 @@ test(function() {
try {
geo.getCurrentPosition(
t86.step_func(function(pos) {
assert_unreached('A success callback was invoked unexpectedly');
}),
t86.step_func(function(err) {
t86.unreached_func('A success callback was invoked unexpectedly'),
t86.step_func_done(function(err) {
assert_equals(err.code, err.TIMEOUT);
t86.done();
}),
{timeout: 0, maximumAge: 0}
);
@ -60,12 +57,9 @@ test(function() {
try {
geo.watchPosition(
t88.step_func(function(pos) {
assert_unreached('A success callback was invoked unexpectedly');
}),
t88.step_func(function(err) {
t88.unreached_func('A success callback was invoked unexpectedly'),
t88.step_func_done(function(err) {
assert_equals(err.code, err.TIMEOUT);
t88.done();
}),
{timeout: 0, maximumAge: 0}
);
@ -77,12 +71,9 @@ test(function() {
try {
geo.getCurrentPosition(
t91.step_func(function(pos) {
assert_unreached('A success callback was invoked unexpectedly');
}),
t91.step_func(function(err) {
t91.unreached_func('A success callback was invoked unexpectedly'),
t91.step_func_done(function(err) {
assert_equals(err.code, err.TIMEOUT);
t91.done();
}),
{timeout:-1, maximumAge: 0}
);
@ -94,13 +85,9 @@ test(function() {
try {
geo.watchPosition(
t92.step_func(function(pos) {
assert_unreached('A success callback was invoked unexpectedly');
done();
}),
t92.step_func(function(err) {
t92.unreached_func('A success callback was invoked unexpectedly'),
t92.step_func_done(function(err) {
assert_equals(err.code, err.TIMEOUT);
done();
}),
{timeout: -1, maximumAge: 0}
);

View file

@ -18,6 +18,5 @@ test(function() {
} catch(e) {
assert_unreached('An exception was thrown unexpectedly: ' + e.message);
}
done();
}, 'Test that calling clearWatch with invalid watch IDs does not cause an exception');
</script>

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>

View file

@ -15,20 +15,18 @@ var t = async_test('User denies access, check that error callback is called with
onSuccess, onError, hasMethodReturned = false;
t.step(function() {
onSuccess = t.step_func(function(pos) {
onSuccess = t.step_func_done(function(pos) {
assert_unreached('A success callback was invoked unexpectedly with position ' + positionToString(pos));
});
onError = t.step_func(function(err) {
onError = t.step_func_done(function(err) {
// 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_equals(err.code, err.PERMISSION_DENIED,
'PossitionError code: ' + err.code, + ', message: ' + err.message);
done();
assert_equals(err.code, err.PERMISSION_DENIED, errorToString(err));
});
geo.getCurrentPosition(onSuccess, onError);
hasMethodReturned = true;
});
</script>
</script>

View file

@ -2,7 +2,7 @@ var geo;
setup(function() {
geo = navigator.geolocation;
}, {explicit_done: true});
});
// The spec states that an implementation SHOULD acquire user permission before
// beggining the position acquisition steps. If an implementation follows this

View file

@ -14,18 +14,15 @@
var t = async_test('Check that watchPosition returns synchronously before any callbacks are invoked.'),
id, checkMethodHasReturned, hasMethodReturned = false;
checkMethodHasReturned = t.step_func(function() {
checkMethodHasReturned = t.step_func_done(function() {
assert_true(hasMethodReturned);
done();
});
try {
id = geo.watchPosition(checkMethodHasReturned, checkMethodHasReturned);
hasMethodReturned = true;
} catch(e) {
t.step(function() {
assert_unreached('An exception was thrown unexpectedly: ' + e.message);
});
t.unreached_func('An exception was thrown unexpectedly: ' + e.message);
}
// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00151