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

Unified Diff: tests/standalone/io/string_stream_test.dart

Issue 11345027: Do error propagation for decoder errors in string stream. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
« no previous file with comments | « lib/io/string_stream.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/string_stream_test.dart
===================================================================
--- tests/standalone/io/string_stream_test.dart (revision 14280)
+++ tests/standalone/io/string_stream_test.dart (working copy)
@@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#import("dart:io");
+#import("dart:isolate");
void testUtf8() {
List<int> data = [0x01,
@@ -298,6 +299,23 @@
Expect.equals(1, errors);
}
+testEncodingErrorWithHandler() {
+ var port = new ReceivePort();
+ var errors = 0;
+ var expected = [206, 187, 120, 46, 32, 120, 10];
+ ListInputStream input = new ListInputStream();
+ input.write(expected);
+ var stringStream = new StringInputStream(input, Encoding.ASCII);
+ stringStream.onData = () {
+ Expect.fail("We should not get any data");
+ };
+ stringStream.onError = (e) {
+ port.close();
+ Expect.isTrue(e is Exception);
+ };
+}
+
+
main() {
testUtf8();
testLatin1();
@@ -307,4 +325,5 @@
testReadChunks();
testReadMixed();
testErrorHandler();
+ testEncodingErrorWithHandler();
}
« no previous file with comments | « lib/io/string_stream.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698