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

Unified Diff: tests/isolate/unresolved_ports_negative_test.dart

Issue 11415101: Fix unresolved ports negative test (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 | « no previous file | tests/isolate/unresolved_ports_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/isolate/unresolved_ports_negative_test.dart
diff --git a/tests/isolate/unresolved_ports_negative_test.dart b/tests/isolate/unresolved_ports_negative_test.dart
index 518884b0ddcbf7b92bbf179e36e33cdbfba0a0d2..30076459bcf4f8806b5aec4cc3580423ee240fbf 100644
--- a/tests/isolate/unresolved_ports_negative_test.dart
+++ b/tests/isolate/unresolved_ports_negative_test.dart
@@ -2,46 +2,12 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// negative test to ensure that API_unresolvedPortsTest works.
-library unresolved_ports;
+// negative test to ensure that unresolved_ports works.
+library unresolved_ports_negative;
import 'dart:isolate';
import '../../pkg/unittest/lib/unittest.dart';
-
-bethIsolate() {
- port.receive(expectAsync2((msg, reply) => msg[1].send(
- '${msg[0]}\nBeth says: Tim are you coming? And Bob?', reply)));
-}
-
-timIsolate() {
- SendPort bob = spawnFunction(bobIsolate);
- port.receive(expectAsync2((msg, reply) => bob.send(
- '$msg\nTim says: Can you tell "main" that we are all coming?', reply)));
-}
-
-bobIsolate() {
- port.receive(expectAsync2((msg, reply) => reply.send(
- '$msg\nBob says: we are all coming!')));
-}
+import 'unresolved_ports_test.dart' as positive_test;
main() {
- test('Message chain with unresolved ports', () {
- ReceivePort port = new ReceivePort();
- port.receive(expectAsync2((msg, _) {
- expect(msg, equals('main says: Beth, find out if Tim is coming.'
- + '\nBeth says: Tim are you coming? And Bob?'
- + '\nTim says: Can you tell "main" that we are all coming?'
- + '\nBob says: we are NOT coming!')); // should be 'all', not 'NOT'
- port.close();
- }));
-
- SendPort tim = spawnFunction(timIsolate);
- SendPort beth = spawnFunction(bethIsolate);
-
- beth.send(
- // because tim is created asynchronously, here we are sending an
- // unresolved port:
- ['main says: Beth, find out if Tim is coming.', tim],
- port.toSendPort());
- });
+ positive_test.baseTest(failForNegativeTest: true);
gram 2012/11/21 18:34:09 I'm not sure why this is any better than just mark
Siggi Cherem (dart-lang) 2012/11/21 18:41:49 Quite the contrary - the point here is to detect i
}
-
« no previous file with comments | « no previous file | tests/isolate/unresolved_ports_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698