| 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 server.performance; | 5 library server.performance; |
| 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/plugin/protocol/protocol.dart'; | 10 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 return startServer().then((_) { | 49 return startServer().then((_) { |
| 50 server.listenToOutput(dispatchNotification); | 50 server.listenToOutput(dispatchNotification); |
| 51 server.exitCode.then((_) { | 51 server.exitCode.then((_) { |
| 52 skipShutdown = true; | 52 skipShutdown = true; |
| 53 }); | 53 }); |
| 54 return serverConnected.future; | 54 return serverConnected.future; |
| 55 }); | 55 }); |
| 56 } | 56 } |
| 57 | 57 |
| 58 /** | 58 /** |
| 59 * After every test, the server is stopped. |
| 60 */ |
| 61 Future shutdown() async => await shutdownIfNeeded(); |
| 62 |
| 63 /** |
| 59 * Enable [SERVER_STATUS] notifications so that [analysisFinished] | 64 * Enable [SERVER_STATUS] notifications so that [analysisFinished] |
| 60 * can be used. | 65 * can be used. |
| 61 */ | 66 */ |
| 62 Future subscribeToStatusNotifications() { | 67 Future subscribeToStatusNotifications() { |
| 63 List<Future> futures = <Future>[]; | 68 List<Future> futures = <Future>[]; |
| 64 futures.add(sendServerSetSubscriptions([ServerService.STATUS])); | 69 futures.add(sendServerSetSubscriptions([ServerService.STATUS])); |
| 65 return Future.wait(futures); | 70 return Future.wait(futures); |
| 66 } | 71 } |
| 67 | |
| 68 /** | |
| 69 * After every test, the server is stopped. | |
| 70 */ | |
| 71 Future shutdown() async => await shutdownIfNeeded(); | |
| 72 } | 72 } |
| 73 | 73 |
| 74 class AbstractTimingTest extends AbstractAnalysisServerPerformanceTest { | 74 class AbstractTimingTest extends AbstractAnalysisServerPerformanceTest { |
| 75 Future init(String source) async { | 75 Future init(String source) async { |
| 76 await super.setUp(); | 76 await super.setUp(); |
| 77 sourceDirectory = new Directory(source); | 77 sourceDirectory = new Directory(source); |
| 78 return subscribeToStatusNotifications(); | 78 return subscribeToStatusNotifications(); |
| 79 } | 79 } |
| 80 } | 80 } |
| OLD | NEW |