| OLD | NEW |
| 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 import '../reflective_tests.dart'; | 9 import '../reflective_tests.dart'; |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 assertNormal(server, InstrumentationService.TAG_ERROR, message); | 31 assertNormal(server, InstrumentationService.TAG_ERROR, message); |
| 32 } | 32 } |
| 33 | 33 |
| 34 void test_logError_withColon() { | 34 void test_logError_withColon() { |
| 35 TestInstrumentationServer server = new TestInstrumentationServer(); | 35 TestInstrumentationServer server = new TestInstrumentationServer(); |
| 36 InstrumentationService service = new InstrumentationService(server); | 36 InstrumentationService service = new InstrumentationService(server); |
| 37 service.logError('Error:message'); | 37 service.logError('Error:message'); |
| 38 assertNormal(server, InstrumentationService.TAG_ERROR, 'Error::message'); | 38 assertNormal(server, InstrumentationService.TAG_ERROR, 'Error::message'); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void test_logError_withLeadingColon() { |
| 42 TestInstrumentationServer server = new TestInstrumentationServer(); |
| 43 InstrumentationService service = new InstrumentationService(server); |
| 44 service.logError(':a:bb'); |
| 45 assertNormal(server, InstrumentationService.TAG_ERROR, '::a::bb'); |
| 46 } |
| 47 |
| 41 void test_logException_noTrace() { | 48 void test_logException_noTrace() { |
| 42 TestInstrumentationServer server = new TestInstrumentationServer(); | 49 TestInstrumentationServer server = new TestInstrumentationServer(); |
| 43 InstrumentationService service = new InstrumentationService(server); | 50 InstrumentationService service = new InstrumentationService(server); |
| 44 String message = 'exceptionMessage'; | 51 String message = 'exceptionMessage'; |
| 45 service.logException(message, null); | 52 service.logException(message, null); |
| 46 assertNormal(server, InstrumentationService.TAG_EXCEPTION, '$message:null'); | 53 assertNormal(server, InstrumentationService.TAG_EXCEPTION, '$message:null'); |
| 47 } | 54 } |
| 48 | 55 |
| 49 void test_logNotification() { | 56 void test_logNotification() { |
| 50 TestInstrumentationServer server = new TestInstrumentationServer(); | 57 TestInstrumentationServer server = new TestInstrumentationServer(); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 @override | 90 @override |
| 84 void logWithPriority(String message) { | 91 void logWithPriority(String message) { |
| 85 priorityChannel.writeln(message); | 92 priorityChannel.writeln(message); |
| 86 } | 93 } |
| 87 | 94 |
| 88 @override | 95 @override |
| 89 void shutdown() { | 96 void shutdown() { |
| 90 // Ignored | 97 // Ignored |
| 91 } | 98 } |
| 92 } | 99 } |
| OLD | NEW |