| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 mocks; | 5 library mocks; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 | 9 |
| 10 import 'package:analysis_server/src/analysis_server.dart'; | 10 import 'package:analysis_server/src/analysis_server.dart'; |
| 11 import 'package:analysis_server/src/channel.dart'; | 11 import 'package:analysis_server/src/channel.dart'; |
| 12 import 'package:analysis_server/src/protocol.dart'; | 12 import 'package:analysis_server/src/protocol.dart'; |
| 13 import 'package:unittest/matcher.dart'; | 13 import 'package:matcher/matcher.dart'; |
| 14 | 14 |
| 15 /** | 15 /** |
| 16 * Answer the absolute path the the SDK relative to the currently running | 16 * Answer the absolute path the the SDK relative to the currently running |
| 17 * script or throw an exception if it cannot be found. | 17 * script or throw an exception if it cannot be found. |
| 18 */ | 18 */ |
| 19 String get sdkPath { | 19 String get sdkPath { |
| 20 Uri sdkUri = Platform.script.resolve('../../../sdk/'); | 20 Uri sdkUri = Platform.script.resolve('../../../sdk/'); |
| 21 | 21 |
| 22 // Verify the directory exists | 22 // Verify the directory exists |
| 23 Directory sdkDir = new Directory.fromUri(sdkUri); | 23 Directory sdkDir = new Directory.fromUri(sdkUri); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 responsesReceived.add(response); | 106 responsesReceived.add(response); |
| 107 // Wrap send response in future to simulate websocket | 107 // Wrap send response in future to simulate websocket |
| 108 new Future(() => responseController.add(response)); | 108 new Future(() => responseController.add(response)); |
| 109 } | 109 } |
| 110 | 110 |
| 111 void expectMsgCount({responseCount: 0, notificationCount: 0}) { | 111 void expectMsgCount({responseCount: 0, notificationCount: 0}) { |
| 112 expect(responsesReceived, hasLength(responseCount)); | 112 expect(responsesReceived, hasLength(responseCount)); |
| 113 expect(notificationsReceived, hasLength(notificationCount)); | 113 expect(notificationsReceived, hasLength(notificationCount)); |
| 114 } | 114 } |
| 115 } | 115 } |
| OLD | NEW |