Supervised user import: Listen for profile creation/deletion
[chromium-blink-merge.git] / sync / test / fake_server / android / fake_server_helper_android.h
blob11f2234a0fcae7f9b860220583083e8aa0dc4191
1 // Copyright 2014 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.
5 #ifndef SYNC_TEST_FAKE_SERVER_ANDROID_FAKE_SERVER_HELPER_ANDROID
6 #define SYNC_TEST_FAKE_SERVER_ANDROID_FAKE_SERVER_HELPER_ANDROID
8 #include <jni.h>
10 #include "base/android/scoped_java_ref.h"
11 #include "base/basictypes.h"
12 #include "sync/test/fake_server/entity_builder_factory.h"
14 // Helper for utilizing native FakeServer infrastructure in Android tests.
15 class FakeServerHelperAndroid {
16 public:
17 // Registers the native methods.
18 static bool Register(JNIEnv* env);
20 // Creates a FakeServerHelperAndroid.
21 FakeServerHelperAndroid(JNIEnv* env, jobject obj);
23 // Factory method for creating a native FakeServer object. The caller assumes
24 // ownership.
25 jlong CreateFakeServer(JNIEnv* env, jobject obj);
27 // Factory method for creating a native NetworkResources object. The caller
28 // assumes ownership.
29 jlong CreateNetworkResources(JNIEnv* env, jobject obj, jlong fake_server);
31 // Deletes the given |fake_server| (a FakeServer pointer created via
32 // CreateFakeServer).
33 void DeleteFakeServer(JNIEnv* env, jobject obj, jlong fake_server);
35 // Returns true if and only if |fake_server| contains |count| entities that
36 // match |model_type_string| and |name|.
37 jboolean VerifyEntityCountByTypeAndName(JNIEnv* env,
38 jobject obj,
39 jlong fake_server,
40 jlong count,
41 jstring model_type_string,
42 jstring name);
44 // Injects a UniqueClientEntity into |fake_server|.
45 void InjectUniqueClientEntity(JNIEnv* env,
46 jobject obj,
47 jlong fake_server,
48 jstring name,
49 jbyteArray serialized_entity_specifics);
51 // Injects a BookmarkEntity into |fake_server|.
52 void InjectBookmarkEntity(JNIEnv* env,
53 jobject obj,
54 jlong fake_server,
55 jstring title,
56 jstring url,
57 jstring parent_id);
59 // Returns the bookmark bar folder ID.
60 base::android::ScopedJavaLocalRef<jstring> GetBookmarkBarFolderId(
61 JNIEnv* env,
62 jobject obj,
63 jlong fake_server);
65 private:
66 virtual ~FakeServerHelperAndroid();
69 #endif // SYNC_TEST_FAKE_SERVER_ANDROID_FAKE_SERVER_HELPER_ANDROID