| 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 | 9 |
| 10 import '../reflective_tests.dart'; | 10 import '../reflective_tests.dart'; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |