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

Side by Side Diff: pkg/analysis_server/test/services/correction/assist_test.dart

Issue 2863593004: Remove the non-driver versions of several tests (Closed)
Patch Set: Created 3 years, 7 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/plugin/edit/assist/assist_core.dart'; 7 import 'package:analysis_server/plugin/edit/assist/assist_core.dart';
8 import 'package:analysis_server/plugin/edit/assist/assist_dart.dart'; 8 import 'package:analysis_server/plugin/edit/assist/assist_dart.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/plugin/server_plugin.dart'; 10 import 'package:analysis_server/src/plugin/server_plugin.dart';
(...skipping 13 matching lines...) Expand all
24 import 'package:plugin/plugin.dart'; 24 import 'package:plugin/plugin.dart';
25 import 'package:test/test.dart'; 25 import 'package:test/test.dart';
26 import 'package:test_reflective_loader/test_reflective_loader.dart'; 26 import 'package:test_reflective_loader/test_reflective_loader.dart';
27 27
28 import '../../abstract_single_unit.dart'; 28 import '../../abstract_single_unit.dart';
29 import 'flutter_util.dart'; 29 import 'flutter_util.dart';
30 30
31 main() { 31 main() {
32 defineReflectiveSuite(() { 32 defineReflectiveSuite(() {
33 defineReflectiveTests(AssistProcessorTest); 33 defineReflectiveTests(AssistProcessorTest);
34 defineReflectiveTests(AssistProcessorTest_Driver);
35 }); 34 });
36 } 35 }
37 36
38 @reflectiveTest 37 @reflectiveTest
39 class AssistProcessorTest extends AbstractSingleUnitTest { 38 class AssistProcessorTest extends AbstractSingleUnitTest {
40 int offset; 39 int offset;
41 int length; 40 int length;
42 41
43 ServerPlugin plugin; 42 ServerPlugin plugin;
44 Assist assist; 43 Assist assist;
45 SourceChange change; 44 SourceChange change;
46 String resultCode; 45 String resultCode;
47 LinkedEditGroup linkedPositionGroup; 46 LinkedEditGroup linkedPositionGroup;
48 47
48 @override
49 bool get enableNewAnalysisDriver => true;
50
49 /** 51 /**
50 * Asserts that there is an [Assist] of the given [kind] at [offset] which 52 * Asserts that there is an [Assist] of the given [kind] at [offset] which
51 * produces the [expected] code when applied to [testCode]. 53 * produces the [expected] code when applied to [testCode].
52 */ 54 */
53 assertHasAssist(AssistKind kind, String expected) async { 55 assertHasAssist(AssistKind kind, String expected) async {
54 assist = await _assertHasAssist(kind); 56 assist = await _assertHasAssist(kind);
55 change = assist.change; 57 change = assist.change;
56 // apply to "file" 58 // apply to "file"
57 List<SourceFileEdit> fileEdits = change.edits; 59 List<SourceFileEdit> fileEdits = change.edits;
58 expect(fileEdits, hasLength(1)); 60 expect(fileEdits, hasLength(1));
(...skipping 4652 matching lines...) Expand 10 before | Expand all | Expand 10 after
4711 offset = findOffset('/*caret*/') + '/*caret*/'.length; 4713 offset = findOffset('/*caret*/') + '/*caret*/'.length;
4712 length = 0; 4714 length = 0;
4713 } 4715 }
4714 4716
4715 void _setStartEndSelection() { 4717 void _setStartEndSelection() {
4716 offset = findOffset('// start\n') + '// start\n'.length; 4718 offset = findOffset('// start\n') + '// start\n'.length;
4717 length = findOffset('// end') - offset; 4719 length = findOffset('// end') - offset;
4718 } 4720 }
4719 } 4721 }
4720 4722
4721 @reflectiveTest
4722 class AssistProcessorTest_Driver extends AssistProcessorTest {
4723 @override
4724 bool get enableNewAnalysisDriver => true;
4725 }
4726
4727 class _DartAssistContextForValues implements DartAssistContext { 4723 class _DartAssistContextForValues implements DartAssistContext {
4728 @override 4724 @override
4729 final Source source; 4725 final Source source;
4730 4726
4731 @override 4727 @override
4732 final int selectionOffset; 4728 final int selectionOffset;
4733 4729
4734 @override 4730 @override
4735 final int selectionLength; 4731 final int selectionLength;
4736 4732
4737 @override 4733 @override
4738 final AnalysisContext analysisContext; 4734 final AnalysisContext analysisContext;
4739 4735
4740 @override 4736 @override
4741 final AstProvider astProvider; 4737 final AstProvider astProvider;
4742 4738
4743 @override 4739 @override
4744 final CompilationUnit unit; 4740 final CompilationUnit unit;
4745 4741
4746 _DartAssistContextForValues(this.source, this.selectionOffset, 4742 _DartAssistContextForValues(this.source, this.selectionOffset,
4747 this.selectionLength, this.analysisContext, this.astProvider, this.unit); 4743 this.selectionLength, this.analysisContext, this.astProvider, this.unit);
4748 } 4744 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698