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

Unified Diff: pkg/analysis_server/test/edit/format_test.dart

Issue 1080653003: Create a public API for contributing fixes and make fixes pluggable (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Missed clean-up Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/test/edit/fixes_test.dart ('k') | pkg/analysis_server/test/edit/refactoring_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/edit/format_test.dart
diff --git a/pkg/analysis_server/test/edit/format_test.dart b/pkg/analysis_server/test/edit/format_test.dart
index f45990056ba030fcfd16c71fb76f0ec7df7b1069..6a8e870e099a56719e7252efc45d765546dc2b33 100644
--- a/pkg/analysis_server/test/edit/format_test.dart
+++ b/pkg/analysis_server/test/edit/format_test.dart
@@ -7,7 +7,9 @@ library test.edit.format;
import 'dart:async';
import 'package:analysis_server/src/edit/edit_domain.dart';
+import 'package:analysis_server/src/plugin/server_plugin.dart';
import 'package:analysis_server/src/protocol.dart';
+import 'package:analyzer/src/plugin/plugin_impl.dart';
import 'package:unittest/unittest.dart' hide ERROR;
import '../analysis_abstract.dart';
@@ -24,7 +26,24 @@ class FormatTest extends AbstractAnalysisTest {
void setUp() {
super.setUp();
createProject();
- handler = new EditDomainHandler(server);
+ ExtensionManager manager = new ExtensionManager();
+ ServerPlugin plugin = new ServerPlugin();
+ manager.processPlugins([plugin]);
+ handler = new EditDomainHandler(server, plugin);
+ }
+
+ Future test_formatNoOp() {
+ // Already formatted source
+ addTestFile('''
+main() {
+ int x = 3;
+}
+''');
+ return waitForTasksFinished().then((_) {
+ EditFormatResult formatResult = _formatAt(0, 3);
+ expect(formatResult.edits, isNotNull);
+ expect(formatResult.edits, hasLength(0));
+ });
}
Future test_formatSimple() {
@@ -48,20 +67,6 @@ main() {
});
}
- Future test_formatNoOp() {
- // Already formatted source
- addTestFile('''
-main() {
- int x = 3;
-}
-''');
- return waitForTasksFinished().then((_) {
- EditFormatResult formatResult = _formatAt(0, 3);
- expect(formatResult.edits, isNotNull);
- expect(formatResult.edits, hasLength(0));
- });
- }
-
EditFormatResult _formatAt(int selectionOffset, int selectionLength) {
Request request = new EditFormatParams(
testFile, selectionOffset, selectionLength).toRequest('0');
« no previous file with comments | « pkg/analysis_server/test/edit/fixes_test.dart ('k') | pkg/analysis_server/test/edit/refactoring_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698