Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: test/stream_group_test.dart

Issue 1216313003: pkg/async: cleanup unused variables in tests (Closed) Base URL: https://github.com/dart-lang/async.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/stream_zip_test.dart » ('j') | test/stream_zip_test.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library async.test.stream_group_test; 5 library async.test.stream_group_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:async/async.dart'; 9 import 'package:async/async.dart';
10 import 'package:test/test.dart'; 10 import 'package:test/test.dart';
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 streamGroup.add(controller.stream); 465 streamGroup.add(controller.stream);
466 streamGroup.add(controller.stream); 466 streamGroup.add(controller.stream);
467 467
468 // If the stream was actually listened to multiple times, this would 468 // If the stream was actually listened to multiple times, this would
469 // throw a StateError. 469 // throw a StateError.
470 streamGroup.stream.listen(null); 470 streamGroup.stream.listen(null);
471 }); 471 });
472 }); 472 });
473 473
474 group("while active", () { 474 group("while active", () {
475 var subscription;
476 setUp(() async { 475 setUp(() async {
477 subscription = streamGroup.stream.listen(null); 476 streamGroup.stream.listen(null);
478 await flushMicrotasks(); 477 await flushMicrotasks();
479 }); 478 });
480 479
481 test("listens to the stream immediately", () async { 480 test("listens to the stream immediately", () async {
482 var controller = new StreamController<String>(); 481 var controller = new StreamController<String>();
483 482
484 expect(streamGroup.add(controller.stream), isNull); 483 expect(streamGroup.add(controller.stream), isNull);
485 await flushMicrotasks(); 484 await flushMicrotasks();
486 expect(controller.hasListener, isTrue); 485 expect(controller.hasListener, isTrue);
487 }); 486 });
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 controller.close(); 714 controller.close();
716 715
717 await streamGroup.close(); 716 await streamGroup.close();
718 expect(events, equals(["one", "two", "three", "four", "five", "six"])); 717 expect(events, equals(["one", "two", "three", "four", "five", "six"]));
719 }); 718 });
720 }); 719 });
721 } 720 }
722 721
723 /// Wait for all microtasks to complete. 722 /// Wait for all microtasks to complete.
724 Future flushMicrotasks() => new Future.delayed(Duration.ZERO); 723 Future flushMicrotasks() => new Future.delayed(Duration.ZERO);
OLDNEW
« no previous file with comments | « no previous file | test/stream_zip_test.dart » ('j') | test/stream_zip_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698