mirror of
https://github.com/servo/servo.git
synced 2025-08-23 06:15:35 +01:00
Update web-platform-tests to revision d647a1bc742a533186d8297cae2a2bee669c7780
This commit is contained in:
parent
bf192caf4b
commit
4cf0a092d0
41 changed files with 897 additions and 487 deletions
|
@ -109,12 +109,16 @@ function test_tone_change_events(testFunc, toneChanges, desc) {
|
|||
const now = Date.now();
|
||||
const duration = now - lastEventTime;
|
||||
|
||||
assert_approx_equals(duration, expectedDuration, 400,
|
||||
// We check that the delay is at least the expected one, but
|
||||
// system load may cause random delay, so we do not put any
|
||||
// realistic upper bound on the timing of the event.
|
||||
assert_between_inclusive(duration, expectedDuration,
|
||||
expectedDuration + 4000,
|
||||
`Expect tonechange event for "${tone}" to be fired approximately after ${expectedDuration} milliseconds`);
|
||||
|
||||
lastEventTime = now;
|
||||
|
||||
if(toneChanges.length === 0) {
|
||||
if (toneChanges.length === 0) {
|
||||
// Wait for same duration as last expected duration + 100ms
|
||||
// before passing test in case there are new tone events fired,
|
||||
// in which case the test should fail.
|
||||
|
|
|
@ -161,13 +161,7 @@
|
|||
test_tone_change_events((t, dtmfSender) => {
|
||||
dtmfSender.addEventListener('tonechange', ev => {
|
||||
if(ev.tone === 'B') {
|
||||
// Set a timeout to make sure the toneBuffer
|
||||
// is changed after the tonechange event listener
|
||||
// by test_tone_change_events is called.
|
||||
// This is to correctly test the expected toneBuffer.
|
||||
t.step_timeout(() => {
|
||||
dtmfSender.insertDTMF('12', 100, 70);
|
||||
}, 10);
|
||||
dtmfSender.insertDTMF('12', 100, 70);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -189,10 +183,8 @@
|
|||
test_tone_change_events((t, dtmfSender) => {
|
||||
dtmfSender.addEventListener('tonechange', ev => {
|
||||
if(ev.tone === 'B') {
|
||||
t.step_timeout(() => {
|
||||
dtmfSender.insertDTMF('12', 100, 70);
|
||||
dtmfSender.insertDTMF('34', 100, 70);
|
||||
}, 10);
|
||||
dtmfSender.insertDTMF('12', 100, 70);
|
||||
dtmfSender.insertDTMF('34', 100, 70);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -213,9 +205,7 @@
|
|||
test_tone_change_events((t, dtmfSender) => {
|
||||
dtmfSender.addEventListener('tonechange', ev => {
|
||||
if(ev.tone === 'B') {
|
||||
t.step_timeout(() => {
|
||||
dtmfSender.insertDTMF('');
|
||||
}, 10);
|
||||
dtmfSender.insertDTMF('');
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue