| 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.domain.execution; | 5 library test.domain.execution; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/analysis_server.dart'; | 9 import 'package:analysis_server/src/analysis_server.dart'; |
| 10 import 'package:analysis_server/src/constants.dart'; | 10 import 'package:analysis_server/src/constants.dart'; |
| 11 import 'package:analysis_server/src/domain_execution.dart'; | 11 import 'package:analysis_server/src/domain_execution.dart'; |
| 12 import 'package:analysis_server/src/protocol.dart'; | 12 import 'package:analysis_server/src/protocol.dart'; |
| 13 import 'package:analyzer/file_system/physical_file_system.dart'; | 13 import 'package:analyzer/file_system/physical_file_system.dart'; |
| 14 import 'package:analyzer/instrumentation/instrumentation.dart'; |
| 14 import 'package:analyzer/src/generated/engine.dart'; | 15 import 'package:analyzer/src/generated/engine.dart'; |
| 15 import 'package:analyzer/src/generated/source.dart'; | 16 import 'package:analyzer/src/generated/source.dart'; |
| 16 import 'package:typed_mock/typed_mock.dart'; | 17 import 'package:typed_mock/typed_mock.dart'; |
| 17 import 'package:unittest/unittest.dart'; | 18 import 'package:unittest/unittest.dart'; |
| 18 | 19 |
| 19 import 'mock_sdk.dart'; | 20 import 'mock_sdk.dart'; |
| 20 import 'mocks.dart'; | 21 import 'mocks.dart'; |
| 21 import 'operation/operation_queue_test.dart'; | 22 import 'operation/operation_queue_test.dart'; |
| 22 | 23 |
| 23 /** | 24 /** |
| 24 * Return a matcher that will match an [ExecutableFile] if it has the given | 25 * Return a matcher that will match an [ExecutableFile] if it has the given |
| 25 * [source] and [kind]. | 26 * [source] and [kind]. |
| 26 */ | 27 */ |
| 27 Matcher isExecutableFile(Source source, ExecutableKind kind) { | 28 Matcher isExecutableFile(Source source, ExecutableKind kind) { |
| 28 return new IsExecutableFile(source.fullName, kind); | 29 return new IsExecutableFile(source.fullName, kind); |
| 29 } | 30 } |
| 30 | 31 |
| 31 main() { | 32 main() { |
| 32 group('ExecutionDomainHandler', () { | 33 group('ExecutionDomainHandler', () { |
| 33 AnalysisServer server; | 34 AnalysisServer server; |
| 34 ExecutionDomainHandler handler; | 35 ExecutionDomainHandler handler; |
| 35 | 36 |
| 36 setUp(() { | 37 setUp(() { |
| 37 server = new AnalysisServer( | 38 server = new AnalysisServer( |
| 38 new MockServerChannel(), | 39 new MockServerChannel(), |
| 39 PhysicalResourceProvider.INSTANCE, | 40 PhysicalResourceProvider.INSTANCE, |
| 40 new MockPackageMapProvider(), | 41 new MockPackageMapProvider(), |
| 41 null, | 42 null, |
| 42 new AnalysisServerOptions(), | 43 new AnalysisServerOptions(), |
| 43 new MockSdk()); | 44 new MockSdk(), |
| 45 new NullInstrumentationServer()); |
| 44 handler = new ExecutionDomainHandler(server); | 46 handler = new ExecutionDomainHandler(server); |
| 45 }); | 47 }); |
| 46 | 48 |
| 47 group('createContext/deleteContext', () { | 49 group('createContext/deleteContext', () { |
| 48 test('create/delete multiple contexts', () { | 50 test('create/delete multiple contexts', () { |
| 49 Request request = | 51 Request request = |
| 50 new ExecutionCreateContextParams('/a/b.dart').toRequest('0'); | 52 new ExecutionCreateContextParams('/a/b.dart').toRequest('0'); |
| 51 Response response = handler.handleRequest(request); | 53 Response response = handler.handleRequest(request); |
| 52 expect(response, isResponseSuccess('0')); | 54 expect(response, isResponseSuccess('0')); |
| 53 ExecutionCreateContextResult result = | 55 ExecutionCreateContextResult result = |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 * A [Source] that knows it's [fullName]. | 271 * A [Source] that knows it's [fullName]. |
| 270 */ | 272 */ |
| 271 class TestSource implements Source { | 273 class TestSource implements Source { |
| 272 String fullName; | 274 String fullName; |
| 273 | 275 |
| 274 TestSource(this.fullName); | 276 TestSource(this.fullName); |
| 275 | 277 |
| 276 @override | 278 @override |
| 277 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 279 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
| 278 } | 280 } |
| OLD | NEW |