Index: blimp/client/app/android/javatests/src/org/chromium/blimp/core/MockBlimpClientContext.java |
diff --git a/blimp/client/app/android/javatests/src/org/chromium/blimp/core/MockBlimpClientContext.java b/blimp/client/app/android/javatests/src/org/chromium/blimp/core/MockBlimpClientContext.java |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7875555c646e6657a80aac74e76e5483482347cf |
--- /dev/null |
+++ b/blimp/client/app/android/javatests/src/org/chromium/blimp/core/MockBlimpClientContext.java |
@@ -0,0 +1,70 @@ |
+// 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.blimp.core; |
+ |
+import android.preference.PreferenceFragment; |
+ |
+import org.chromium.blimp.core.common.BlimpClientContextInternal; |
+import org.chromium.blimp_public.BlimpClientContext; |
+import org.chromium.blimp_public.BlimpClientContextDelegate; |
+import org.chromium.blimp_public.contents.BlimpContents; |
+ |
+/** |
+ * Mock BlimpClientContext. |
David Trainor- moved to gerrit
2016/08/29 05:12:24
Add a comment describing that this isn't backed by
xingliu
2016/08/30 04:47:42
Done. Also added same comment in MockBlimpClientCo
|
+ */ |
+public class MockBlimpClientContext implements BlimpClientContext, BlimpClientContextInternal { |
+ public MockBlimpClientContext() {} |
+ |
+ private MockBlimpClientContextDelegate mDelegate = new MockBlimpClientContextDelegate(); |
+ |
+ private boolean mEnabled = false; |
+ private int mConnectCalled = 0; |
+ |
+ public void reset() { |
+ mConnectCalled = 0; |
+ } |
+ |
+ public void setBlimpEnabled(boolean enabled) { |
+ mEnabled = enabled; |
+ } |
+ |
+ public int connectCalledCount() { |
+ return mConnectCalled; |
+ } |
+ |
+ @Override |
+ public BlimpContents createBlimpContents() { |
+ return null; |
+ } |
+ |
+ @Override |
+ public boolean isBlimpSupported() { |
+ return true; |
+ } |
+ |
+ @Override |
+ public void attachBlimpPreferences(PreferenceFragment fragment) {} |
+ |
+ @Override |
+ public void setDelegate(BlimpClientContextDelegate delegate) {} |
+ |
+ @Override |
+ public boolean isBlimpEnabled() { |
+ return mEnabled; |
+ } |
+ |
+ @Override |
+ public void connect() { |
+ mConnectCalled++; |
+ } |
+ |
+ @Override |
+ public BlimpClientContextDelegate getDelegate() { |
+ return mDelegate; |
+ } |
+ |
+ @Override |
+ public void initSettingsPage(long nativeBlimpSettingsAndroid) {} |
+} |