@@ -297,7 +297,7 @@ void main() {
297
297
const waitTime = Duration (milliseconds: 100 );
298
298
// [waitTime] should not be long enough
299
299
// to trigger a "typing stopped" notice.
300
- assert (waitTime < model.typingStoppedWaitPeriod );
300
+ assert (waitTime < store.serverTypingStoppedWaitPeriod );
301
301
302
302
async .elapse (waitTime);
303
303
// t = 100ms: The idle timer is reset to typingStoppedWaitPeriod.
@@ -306,7 +306,7 @@ void main() {
306
306
check (connection.lastRequest).isNull ();
307
307
check (async .pendingTimers).single;
308
308
309
- async .elapse (model.typingStoppedWaitPeriod - const Duration (milliseconds: 1 ));
309
+ async .elapse (store.serverTypingStoppedWaitPeriod - const Duration (milliseconds: 1 ));
310
310
// t = typingStoppedWaitPeriod + 99ms:
311
311
// Since the timer was reset at t = 100ms, the "typing stopped" notice has
312
312
// not been sent yet.
@@ -326,12 +326,12 @@ void main() {
326
326
const waitInterval = Duration (milliseconds: 2000 );
327
327
// [waitInterval] should not be long enough
328
328
// to trigger a "typing stopped" notice.
329
- assert (waitInterval < model.typingStoppedWaitPeriod );
329
+ assert (waitInterval < store.serverTypingStoppedWaitPeriod );
330
330
// [waitInterval] should be short enough
331
331
// that the loop below runs more than once.
332
- assert (waitInterval < model.typingStartedWaitPeriod );
332
+ assert (waitInterval < store.serverTypingStartedWaitPeriod );
333
333
334
- while (async .elapsed <= model.typingStartedWaitPeriod ) {
334
+ while (async .elapsed <= store.serverTypingStartedWaitPeriod ) {
335
335
// t <= typingStartedWaitPeriod: "Typing started" notices are throttled.
336
336
model.keystroke (narrow);
337
337
check (connection.lastRequest).isNull ();
@@ -354,7 +354,7 @@ void main() {
354
354
await prepareStartTyping (async );
355
355
356
356
connection.prepare (json: {});
357
- async .elapse (model.typingStoppedWaitPeriod );
357
+ async .elapse (store.serverTypingStoppedWaitPeriod );
358
358
checkTypingRequest (TypingOp .stop, narrow);
359
359
check (async .pendingTimers).isEmpty ();
360
360
}));
@@ -406,7 +406,7 @@ void main() {
406
406
const waitTime = Duration (milliseconds: 100 );
407
407
// [waitTime] should not be long enough
408
408
// to trigger a "typing stopped" notice.
409
- assert (waitTime < model.typingStoppedWaitPeriod );
409
+ assert (waitTime < store.serverTypingStoppedWaitPeriod );
410
410
411
411
// t = 0ms: Start typing. The idle timer is set to typingStoppedWaitPeriod.
412
412
connection.prepare (json: {});
@@ -429,7 +429,7 @@ void main() {
429
429
async .elapse (Duration .zero);
430
430
check (async .pendingTimers).single;
431
431
432
- async .elapse (model.typingStoppedWaitPeriod - waitTime);
432
+ async .elapse (store.serverTypingStoppedWaitPeriod - waitTime);
433
433
// t = typingStoppedPeriod:
434
434
// Because the old timer has been canceled at t = 100ms,
435
435
// no "typing stopped" notice has been sent yet.
@@ -452,7 +452,7 @@ void main() {
452
452
const waitInterval = Duration (milliseconds: 2000 );
453
453
// [waitInterval] should not be long enough
454
454
// to trigger a "typing stopped" notice.
455
- assert (waitInterval < model.typingStoppedWaitPeriod );
455
+ assert (waitInterval < store.serverTypingStoppedWaitPeriod );
456
456
457
457
// t = 0ms: Start typing. The typing started time is set to 0ms.
458
458
connection.prepare (json: {});
@@ -471,16 +471,16 @@ void main() {
471
471
checkSetTypingStatusRequests (connection.takeRequests (),
472
472
[(TypingOp .stop, topicNarrow), (TypingOp .start, dmNarrow)]);
473
473
474
- while (async .elapsed <= model.typingStartedWaitPeriod ) {
474
+ while (async .elapsed <= store.serverTypingStartedWaitPeriod ) {
475
475
// t <= typingStartedWaitPeriod: "still typing" requests are throttled.
476
476
model.keystroke (dmNarrow);
477
477
check (connection.lastRequest).isNull ();
478
478
479
479
async .elapse (waitInterval);
480
480
}
481
481
482
- assert (async .elapsed > model.typingStartedWaitPeriod );
483
- assert (async .elapsed <= model.typingStartedWaitPeriod + waitInterval);
482
+ assert (async .elapsed > store.serverTypingStartedWaitPeriod );
483
+ assert (async .elapsed <= store.serverTypingStartedWaitPeriod + waitInterval);
484
484
// typingStartedWaitPeriod < t <= typingStartedWaitPeriod + waitInterval * 1:
485
485
// The "still typing" requests are still throttled, because it hasn't
486
486
// been a full typingStartedWaitPeriod since the last time we sent
0 commit comments