OLD | NEW |
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; | 5 package org.chromium.mojo; |
6 | 6 |
7 import org.chromium.mojo.system.Core; | 7 import org.chromium.mojo.system.Core; |
8 import org.chromium.mojo.system.Core.WaitResult; | 8 import org.chromium.mojo.system.Core.HandleSignalsState; |
9 import org.chromium.mojo.system.DataPipe; | 9 import org.chromium.mojo.system.DataPipe; |
10 import org.chromium.mojo.system.DataPipe.ConsumerHandle; | 10 import org.chromium.mojo.system.DataPipe.ConsumerHandle; |
11 import org.chromium.mojo.system.DataPipe.ProducerHandle; | 11 import org.chromium.mojo.system.DataPipe.ProducerHandle; |
12 import org.chromium.mojo.system.Handle; | 12 import org.chromium.mojo.system.Handle; |
13 import org.chromium.mojo.system.MessagePipeHandle; | 13 import org.chromium.mojo.system.MessagePipeHandle; |
14 import org.chromium.mojo.system.MojoResult; | 14 import org.chromium.mojo.system.MojoResult; |
15 import org.chromium.mojo.system.ResultAnd; | 15 import org.chromium.mojo.system.ResultAnd; |
16 import org.chromium.mojo.system.SharedBufferHandle; | 16 import org.chromium.mojo.system.SharedBufferHandle; |
17 import org.chromium.mojo.system.UntypedHandle; | 17 import org.chromium.mojo.system.UntypedHandle; |
18 import org.chromium.mojo.system.impl.CoreImpl; | 18 import org.chromium.mojo.system.impl.CoreImpl; |
19 | 19 |
20 import java.nio.ByteBuffer; | 20 import java.nio.ByteBuffer; |
21 import java.util.List; | 21 import java.util.List; |
22 | 22 |
23 /** | 23 /** |
24 * A mock handle, that does nothing. | 24 * A mock handle, that does nothing. |
25 */ | 25 */ |
26 public class HandleMock implements UntypedHandle, MessagePipeHandle, | 26 public class HandleMock implements UntypedHandle, MessagePipeHandle, |
27 ProducerHandle, ConsumerHandle, SharedBufferHandle { | 27 ProducerHandle, ConsumerHandle, SharedBufferHandle { |
28 | 28 |
29 /** | 29 /** |
30 * @see Handle#close() | 30 * @see Handle#close() |
31 */ | 31 */ |
32 @Override | 32 @Override |
33 public void close() { | 33 public void close() { |
34 // Do nothing. | 34 // Do nothing. |
35 } | 35 } |
36 | 36 |
37 /** | 37 /** |
38 * @see Handle#wait(Core.HandleSignals, long) | 38 * @see Handle#querySignalsState() |
39 */ | 39 */ |
40 @Override | 40 @Override |
41 public WaitResult wait(Core.HandleSignals signals, long deadline) { | 41 public HandleSignalsState querySignalsState() { |
42 // Do nothing. | 42 return null; |
43 WaitResult result = new WaitResult(); | |
44 result.setMojoResult(MojoResult.OK); | |
45 return result; | |
46 } | 43 } |
47 | 44 |
48 /** | 45 /** |
49 * @see Handle#isValid() | 46 * @see Handle#isValid() |
50 */ | 47 */ |
51 @Override | 48 @Override |
52 public boolean isValid() { | 49 public boolean isValid() { |
53 return true; | 50 return true; |
54 } | 51 } |
55 | 52 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 | 217 |
221 /** | 218 /** |
222 * @see SharedBufferHandle#unmap(java.nio.ByteBuffer) | 219 * @see SharedBufferHandle#unmap(java.nio.ByteBuffer) |
223 */ | 220 */ |
224 @Override | 221 @Override |
225 public void unmap(ByteBuffer buffer) { | 222 public void unmap(ByteBuffer buffer) { |
226 // Do nothing. | 223 // Do nothing. |
227 } | 224 } |
228 | 225 |
229 } | 226 } |
OLD | NEW |