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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 service.logResponse(message); | 104 service.logResponse(message); |
105 assertNormal(server, InstrumentationService.TAG_RESPONSE, message); | 105 assertNormal(server, InstrumentationService.TAG_RESPONSE, message); |
106 } | 106 } |
107 | 107 |
108 void test_logVersion() { | 108 void test_logVersion() { |
109 TestInstrumentationServer server = new TestInstrumentationServer(); | 109 TestInstrumentationServer server = new TestInstrumentationServer(); |
110 InstrumentationService service = new InstrumentationService(server); | 110 InstrumentationService service = new InstrumentationService(server); |
111 service.logVersion('myUuid', 'someClientId', 'someClientVersion', | 111 service.logVersion('myUuid', 'someClientId', 'someClientVersion', |
112 'aServerVersion', 'anSdkVersion'); | 112 'aServerVersion', 'anSdkVersion'); |
113 expect(server.normalChannel.toString(), ''); | 113 expect(server.normalChannel.toString(), ''); |
114 expect(server.priorityChannel.toString(), endsWith( | 114 expect( |
115 ':myUuid:someClientId:someClientVersion:aServerVersion:anSdkVersion\n'))
; | 115 server.priorityChannel.toString(), |
| 116 endsWith( |
| 117 ':myUuid:someClientId:someClientVersion:aServerVersion:anSdkVersion\
n')); |
116 } | 118 } |
117 } | 119 } |
118 | 120 |
119 @reflectiveTest | 121 @reflectiveTest |
120 class MulticastInstrumentationServerTest { | 122 class MulticastInstrumentationServerTest { |
121 TestInstrumentationServer serverA = new TestInstrumentationServer(); | 123 TestInstrumentationServer serverA = new TestInstrumentationServer(); |
122 TestInstrumentationServer serverB = new TestInstrumentationServer(); | 124 TestInstrumentationServer serverB = new TestInstrumentationServer(); |
123 MulticastInstrumentationServer server; | 125 MulticastInstrumentationServer server; |
124 | 126 |
125 void setUp() { | 127 void setUp() { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 @override | 171 @override |
170 void logWithPriority(String message) { | 172 void logWithPriority(String message) { |
171 priorityChannel.writeln(message); | 173 priorityChannel.writeln(message); |
172 } | 174 } |
173 | 175 |
174 @override | 176 @override |
175 void shutdown() { | 177 void shutdown() { |
176 // Ignored | 178 // Ignored |
177 } | 179 } |
178 } | 180 } |
OLD | NEW |