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

Unified Diff: pkg/logging/test/logging_test.dart

Issue 12334093: pkg/logging: BREAKING: move to stream-based event model (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rename test (must end in _test) Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/logging/test/logging_deprecated_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/logging/test/logging_test.dart
diff --git a/pkg/logging/test/logging_test.dart b/pkg/logging/test/logging_test.dart
index 6444e3aa9a4bfdbfbd8d2ff4e8224c6f259b3309..1af342f5ed173f8e5277af218c7262888690c315 100644
--- a/pkg/logging/test/logging_test.dart
+++ b/pkg/logging/test/logging_test.dart
@@ -123,12 +123,12 @@ main() {
c.level = null;
d.level = null;
e.level = null;
- root.on.record.clear();
- a.on.record.clear();
- b.on.record.clear();
- c.on.record.clear();
- d.on.record.clear();
- e.on.record.clear();
+ root.clearListeners();
+ a.clearListeners();
+ b.clearListeners();
+ c.clearListeners();
+ d.clearListeners();
+ e.clearListeners();
hierarchicalLoggingEnabled = false;
root.level = Level.INFO;
});
@@ -182,11 +182,11 @@ main() {
test('add/remove handlers - no hierarchy', () {
int calls = 0;
var handler = (_) { calls++; };
- c.on.record.add(handler);
+ final sub = c.onRecord.listen(handler);
root.info("foo");
root.info("foo");
expect(calls, equals(2));
- c.on.record.remove(handler);
+ sub.cancel();
root.info("foo");
expect(calls, equals(2));
});
@@ -195,7 +195,7 @@ main() {
hierarchicalLoggingEnabled = true;
int calls = 0;
var handler = (_) { calls++; };
- c.on.record.add(handler);
+ c.onRecord.listen(handler);
root.info("foo");
root.info("foo");
expect(calls, equals(0));
@@ -204,7 +204,7 @@ main() {
test('logging methods store appropriate level', () {
root.level = Level.ALL;
var rootMessages = [];
- root.on.record.add((record) {
+ root.onRecord.listen((record) {
rootMessages.add('${record.level}: ${record.message}');
});
@@ -233,13 +233,13 @@ main() {
var rootMessages = [];
var aMessages = [];
var cMessages = [];
- c.on.record.add((record) {
+ c.onRecord.listen((record) {
cMessages.add('${record.level}: ${record.message}');
});
- a.on.record.add((record) {
+ a.onRecord.listen((record) {
aMessages.add('${record.level}: ${record.message}');
});
- root.on.record.add((record) {
+ root.onRecord.listen((record) {
rootMessages.add('${record.level}: ${record.message}');
});
@@ -281,13 +281,13 @@ main() {
var rootMessages = [];
var aMessages = [];
var cMessages = [];
- c.on.record.add((record) {
+ c.onRecord.listen((record) {
cMessages.add('${record.level}: ${record.message}');
});
- a.on.record.add((record) {
+ a.onRecord.listen((record) {
aMessages.add('${record.level}: ${record.message}');
});
- root.on.record.add((record) {
+ root.onRecord.listen((record) {
rootMessages.add('${record.level}: ${record.message}');
});
« no previous file with comments | « pkg/logging/test/logging_deprecated_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698