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

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

Issue 2741033003: Mojo EDK: Introduce MojoQueryHandleSignalsState API (Closed)
Patch Set: fix stupid bad DCHECK 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;
16 import org.chromium.mojo.system.Handle; 15 import org.chromium.mojo.system.Handle;
17 import org.chromium.mojo.system.MessagePipeHandle; 16 import org.chromium.mojo.system.MessagePipeHandle;
18 import org.chromium.mojo.system.MojoResult; 17 import org.chromium.mojo.system.MojoResult;
19 import org.chromium.mojo.system.Pair; 18 import org.chromium.mojo.system.Pair;
20 import org.chromium.mojo.system.ResultAnd; 19 import org.chromium.mojo.system.ResultAnd;
21 import org.chromium.mojo.system.impl.CoreImpl; 20 import org.chromium.mojo.system.impl.CoreImpl;
22 21
23 import java.nio.ByteBuffer; 22 import java.nio.ByteBuffer;
24 import java.util.ArrayList; 23 import java.util.ArrayList;
25 24
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 219
221 // Clear the MessageReciever so that the ResponderThunk will 220 // Clear the MessageReciever so that the ResponderThunk will
222 // be finalized. Since the RespondeThunk was never used, this 221 // be finalized. Since the RespondeThunk was never used, this
223 // should close the pipe. 222 // should close the pipe.
224 clearAllMessageReceivers(); 223 clearAllMessageReceivers();
225 // The close() occurs asynchronously on this thread. 224 // The close() occurs asynchronously on this thread.
226 runLoopUntilIdle(); 225 runLoopUntilIdle();
227 226
228 // Confirm that the pipe was closed on the Router side. 227 // Confirm that the pipe was closed on the Router side.
229 HandleSignals closedFlag = HandleSignals.none().setPeerClosed(true); 228 HandleSignals closedFlag = HandleSignals.none().setPeerClosed(true);
230 WaitResult result = mHandle.wait(closedFlag, 0); 229 assertEquals(closedFlag, mHandle.querySignalsState().getSatisfiedSignals ());
231 assertEquals(MojoResult.OK, result.getMojoResult());
232 assertEquals(closedFlag, result.getHandleSignalsState().getSatisfiedSign als());
233 } 230 }
234 } 231 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698