Update web-platform-tests to revision cf926057109b153af54214d52a2b3d746269d434

This commit is contained in:
WPT Sync Bot 2020-05-20 08:20:23 +00:00
parent 7e74f73301
commit 9309f626be
90 changed files with 2262 additions and 1287 deletions

View file

@ -399,7 +399,7 @@ function runGenericSensorTests(sensorName,
const mockSensor = await sensorProvider.getCreatedSensor(sensorName);
await mockSensor.setSensorReading(readings);
const fastCounter = await new Promise((resolve, reject) => {
return new Promise((resolve, reject) => {
let fastSensorNotifiedCounter = 0;
let slowSensorNotifiedCounter = 0;
@ -413,10 +413,17 @@ function runGenericSensorTests(sensorName,
const slowSensor = new sensorType({frequency: slowFrequency});
slowSensor.onreading = () => {
// Skip the initial notification that always comes immediately.
if (slowSensorNotifiedCounter === 1) {
if (slowSensorNotifiedCounter === 2) {
fastSensor.stop();
slowSensor.stop();
resolve(fastSensorNotifiedCounter);
try {
assert_greater_than(fastSensorNotifiedCounter, 3,
"Fast sensor overtakes the slow one");
resolve();
} catch (e) {
reject(e);
}
}
slowSensorNotifiedCounter++;
}
@ -427,7 +434,6 @@ function runGenericSensorTests(sensorName,
}
fastSensor.onerror = reject;
});
assert_greater_than(fastCounter, 2, "Fast sensor overtakes the slow one");
}, `${sensorName}: frequency hint works.`);
// Re-enable after https://github.com/w3c/sensors/issues/361 is fixed.