| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 assertNormal(server, InstrumentationService.TAG_REQUEST, message); | 98 assertNormal(server, InstrumentationService.TAG_REQUEST, message); |
| 99 } | 99 } |
| 100 | 100 |
| 101 void test_logResponse() { | 101 void test_logResponse() { |
| 102 TestInstrumentationServer server = new TestInstrumentationServer(); | 102 TestInstrumentationServer server = new TestInstrumentationServer(); |
| 103 InstrumentationService service = new InstrumentationService(server); | 103 InstrumentationService service = new InstrumentationService(server); |
| 104 String message = 'responseText'; | 104 String message = 'responseText'; |
| 105 service.logResponse(message); | 105 service.logResponse(message); |
| 106 assertNormal(server, InstrumentationService.TAG_RESPONSE, message); | 106 assertNormal(server, InstrumentationService.TAG_RESPONSE, message); |
| 107 } | 107 } |
| 108 |
| 109 void test_logVersion() { |
| 110 TestInstrumentationServer server = new TestInstrumentationServer(); |
| 111 InstrumentationService service = new InstrumentationService(server); |
| 112 service.logVersion( |
| 113 'myUuid', |
| 114 'someClientId', |
| 115 'someClientVersion', |
| 116 'aServerVersion', |
| 117 'anSdkVersion'); |
| 118 expect(server.normalChannel.toString(), ''); |
| 119 expect( |
| 120 server.priorityChannel.toString(), |
| 121 endsWith( |
| 122 ':myUuid:someClientId:someClientVersion:aServerVersion:anSdkVersion\
n')); |
| 123 } |
| 108 } | 124 } |
| 109 | 125 |
| 110 @reflectiveTest | 126 @reflectiveTest |
| 111 class MulticastInstrumentationServerTest { | 127 class MulticastInstrumentationServerTest { |
| 112 TestInstrumentationServer serverA = new TestInstrumentationServer(); | 128 TestInstrumentationServer serverA = new TestInstrumentationServer(); |
| 113 TestInstrumentationServer serverB = new TestInstrumentationServer(); | 129 TestInstrumentationServer serverB = new TestInstrumentationServer(); |
| 114 MulticastInstrumentationServer server; | 130 MulticastInstrumentationServer server; |
| 115 | 131 |
| 116 void setUp() { | 132 void setUp() { |
| 117 server = new MulticastInstrumentationServer([serverA, serverB]); | 133 server = new MulticastInstrumentationServer([serverA, serverB]); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 @override | 176 @override |
| 161 void logWithPriority(String message) { | 177 void logWithPriority(String message) { |
| 162 priorityChannel.writeln(message); | 178 priorityChannel.writeln(message); |
| 163 } | 179 } |
| 164 | 180 |
| 165 @override | 181 @override |
| 166 void shutdown() { | 182 void shutdown() { |
| 167 // Ignored | 183 // Ignored |
| 168 } | 184 } |
| 169 } | 185 } |
| OLD | NEW |