Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1766)

Side by Side Diff: pkg/analysis_server/test/socket_server_test.dart

Issue 2963323002: Add analytics to analyzer-cli and analysis server. (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 import 'dart:async'; 5 import 'dart:async';
6 6
7 import 'package:analysis_server/protocol/protocol.dart'; 7 import 'package:analysis_server/protocol/protocol.dart';
8 import 'package:analysis_server/protocol/protocol_constants.dart'; 8 import 'package:analysis_server/protocol/protocol_constants.dart';
9 import 'package:analysis_server/protocol/protocol_generated.dart'; 9 import 'package:analysis_server/protocol/protocol_generated.dart';
10 import 'package:analysis_server/src/analysis_server.dart'; 10 import 'package:analysis_server/src/analysis_server.dart';
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 }); 109 });
110 } 110 }
111 111
112 static SocketServer _createSocketServer() { 112 static SocketServer _createSocketServer() {
113 PhysicalResourceProvider resourceProvider = 113 PhysicalResourceProvider resourceProvider =
114 PhysicalResourceProvider.INSTANCE; 114 PhysicalResourceProvider.INSTANCE;
115 ServerPlugin serverPlugin = new ServerPlugin(); 115 ServerPlugin serverPlugin = new ServerPlugin();
116 ExtensionManager manager = new ExtensionManager(); 116 ExtensionManager manager = new ExtensionManager();
117 manager.processPlugins([serverPlugin]); 117 manager.processPlugins([serverPlugin]);
118 return new SocketServer( 118 return new SocketServer(
119 new AnalysisServerOptions(), 119 new AnalysisServerOptions()..addMocks(),
120 new DartSdkManager('', false), 120 new DartSdkManager('', false),
121 new FolderBasedDartSdk(resourceProvider, 121 new FolderBasedDartSdk(resourceProvider,
122 FolderBasedDartSdk.defaultSdkDirectory(resourceProvider)), 122 FolderBasedDartSdk.defaultSdkDirectory(resourceProvider)),
123 InstrumentationService.NULL_SERVICE, 123 InstrumentationService.NULL_SERVICE,
124 null, 124 null,
125 serverPlugin, 125 serverPlugin,
126 null, 126 null,
127 null); 127 null);
128 } 128 }
129 } 129 }
130 130
131 class _MockRequestHandler implements RequestHandler { 131 class _MockRequestHandler implements RequestHandler {
132 final bool futureException; 132 final bool futureException;
133 133
134 _MockRequestHandler(this.futureException); 134 _MockRequestHandler(this.futureException);
135 135
136 @override 136 @override
137 Response handleRequest(Request request) { 137 Response handleRequest(Request request) {
138 if (futureException) { 138 if (futureException) {
139 new Future(throwException); 139 new Future(throwException);
140 return new Response(request.id); 140 return new Response(request.id);
141 } 141 }
142 throw 'mock request exception'; 142 throw 'mock request exception';
143 } 143 }
144 144
145 void throwException() { 145 void throwException() {
146 throw 'mock future exception'; 146 throw 'mock future exception';
147 } 147 }
148 } 148 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698