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

Unified Diff: mojo/android/javatests/src/org/chromium/mojo/system/impl/CoreImplTest.java

Issue 544103002: mojo: java core API: Allow interaction with native handles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Follow review Created 6 years, 3 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: 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 97bab765d79b98086b15d0d1d2aa6eb7254d6e86..355156ec5c6e9e305c2bf68a90fa372f71752c5e 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
@@ -817,4 +817,22 @@ public class CoreImplTest extends MojoTestCase {
checkSharing(newHandleClone, handleClone);
}
+ /**
+ * esting handle conversion to native and back.
+ */
+ @SmallTest
+ public void testHandleConversion() {
+ Core core = CoreImpl.getInstance();
+ Pair<MessagePipeHandle, MessagePipeHandle> handles = core.createMessagePipe(null);
+ addHandlePairToClose(handles);
+
+ MessagePipeHandle converted =
+ core.acquireNativeHandle(handles.first.releaseNativeHandle()).toMessagePipeHandle();
+ addHandleToClose(converted);
+
+ assertFalse(handles.first.isValid());
+
+ checkSendingMessage(converted, handles.second);
+ checkSendingMessage(handles.second, converted);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698