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 test.socket.server; | 5 library test.socket.server; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
10 import 'package:analysis_server/src/analysis_server.dart'; | 10 import 'package:analysis_server/src/analysis_server.dart'; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 PhysicalResourceProvider.INSTANCE; | 112 PhysicalResourceProvider.INSTANCE; |
113 ServerPlugin serverPlugin = new ServerPlugin(); | 113 ServerPlugin serverPlugin = new ServerPlugin(); |
114 ExtensionManager manager = new ExtensionManager(); | 114 ExtensionManager manager = new ExtensionManager(); |
115 manager.processPlugins([serverPlugin]); | 115 manager.processPlugins([serverPlugin]); |
116 return new SocketServer( | 116 return new SocketServer( |
117 new AnalysisServerOptions(), | 117 new AnalysisServerOptions(), |
118 new DartSdkManager('', false), | 118 new DartSdkManager('', false), |
119 new FolderBasedDartSdk(resourceProvider, | 119 new FolderBasedDartSdk(resourceProvider, |
120 FolderBasedDartSdk.defaultSdkDirectory(resourceProvider)), | 120 FolderBasedDartSdk.defaultSdkDirectory(resourceProvider)), |
121 InstrumentationService.NULL_SERVICE, | 121 InstrumentationService.NULL_SERVICE, |
| 122 null, |
122 serverPlugin, | 123 serverPlugin, |
123 null, | 124 null, |
124 null, | 125 null, |
125 false); | 126 false); |
126 } | 127 } |
127 } | 128 } |
128 | 129 |
129 class _MockRequestHandler implements RequestHandler { | 130 class _MockRequestHandler implements RequestHandler { |
130 final bool futureException; | 131 final bool futureException; |
131 | 132 |
132 _MockRequestHandler(this.futureException); | 133 _MockRequestHandler(this.futureException); |
133 | 134 |
134 @override | 135 @override |
135 Response handleRequest(Request request) { | 136 Response handleRequest(Request request) { |
136 if (futureException) { | 137 if (futureException) { |
137 new Future(throwException); | 138 new Future(throwException); |
138 return new Response(request.id); | 139 return new Response(request.id); |
139 } | 140 } |
140 throw 'mock request exception'; | 141 throw 'mock request exception'; |
141 } | 142 } |
142 | 143 |
143 void throwException() { | 144 void throwException() { |
144 throw 'mock future exception'; | 145 throw 'mock future exception'; |
145 } | 146 } |
146 } | 147 } |
OLD | NEW |