Index: blimp/client/app/android/javatests/src/org/chromium/blimp/core/MockBlimpClientContextDelegate.java |
diff --git a/blimp/client/app/android/javatests/src/org/chromium/blimp/core/MockBlimpClientContextDelegate.java b/blimp/client/app/android/javatests/src/org/chromium/blimp/core/MockBlimpClientContextDelegate.java |
new file mode 100644 |
index 0000000000000000000000000000000000000000..51c35679d6e2d6b8c6e425ce8b56e5508c9ee8bb |
--- /dev/null |
+++ b/blimp/client/app/android/javatests/src/org/chromium/blimp/core/MockBlimpClientContextDelegate.java |
@@ -0,0 +1,40 @@ |
+// 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.content.Context; |
+ |
+import org.chromium.blimp_public.BlimpClientContextDelegate; |
+ |
+/** |
+ * Mock {@link BlimpClientContextDelegate}, to test embedder delegate functions. |
+ */ |
+public class MockBlimpClientContextDelegate implements BlimpClientContextDelegate { |
+ int mRestartCalled = 0; |
+ int mStartUserSignInFlowCalled = 0; |
+ |
+ public void reset() { |
+ mRestartCalled = 0; |
+ mStartUserSignInFlowCalled = 0; |
+ } |
+ |
+ public int restartBrowserCalled() { |
+ return mRestartCalled; |
+ } |
+ |
+ public int startUserSignInFlowCalled() { |
+ return mStartUserSignInFlowCalled; |
+ } |
+ |
+ @Override |
+ public void restartBrowser() { |
+ mRestartCalled++; |
+ } |
+ |
+ @Override |
+ public void startUserSignInFlow(Context context) { |
+ mStartUserSignInFlowCalled++; |
+ } |
+} |