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

Side by Side Diff: mojo/android/javatests/src/org/chromium/mojo/bindings/RouterTest.java

Issue 2750273002: Revert of Mojo EDK: Introduce MojoQueryHandleSignalsState API (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.mojo.bindings; 5 package org.chromium.mojo.bindings;
6 6
7 import android.support.test.filters.SmallTest; 7 import android.support.test.filters.SmallTest;
8 8
9 import org.chromium.base.annotations.SuppressFBWarnings; 9 import org.chromium.base.annotations.SuppressFBWarnings;
10 import org.chromium.mojo.MojoTestCase; 10 import org.chromium.mojo.MojoTestCase;
11 import org.chromium.mojo.bindings.BindingsTestUtils.CapturingErrorHandler; 11 import org.chromium.mojo.bindings.BindingsTestUtils.CapturingErrorHandler;
12 import org.chromium.mojo.bindings.BindingsTestUtils.RecordingMessageReceiverWith Responder; 12 import org.chromium.mojo.bindings.BindingsTestUtils.RecordingMessageReceiverWith Responder;
13 import org.chromium.mojo.system.Core; 13 import org.chromium.mojo.system.Core;
14 import org.chromium.mojo.system.Core.HandleSignals; 14 import org.chromium.mojo.system.Core.HandleSignals;
15 import org.chromium.mojo.system.Core.WaitResult;
15 import org.chromium.mojo.system.Handle; 16 import org.chromium.mojo.system.Handle;
16 import org.chromium.mojo.system.MessagePipeHandle; 17 import org.chromium.mojo.system.MessagePipeHandle;
17 import org.chromium.mojo.system.MojoResult; 18 import org.chromium.mojo.system.MojoResult;
18 import org.chromium.mojo.system.Pair; 19 import org.chromium.mojo.system.Pair;
19 import org.chromium.mojo.system.ResultAnd; 20 import org.chromium.mojo.system.ResultAnd;
20 import org.chromium.mojo.system.impl.CoreImpl; 21 import org.chromium.mojo.system.impl.CoreImpl;
21 22
22 import java.nio.ByteBuffer; 23 import java.nio.ByteBuffer;
23 import java.util.ArrayList; 24 import java.util.ArrayList;
24 25
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 220
220 // Clear the MessageReciever so that the ResponderThunk will 221 // Clear the MessageReciever so that the ResponderThunk will
221 // be finalized. Since the RespondeThunk was never used, this 222 // be finalized. Since the RespondeThunk was never used, this
222 // should close the pipe. 223 // should close the pipe.
223 clearAllMessageReceivers(); 224 clearAllMessageReceivers();
224 // The close() occurs asynchronously on this thread. 225 // The close() occurs asynchronously on this thread.
225 runLoopUntilIdle(); 226 runLoopUntilIdle();
226 227
227 // Confirm that the pipe was closed on the Router side. 228 // Confirm that the pipe was closed on the Router side.
228 HandleSignals closedFlag = HandleSignals.none().setPeerClosed(true); 229 HandleSignals closedFlag = HandleSignals.none().setPeerClosed(true);
229 assertEquals(closedFlag, mHandle.querySignalsState().getSatisfiedSignals ()); 230 WaitResult result = mHandle.wait(closedFlag, 0);
231 assertEquals(MojoResult.OK, result.getMojoResult());
232 assertEquals(closedFlag, result.getHandleSignalsState().getSatisfiedSign als());
230 } 233 }
231 } 234 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698