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

Unified Diff: pkg/analysis_server/test/integration/integration_tests.dart

Issue 1398293002: Move the wire protocol support into the public API (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Add missed files Created 5 years, 2 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
Index: pkg/analysis_server/test/integration/integration_tests.dart
diff --git a/pkg/analysis_server/test/integration/integration_tests.dart b/pkg/analysis_server/test/integration/integration_tests.dart
index a0128b692a239de0a8b54bfd8908e95fbd72b1dd..5004f869658be8512d2d1961f650546ce7dc728b 100644
--- a/pkg/analysis_server/test/integration/integration_tests.dart
+++ b/pkg/analysis_server/test/integration/integration_tests.dart
@@ -9,14 +9,14 @@ import 'dart:collection';
import 'dart:convert';
import 'dart:io';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
import 'package:analysis_server/src/constants.dart';
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/src/server/driver.dart' as analysisServer;
import 'package:path/path.dart';
import 'package:unittest/unittest.dart';
import 'integration_test_methods.dart';
import 'protocol_matchers.dart';
-import 'package:analysis_server/src/server/driver.dart' as analysisServer;
const Matcher isBool = const isInstanceOf<bool>('bool');
@@ -28,11 +28,11 @@ const Matcher isNotification = const MatchesJsonObject(
const Matcher isObject = isMap;
+const Matcher isString = const isInstanceOf<String>('String');
+
final Matcher isResponse = new MatchesJsonObject('response', {'id': isString},
optionalFields: {'result': anything, 'error': isRequestError});
-const Matcher isString = const isInstanceOf<String>('String');
-
Matcher isListOf(Matcher elementMatcher) => new _ListOf(elementMatcher);
Matcher isMapOf(Matcher keyMatcher, Matcher valueMatcher) =>
@@ -165,6 +165,21 @@ abstract class AbstractAnalysisServerIntegrationTest
}
/**
+ * If [skipShutdown] is not set, shut down the server.
+ */
+ Future shutdownIfNeeded() {
+ if (skipShutdown) {
+ return new Future.value();
+ }
+ // Give the server a short time to comply with the shutdown request; if it
+ // doesn't exit, then forcibly terminate it.
+ sendServerShutdown();
+ return server.exitCode.timeout(SHUTDOWN_TIMEOUT, onTimeout: () {
+ return server.kill();
+ });
+ }
+
+ /**
* Convert the given [relativePath] to an absolute path, by interpreting it
* relative to [sourceDirectory]. On Windows any forward slashes in
* [relativePath] are converted to backslashes.
@@ -218,21 +233,6 @@ abstract class AbstractAnalysisServerIntegrationTest
file.writeAsStringSync(contents);
return file.resolveSymbolicLinksSync();
}
-
- /**
- * If [skipShutdown] is not set, shut down the server.
- */
- Future shutdownIfNeeded() {
- if (skipShutdown) {
- return new Future.value();
- }
- // Give the server a short time to comply with the shutdown request; if it
- // doesn't exit, then forcibly terminate it.
- sendServerShutdown();
- return server.exitCode.timeout(SHUTDOWN_TIMEOUT, onTimeout: () {
- return server.kill();
- });
- }
}
/**

Powered by Google App Engine
This is Rietveld 408576698