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

Side by Side Diff: pkg/analyzer/test/instrumentation/instrumentation_test.dart

Issue 840553004: Capture log messages via instrumentation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer/lib/instrumentation/instrumentation.dart ('k') | no next file » | no next file with comments »
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 test.instrumentation; 5 library test.instrumentation;
6 6
7 import 'package:analyzer/instrumentation/instrumentation.dart'; 7 import 'package:analyzer/instrumentation/instrumentation.dart';
8 import 'package:unittest/unittest.dart'; 8 import 'package:unittest/unittest.dart';
9 9
10 import '../reflective_tests.dart'; 10 import '../reflective_tests.dart';
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 } 49 }
50 50
51 void test_logException_noTrace() { 51 void test_logException_noTrace() {
52 TestInstrumentationServer server = new TestInstrumentationServer(); 52 TestInstrumentationServer server = new TestInstrumentationServer();
53 InstrumentationService service = new InstrumentationService(server); 53 InstrumentationService service = new InstrumentationService(server);
54 String message = 'exceptionMessage'; 54 String message = 'exceptionMessage';
55 service.logException(message, null); 55 service.logException(message, null);
56 assertNormal(server, InstrumentationService.TAG_EXCEPTION, '$message:null'); 56 assertNormal(server, InstrumentationService.TAG_EXCEPTION, '$message:null');
57 } 57 }
58 58
59 void test_logLogEntry() {
60 TestInstrumentationServer server = new TestInstrumentationServer();
61 InstrumentationService service = new InstrumentationService(server);
62 String level = 'level';
63 DateTime time = new DateTime(2001);
64 String message = 'message';
65 service.logLogEntry(level, time, message);
66 assertNormal(
67 server,
68 InstrumentationService.TAG_LOG_ENTRY,
69 '$level:2001-01-01 00::00::00.000:$message');
70 }
71
59 void test_logNotification() { 72 void test_logNotification() {
60 TestInstrumentationServer server = new TestInstrumentationServer(); 73 TestInstrumentationServer server = new TestInstrumentationServer();
61 InstrumentationService service = new InstrumentationService(server); 74 InstrumentationService service = new InstrumentationService(server);
62 String message = 'notificationText'; 75 String message = 'notificationText';
63 service.logNotification(message); 76 service.logNotification(message);
64 assertNormal(server, InstrumentationService.TAG_NOTIFICATION, message); 77 assertNormal(server, InstrumentationService.TAG_NOTIFICATION, message);
65 } 78 }
66 79
67 void test_logRequest() { 80 void test_logRequest() {
68 TestInstrumentationServer server = new TestInstrumentationServer(); 81 TestInstrumentationServer server = new TestInstrumentationServer();
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 @override 147 @override
135 void logWithPriority(String message) { 148 void logWithPriority(String message) {
136 priorityChannel.writeln(message); 149 priorityChannel.writeln(message);
137 } 150 }
138 151
139 @override 152 @override
140 void shutdown() { 153 void shutdown() {
141 // Ignored 154 // Ignored
142 } 155 }
143 } 156 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/instrumentation/instrumentation.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698