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

Unified Diff: blimp/client/app/android/javatests/src/org/chromium/blimp/core/MockBlimpClientContext.java

Issue 2261273002: Integrate UI with authentication flow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Misc fix. Created 4 years, 4 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
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) {}
+}

Powered by Google App Engine
This is Rietveld 408576698