OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 package org.chromium.blimp.core; | |
6 | |
7 import android.preference.PreferenceFragment; | |
8 | |
9 import org.chromium.blimp.core.common.BlimpClientContextInternal; | |
10 import org.chromium.blimp_public.BlimpClientContext; | |
11 import org.chromium.blimp_public.BlimpClientContextDelegate; | |
12 import org.chromium.blimp_public.contents.BlimpContents; | |
13 | |
14 /** | |
15 * 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
| |
16 */ | |
17 public class MockBlimpClientContext implements BlimpClientContext, BlimpClientCo ntextInternal { | |
18 public MockBlimpClientContext() {} | |
19 | |
20 private MockBlimpClientContextDelegate mDelegate = new MockBlimpClientContex tDelegate(); | |
21 | |
22 private boolean mEnabled = false; | |
23 private int mConnectCalled = 0; | |
24 | |
25 public void reset() { | |
26 mConnectCalled = 0; | |
27 } | |
28 | |
29 public void setBlimpEnabled(boolean enabled) { | |
30 mEnabled = enabled; | |
31 } | |
32 | |
33 public int connectCalledCount() { | |
34 return mConnectCalled; | |
35 } | |
36 | |
37 @Override | |
38 public BlimpContents createBlimpContents() { | |
39 return null; | |
40 } | |
41 | |
42 @Override | |
43 public boolean isBlimpSupported() { | |
44 return true; | |
45 } | |
46 | |
47 @Override | |
48 public void attachBlimpPreferences(PreferenceFragment fragment) {} | |
49 | |
50 @Override | |
51 public void setDelegate(BlimpClientContextDelegate delegate) {} | |
52 | |
53 @Override | |
54 public boolean isBlimpEnabled() { | |
55 return mEnabled; | |
56 } | |
57 | |
58 @Override | |
59 public void connect() { | |
60 mConnectCalled++; | |
61 } | |
62 | |
63 @Override | |
64 public BlimpClientContextDelegate getDelegate() { | |
65 return mDelegate; | |
66 } | |
67 | |
68 @Override | |
69 public void initSettingsPage(long nativeBlimpSettingsAndroid) {} | |
70 } | |
OLD | NEW |