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 analyzer.test.instrumentation.instrumentation_test; | 5 library analyzer.test.instrumentation.instrumentation_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analyzer/instrumentation/instrumentation.dart'; | 9 import 'package:analyzer/instrumentation/instrumentation.dart'; |
10 import 'package:test/test.dart'; | 10 import 'package:test/test.dart'; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 String stackTraceText = 'stackTrace'; | 118 String stackTraceText = 'stackTrace'; |
119 StackTrace stackTrace = new StackTrace.fromString(stackTraceText); | 119 StackTrace stackTrace = new StackTrace.fromString(stackTraceText); |
120 service.logPluginException(plugin, message, stackTrace); | 120 service.logPluginException(plugin, message, stackTrace); |
121 assertNormal(server, InstrumentationService.TAG_PLUGIN_EXCEPTION, | 121 assertNormal(server, InstrumentationService.TAG_PLUGIN_EXCEPTION, |
122 '$message:$stackTraceText:path:name:version'); | 122 '$message:$stackTraceText:path:name:version'); |
123 } | 123 } |
124 | 124 |
125 void test_logPluginNotification() { | 125 void test_logPluginNotification() { |
126 TestInstrumentationServer server = new TestInstrumentationServer(); | 126 TestInstrumentationServer server = new TestInstrumentationServer(); |
127 InstrumentationService service = new InstrumentationService(server); | 127 InstrumentationService service = new InstrumentationService(server); |
128 Uri uri = new Uri.file('path'); | |
129 String notification = 'notification'; | 128 String notification = 'notification'; |
130 service.logPluginNotification(uri, notification); | 129 service.logPluginNotification('path', notification); |
131 assertNormal(server, InstrumentationService.TAG_PLUGIN_NOTIFICATION, | 130 assertNormal(server, InstrumentationService.TAG_PLUGIN_NOTIFICATION, |
132 'path:$notification'); | 131 'path:$notification'); |
133 } | 132 } |
134 | 133 |
135 void test_logPluginRequest() { | 134 void test_logPluginRequest() { |
136 TestInstrumentationServer server = new TestInstrumentationServer(); | 135 TestInstrumentationServer server = new TestInstrumentationServer(); |
137 InstrumentationService service = new InstrumentationService(server); | 136 InstrumentationService service = new InstrumentationService(server); |
138 Uri uri = new Uri.file('path'); | |
139 String request = 'request'; | 137 String request = 'request'; |
140 service.logPluginRequest(uri, request); | 138 service.logPluginRequest('path', request); |
141 assertNormal( | 139 assertNormal( |
142 server, InstrumentationService.TAG_PLUGIN_REQUEST, 'path:$request'); | 140 server, InstrumentationService.TAG_PLUGIN_REQUEST, 'path:$request'); |
143 } | 141 } |
144 | 142 |
145 void test_logPluginResponse() { | 143 void test_logPluginResponse() { |
146 TestInstrumentationServer server = new TestInstrumentationServer(); | 144 TestInstrumentationServer server = new TestInstrumentationServer(); |
147 InstrumentationService service = new InstrumentationService(server); | 145 InstrumentationService service = new InstrumentationService(server); |
148 Uri uri = new Uri.file('path'); | |
149 String response = 'response'; | 146 String response = 'response'; |
150 service.logPluginResponse(uri, response); | 147 service.logPluginResponse('path', response); |
151 assertNormal( | 148 assertNormal( |
152 server, InstrumentationService.TAG_PLUGIN_RESPONSE, 'path:$response'); | 149 server, InstrumentationService.TAG_PLUGIN_RESPONSE, 'path:$response'); |
153 } | 150 } |
154 | 151 |
155 void test_logPluginTimeout() { | 152 void test_logPluginTimeout() { |
156 TestInstrumentationServer server = new TestInstrumentationServer(); | 153 TestInstrumentationServer server = new TestInstrumentationServer(); |
157 InstrumentationService service = new InstrumentationService(server); | 154 InstrumentationService service = new InstrumentationService(server); |
158 PluginData plugin = new PluginData('path', 'name', 'version'); | 155 PluginData plugin = new PluginData('path', 'name', 'version'); |
159 String request = 'request'; | 156 String request = 'request'; |
160 service.logPluginTimeout(plugin, request); | 157 service.logPluginTimeout(plugin, request); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 @override | 247 @override |
251 void logWithPriority(String message) { | 248 void logWithPriority(String message) { |
252 priorityChannel.writeln(message); | 249 priorityChannel.writeln(message); |
253 } | 250 } |
254 | 251 |
255 @override | 252 @override |
256 Future shutdown() async { | 253 Future shutdown() async { |
257 // Ignored | 254 // Ignored |
258 } | 255 } |
259 } | 256 } |
OLD | NEW |