mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 593358 - Avoid use of setTimeout to check more geolocation results. r=dougt a=test-only
--HG-- extra : rebase_source : e023865e5f432a87a981fe19c09dbab5fd603cd4
This commit is contained in:
parent
0268cab922
commit
3c024e757b
@ -24,21 +24,30 @@ SimpleTest.waitForExplicitFinish();
|
||||
resume_geolocationProvider();
|
||||
force_prompt(true);
|
||||
|
||||
var successCallbackCalled = false;
|
||||
var successCallbackCalled = 0;
|
||||
var failureCallbackCalled = 0;
|
||||
const totalResults = 100;
|
||||
|
||||
function successCallback(position) {
|
||||
successCallbackCalled = true;
|
||||
successCallbackCalled++;
|
||||
testPassed();
|
||||
}
|
||||
|
||||
for (var x = 0; x < 100; x++)
|
||||
navigator.geolocation.getCurrentPosition(successCallback);
|
||||
function failureCallback(code) {
|
||||
failureCallbackCalled++;
|
||||
testPassed();
|
||||
}
|
||||
|
||||
for (var x = 0; x < totalResults; x++)
|
||||
navigator.geolocation.getCurrentPosition(successCallback, failureCallback);
|
||||
|
||||
function testPassed() {
|
||||
ok(successCallbackCalled, "if nothing crashed, all okay");
|
||||
if (successCallbackCalled + failureCallbackCalled != totalResults)
|
||||
return;
|
||||
is(failureCallbackCalled, 0, "no failure callbacks should have been received");
|
||||
reset_prompt();
|
||||
SimpleTest.finish();
|
||||
}
|
||||
setTimeout(testPassed, 1000);
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
|
@ -44,7 +44,7 @@ for (var x = 0; x < totalResults; x++)
|
||||
function testPassed() {
|
||||
if (successCallbackCalled + failureCallbackCalled != totalResults)
|
||||
return;
|
||||
is(failureCallbackCalled, 0, "if nothing crashed, all okay");
|
||||
is(failureCallbackCalled, 0, "no failure callbacks should have been received");
|
||||
reset_prompt();
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user