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

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

Issue 1257023003: Capture more data when instrumenting exceptions (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 assertNormal( 66 assertNormal(
67 server, InstrumentationService.TAG_FILE_READ, '$path:$time:$content'); 67 server, InstrumentationService.TAG_FILE_READ, '$path:$time:$content');
68 } 68 }
69 69
70 void test_logLogEntry() { 70 void test_logLogEntry() {
71 TestInstrumentationServer server = new TestInstrumentationServer(); 71 TestInstrumentationServer server = new TestInstrumentationServer();
72 InstrumentationService service = new InstrumentationService(server); 72 InstrumentationService service = new InstrumentationService(server);
73 String level = 'level'; 73 String level = 'level';
74 DateTime time = new DateTime(2001); 74 DateTime time = new DateTime(2001);
75 String message = 'message'; 75 String message = 'message';
76 service.logLogEntry(level, time, message); 76 String exception = 'exception';
77 String stackTraceText = 'stackTrace';
78 StackTrace stackTrace = new StackTrace.fromString(stackTraceText);
79 service.logLogEntry(level, time, message, exception, stackTrace);
77 assertNormal(server, InstrumentationService.TAG_LOG_ENTRY, 80 assertNormal(server, InstrumentationService.TAG_LOG_ENTRY,
78 '$level:${time.millisecondsSinceEpoch}:$message'); 81 '$level:${time.millisecondsSinceEpoch}:$message:$exception:$stackTraceTe xt');
79 } 82 }
80 83
81 void test_logNotification() { 84 void test_logNotification() {
82 TestInstrumentationServer server = new TestInstrumentationServer(); 85 TestInstrumentationServer server = new TestInstrumentationServer();
83 InstrumentationService service = new InstrumentationService(server); 86 InstrumentationService service = new InstrumentationService(server);
84 String message = 'notificationText'; 87 String message = 'notificationText';
85 service.logNotification(message); 88 service.logNotification(message);
86 assertNormal(server, InstrumentationService.TAG_NOTIFICATION, message); 89 assertNormal(server, InstrumentationService.TAG_NOTIFICATION, message);
87 } 90 }
88 91
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 @override 169 @override
167 void logWithPriority(String message) { 170 void logWithPriority(String message) {
168 priorityChannel.writeln(message); 171 priorityChannel.writeln(message);
169 } 172 }
170 173
171 @override 174 @override
172 void shutdown() { 175 void shutdown() {
173 // Ignored 176 // Ignored
174 } 177 }
175 } 178 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698