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

Unified Diff: mojo/dart/test/core_test.dart

Issue 800523004: Dart: Simplifies the handle watcher. Various cleanups and bugfixes. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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: mojo/dart/test/core_test.dart
diff --git a/mojo/dart/test/core_test.dart b/mojo/dart/test/core_test.dart
index f38269d65de0f7dd4e4cd8328b7350f669fc0af5..8bd7f408be2932dcc3adfb159dacac33f65b1801 100644
--- a/mojo/dart/test/core_test.dart
+++ b/mojo/dart/test/core_test.dart
@@ -16,11 +16,11 @@ invalidHandleTest() {
Expect.isTrue(result.isInvalidArgument);
// Wait.
- result = invalidHandle.wait(MojoHandleSignals.READWRITE, 1000000);
+ result = invalidHandle.wait(MojoHandleSignals.kReadWrite, 1000000);
Expect.isTrue(result.isInvalidArgument);
int res = RawMojoHandle.waitMany([invalidHandle.h],
- [MojoHandleSignals.READWRITE],
+ [MojoHandleSignals.kReadWrite],
RawMojoHandle.DEADLINE_INDEFINITE);
Expect.equals(res, MojoResult.kInvalidArgument);
@@ -87,11 +87,11 @@ basicMessagePipeTest() {
Expect.isTrue(end1.handle.isValid);
// Not readable, yet.
- MojoResult result = end0.handle.wait(MojoHandleSignals.READABLE, 0);
+ MojoResult result = end0.handle.wait(MojoHandleSignals.kReadable, 0);
Expect.isTrue(result.isDeadlineExceeded);
// Should be writable.
- result = end0.handle.wait(MojoHandleSignals.WRITABLE, 0);
+ result = end0.handle.wait(MojoHandleSignals.kWritable, 0);
Expect.isTrue(result.isOk);
// Try to read.
@@ -108,7 +108,7 @@ basicMessagePipeTest() {
// end0 should now be readable.
int res = RawMojoHandle.waitMany([end0.handle.h],
- [MojoHandleSignals.READABLE],
+ [MojoHandleSignals.kReadable],
RawMojoHandle.DEADLINE_INDEFINITE);
Expect.equals(res, MojoResult.kOk);
@@ -124,7 +124,7 @@ basicMessagePipeTest() {
Expect.equals(hello_result, "hello");
// end0 should no longer be readable.
- result = end0.handle.wait(MojoHandleSignals.READABLE, 10);
+ result = end0.handle.wait(MojoHandleSignals.kReadable, 10);
Expect.isTrue(result.isDeadlineExceeded);
// Close end0's handle.
@@ -132,7 +132,7 @@ basicMessagePipeTest() {
Expect.isTrue(result.isOk);
// end1 should no longer be readable or writable.
- result = end1.handle.wait(MojoHandleSignals.READWRITE, 1000);
+ result = end1.handle.wait(MojoHandleSignals.kReadWrite, 1000);
Expect.isTrue(result.isFailedPrecondition);
result = end1.handle.close();
@@ -153,11 +153,11 @@ basicDataPipeTest() {
Expect.isTrue(consumer.handle.isValid);
// Consumer should not be readable.
- MojoResult result = consumer.handle.wait(MojoHandleSignals.READABLE, 0);
+ MojoResult result = consumer.handle.wait(MojoHandleSignals.kReadable, 0);
Expect.isTrue(result.isDeadlineExceeded);
// Producer should be writable.
- result = producer.handle.wait(MojoHandleSignals.WRITABLE, 0);
+ result = producer.handle.wait(MojoHandleSignals.kWritable, 0);
Expect.isTrue(result.isOk);
// Try to read from consumer.
@@ -181,7 +181,7 @@ basicDataPipeTest() {
// Now that we have written, the consumer should be readable.
int res = RawMojoHandle.waitMany([consumer.handle.h],
- [MojoHandleSignals.READABLE],
+ [MojoHandleSignals.kReadable],
RawMojoHandle.DEADLINE_INDEFINITE);
Expect.equals(res, MojoResult.kOk);
@@ -207,7 +207,7 @@ basicDataPipeTest() {
Expect.isTrue(result.isOk);
// Consumer should still be readable.
- result = consumer.handle.wait(MojoHandleSignals.READABLE, 0);
+ result = consumer.handle.wait(MojoHandleSignals.kReadable, 0);
Expect.isTrue(result.isOk);
// Get the number of remaining bytes.

Powered by Google App Engine
This is Rietveld 408576698