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

Unified Diff: remoting/android/javatests/src/org/chromium/chromoting/test/util/MutableReference.java

Issue 1999583002: Add Event and EventTest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve review comments Created 4 years, 7 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
« no previous file with comments | « remoting/android/javatests/src/org/chromium/chromoting/EventTest.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/android/javatests/src/org/chromium/chromoting/test/util/MutableReference.java
diff --git a/remoting/android/javatests/src/org/chromium/chromoting/test/util/MutableReference.java b/remoting/android/javatests/src/org/chromium/chromoting/test/util/MutableReference.java
new file mode 100644
index 0000000000000000000000000000000000000000..8d21d56348419196d30953a9f3299e6e82b58722
--- /dev/null
+++ b/remoting/android/javatests/src/org/chromium/chromoting/test/util/MutableReference.java
@@ -0,0 +1,35 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chromoting.test.util;
+
+/**
+ * A container of a reference to pass data into or out from a closure. This class is usually useful
+ * in test cases.
+ *
+ * @param <T> The type of reference.
+ */
+public class MutableReference<T> {
+ private T mRef;
+
+ public MutableReference() {
+ clear();
+ }
+
+ public MutableReference(T ref) {
+ set(ref);
+ }
+
+ public void clear() {
+ set(null);
+ }
+
+ public void set(T ref) {
+ mRef = ref;
+ }
+
+ public T get() {
+ return mRef;
+ }
+}
« no previous file with comments | « remoting/android/javatests/src/org/chromium/chromoting/EventTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698