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

Unified Diff: editor/tools/plugins/com.google.dart.server_test/src/com/google/dart/server/internal/remote/ByteRequestSinkTest.java

Issue 349573004: close channel and exit analysis server on editor shutdown (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 6 years, 6 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: editor/tools/plugins/com.google.dart.server_test/src/com/google/dart/server/internal/remote/ByteRequestSinkTest.java
diff --git a/editor/tools/plugins/com.google.dart.server_test/src/com/google/dart/server/internal/remote/ByteRequestSinkTest.java b/editor/tools/plugins/com.google.dart.server_test/src/com/google/dart/server/internal/remote/ByteRequestSinkTest.java
index df4715017d969cbb7a0be4d35b90a085becd168b..288f69b7f52e3ea1c3005e883b05ad1641ca303a 100644
--- a/editor/tools/plugins/com.google.dart.server_test/src/com/google/dart/server/internal/remote/ByteRequestSinkTest.java
+++ b/editor/tools/plugins/com.google.dart.server_test/src/com/google/dart/server/internal/remote/ByteRequestSinkTest.java
@@ -57,6 +57,20 @@ public class ByteRequestSinkTest extends TestCase {
verify(debugStream).println(anyString());
}
+ public void test_close() throws Exception {
+ ByteRequestSink requestSink = new ByteRequestSink(byteStream, null);
+ JsonObject originalJsonObject = parseJson(//
+ "{",
+ " 'id': '0',",
+ " 'method': 'server.shutdown'",
+ "}");
+ // assert write after close is ignored
+ requestSink.close();
+ requestSink.add(originalJsonObject);
+ byte[] bytes = byteStream.toByteArray();
+ assertEquals(0, bytes.length);
+ }
+
/**
* Builds a JSON string from the given lines. Replaces single quotes with double quotes. Then
* parses this string as a {@link JsonObject}.

Powered by Google App Engine
This is Rietveld 408576698