Chromium Code Reviews| Index: mojo/android/javatests/src/org/chromium/mojo/system/impl/CoreImplTest.java |
| diff --git a/mojo/android/javatests/src/org/chromium/mojo/system/impl/CoreImplTest.java b/mojo/android/javatests/src/org/chromium/mojo/system/impl/CoreImplTest.java |
| index abe7fa37d7251bbdf9eb3f68d3915e9846d755a2..97bab765d79b98086b15d0d1d2aa6eb7254d6e86 100644 |
| --- a/mojo/android/javatests/src/org/chromium/mojo/system/impl/CoreImplTest.java |
| +++ b/mojo/android/javatests/src/org/chromium/mojo/system/impl/CoreImplTest.java |
| @@ -648,8 +648,8 @@ public class CoreImplTest extends MojoTestCase { |
| assertEquals(Integer.MIN_VALUE, asyncWaiterResult.getResult()); |
| assertEquals(null, asyncWaiterResult.getException()); |
| - core.getDefaultAsyncWaiter().asyncWait(handles.first, Core.HandleSignals.READABLE, |
| - Core.DEADLINE_INFINITE, asyncWaiterResult); |
| + Cancellable cancellable = core.getDefaultAsyncWaiter().asyncWait(handles.first, |
| + Core.HandleSignals.READABLE, Core.DEADLINE_INFINITE, asyncWaiterResult); |
| assertEquals(Integer.MIN_VALUE, asyncWaiterResult.getResult()); |
| assertEquals(null, asyncWaiterResult.getException()); |
| @@ -657,7 +657,7 @@ public class CoreImplTest extends MojoTestCase { |
| assertEquals(Integer.MIN_VALUE, asyncWaiterResult.getResult()); |
| assertEquals(null, asyncWaiterResult.getException()); |
| - handles.first.close(); |
|
sky
2014/07/23 23:37:15
We're saying the handle must remain valid until ca
|
| + cancellable.cancel(); |
| nativeRunLoop(RUN_LOOP_TIMEOUT_MS); |
| // TODO(qsr) Re-enable when MojoWaitMany handles it correctly. |
| // assertNull(asyncWaiterResult.getException()); |
| @@ -668,56 +668,6 @@ public class CoreImplTest extends MojoTestCase { |
| * Testing core {@link AsyncWaiter} implementation. |
| */ |
| @SmallTest |
| - public void testAsyncWaiterWaitingOnInvalidHandle() { |
| - Core core = CoreImpl.getInstance(); |
| - |
| - // Closing the peer handle. |
| - Pair<MessagePipeHandle, MessagePipeHandle> handles = core.createMessagePipe(null); |
| - addHandlePairToClose(handles); |
| - |
| - final AsyncWaiterResult asyncWaiterResult = new AsyncWaiterResult(); |
| - assertEquals(Integer.MIN_VALUE, asyncWaiterResult.getResult()); |
| - assertEquals(null, asyncWaiterResult.getException()); |
| - |
| - handles.first.close(); |
|
sky
2014/07/23 23:37:14
This test doesn't make sense as we're saying the h
darin (slow to review)
2014/07/24 03:39:47
Perhaps the AsyncWait function should DCHECK that
|
| - core.getDefaultAsyncWaiter().asyncWait(handles.first, Core.HandleSignals.READABLE, |
| - Core.DEADLINE_INFINITE, asyncWaiterResult); |
| - assertEquals(Integer.MIN_VALUE, asyncWaiterResult.getResult()); |
| - assertEquals(null, asyncWaiterResult.getException()); |
| - |
| - nativeRunLoop(RUN_LOOP_TIMEOUT_MS); |
| - assertNotNull(asyncWaiterResult.getException()); |
| - assertEquals(MojoResult.INVALID_ARGUMENT, |
| - asyncWaiterResult.getException().getMojoResult()); |
| - assertEquals(Integer.MIN_VALUE, asyncWaiterResult.getResult()); |
| - } |
| - |
| - /** |
| - * Testing core {@link AsyncWaiter} implementation. |
| - */ |
| - @SmallTest |
| - public void testAsyncWaiterWaitingOnDefaultInvalidHandle() { |
| - Core core = CoreImpl.getInstance(); |
| - |
| - final AsyncWaiterResult asyncWaiterResult = new AsyncWaiterResult(); |
| - assertEquals(Integer.MIN_VALUE, asyncWaiterResult.getResult()); |
| - assertEquals(null, asyncWaiterResult.getException()); |
| - |
| - core.getDefaultAsyncWaiter().asyncWait(InvalidHandle.INSTANCE, Core.HandleSignals.READABLE, |
|
sky
2014/07/23 23:37:14
Same thing here.
|
| - Core.DEADLINE_INFINITE, asyncWaiterResult); |
| - assertEquals(Integer.MIN_VALUE, asyncWaiterResult.getResult()); |
| - assertEquals(null, asyncWaiterResult.getException()); |
| - |
| - nativeRunLoop(RUN_LOOP_TIMEOUT_MS); |
| - assertNotNull(asyncWaiterResult.getException()); |
| - assertEquals(MojoResult.INVALID_ARGUMENT, asyncWaiterResult.getException().getMojoResult()); |
| - assertEquals(Integer.MIN_VALUE, asyncWaiterResult.getResult()); |
| - } |
| - |
| - /** |
| - * Testing core {@link AsyncWaiter} implementation. |
| - */ |
| - @SmallTest |
| public void testAsyncWaiterWaitingWithTimeout() { |
| Core core = CoreImpl.getInstance(); |