OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SYNC_TEST_FAKE_SERVER_ANDROID_FAKE_SERVER_HELPER_ANDROID | 5 #ifndef SYNC_TEST_FAKE_SERVER_ANDROID_FAKE_SERVER_HELPER_ANDROID |
6 #define SYNC_TEST_FAKE_SERVER_ANDROID_FAKE_SERVER_HELPER_ANDROID | 6 #define SYNC_TEST_FAKE_SERVER_ANDROID_FAKE_SERVER_HELPER_ANDROID |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
| 10 #include "base/android/scoped_java_ref.h" |
10 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
11 #include "sync/test/fake_server/entity_builder_factory.h" | 12 #include "sync/test/fake_server/entity_builder_factory.h" |
12 | 13 |
13 // Helper for utilizing native FakeServer infrastructure in Android tests. | 14 // Helper for utilizing native FakeServer infrastructure in Android tests. |
14 class FakeServerHelperAndroid { | 15 class FakeServerHelperAndroid { |
15 public: | 16 public: |
16 // Registers the native methods. | 17 // Registers the native methods. |
17 static bool Register(JNIEnv* env); | 18 static bool Register(JNIEnv* env); |
18 | 19 |
19 // Creates a FakeServerHelperAndroid. | 20 // Creates a FakeServerHelperAndroid. |
(...skipping 20 matching lines...) Expand all Loading... |
40 jstring model_type_string, | 41 jstring model_type_string, |
41 jstring name); | 42 jstring name); |
42 | 43 |
43 // Injects a UniqueClientEntity into |fake_server|. | 44 // Injects a UniqueClientEntity into |fake_server|. |
44 void InjectUniqueClientEntity(JNIEnv* env, | 45 void InjectUniqueClientEntity(JNIEnv* env, |
45 jobject obj, | 46 jobject obj, |
46 jlong fake_server, | 47 jlong fake_server, |
47 jstring name, | 48 jstring name, |
48 jbyteArray serialized_entity_specifics); | 49 jbyteArray serialized_entity_specifics); |
49 | 50 |
| 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); |
| 58 |
| 59 // Returns the bookmark bar folder ID. |
| 60 base::android::ScopedJavaLocalRef<jstring> GetBookmarkBarFolderId( |
| 61 JNIEnv* env, |
| 62 jobject obj, |
| 63 jlong fake_server); |
| 64 |
50 private: | 65 private: |
51 virtual ~FakeServerHelperAndroid(); | 66 virtual ~FakeServerHelperAndroid(); |
52 }; | 67 }; |
53 | 68 |
54 #endif // SYNC_TEST_FAKE_SERVER_ANDROID_FAKE_SERVER_HELPER_ANDROID | 69 #endif // SYNC_TEST_FAKE_SERVER_ANDROID_FAKE_SERVER_HELPER_ANDROID |
OLD | NEW |