Index: mojo/android/javatests/src/org/chromium/mojo/bindings/BindingsTestUtils.java |
diff --git a/mojo/android/javatests/src/org/chromium/mojo/bindings/BindingsTestUtils.java b/mojo/android/javatests/src/org/chromium/mojo/bindings/BindingsTestUtils.java |
index fa93d376cb392edb6eaee778adb015989a684fd5..c9ffa028ba77786e091efccea9d0210c09c11987 100644 |
--- a/mojo/android/javatests/src/org/chromium/mojo/bindings/BindingsTestUtils.java |
+++ b/mojo/android/javatests/src/org/chromium/mojo/bindings/BindingsTestUtils.java |
@@ -21,7 +21,8 @@ public class BindingsTestUtils { |
/** |
* {@link MessageReceiver} that records any message it receives. |
*/ |
- public static class RecordingMessageReceiver implements MessageReceiver { |
+ public static class RecordingMessageReceiver extends SideEffectFreeCloseable |
+ implements MessageReceiver { |
public final List<MessageWithHeader> messages = new ArrayList<MessageWithHeader>(); |
@@ -60,15 +61,23 @@ public class BindingsTestUtils { |
*/ |
public static class CapturingErrorHandler implements ConnectionErrorHandler { |
- public MojoException exception = null; |
+ private MojoException mLastMojoException = null; |
/** |
* @see ConnectionErrorHandler#onConnectionError(MojoException) |
*/ |
@Override |
public void onConnectionError(MojoException e) { |
- exception = e; |
+ mLastMojoException = e; |
} |
+ |
+ /** |
+ * Returns the last recorded exception. |
+ */ |
+ public MojoException getLastMojoException() { |
+ return mLastMojoException; |
+ } |
+ |
} |
/** |