| 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/android/scoped_java_ref.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 jstring model_type_string, | 41 jstring model_type_string, |
| 42 jstring name); | 42 jstring name); |
| 43 | 43 |
| 44 // Returns true iff |fake_server| has exactly one window of sessions with | 44 // Returns true iff |fake_server| has exactly one window of sessions with |
| 45 // tabs matching |url_array|. The order of the array does not matter. | 45 // tabs matching |url_array|. The order of the array does not matter. |
| 46 jboolean VerifySessions(JNIEnv* env, | 46 jboolean VerifySessions(JNIEnv* env, |
| 47 jobject obj, | 47 jobject obj, |
| 48 jlong fake_server, | 48 jlong fake_server, |
| 49 jobjectArray url_array); | 49 jobjectArray url_array); |
| 50 | 50 |
| 51 // Return the entities for |model_type_string| on |fake_server|. |
| 52 base::android::ScopedJavaLocalRef<jobjectArray> GetSyncEntitiesByModelType( |
| 53 JNIEnv* env, |
| 54 jobject obj, |
| 55 jlong fake_server, |
| 56 jstring model_type_string); |
| 57 |
| 51 // Injects a UniqueClientEntity into |fake_server|. | 58 // Injects a UniqueClientEntity into |fake_server|. |
| 52 void InjectUniqueClientEntity(JNIEnv* env, | 59 void InjectUniqueClientEntity(JNIEnv* env, |
| 53 jobject obj, | 60 jobject obj, |
| 54 jlong fake_server, | 61 jlong fake_server, |
| 55 jstring name, | 62 jstring name, |
| 56 jbyteArray serialized_entity_specifics); | 63 jbyteArray serialized_entity_specifics); |
| 57 | 64 |
| 58 // Modifies the entity with |id| on |fake_server|. | 65 // Modifies the entity with |id| on |fake_server|. |
| 59 void ModifyEntitySpecifics(JNIEnv* env, | 66 void ModifyEntitySpecifics(JNIEnv* env, |
| 60 jobject obj, | 67 jobject obj, |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 // Deletes an entity on the server. This is the JNI way of injecting a | 110 // Deletes an entity on the server. This is the JNI way of injecting a |
| 104 // tombstone. | 111 // tombstone. |
| 105 void DeleteEntity(JNIEnv* env, | 112 void DeleteEntity(JNIEnv* env, |
| 106 jobject obj, | 113 jobject obj, |
| 107 jlong fake_server, | 114 jlong fake_server, |
| 108 jstring id); | 115 jstring id); |
| 109 | 116 |
| 110 private: | 117 private: |
| 111 virtual ~FakeServerHelperAndroid(); | 118 virtual ~FakeServerHelperAndroid(); |
| 112 | 119 |
| 120 // Converts |proto| into a jbyteArray. |
| 121 jbyteArray ProtoToJbyteArray(JNIEnv* env, |
| 122 const google::protobuf::MessageLite& proto); |
| 123 |
| 113 // Deserializes |serialized_entity_specifics| into |entity_specifics|. | 124 // Deserializes |serialized_entity_specifics| into |entity_specifics|. |
| 114 void DeserializeEntitySpecifics(JNIEnv* env, | 125 void DeserializeEntitySpecifics(JNIEnv* env, |
| 115 jbyteArray serialized_entity_specifics, | 126 jbyteArray serialized_entity_specifics, |
| 116 sync_pb::EntitySpecifics& entity_specifics); | 127 sync_pb::EntitySpecifics& entity_specifics); |
| 117 | 128 |
| 118 // Creates a bookmark entity. | 129 // Creates a bookmark entity. |
| 119 scoped_ptr<fake_server::FakeServerEntity> CreateBookmarkEntity( | 130 scoped_ptr<fake_server::FakeServerEntity> CreateBookmarkEntity( |
| 120 JNIEnv* env, | 131 JNIEnv* env, |
| 121 jstring title, | 132 jstring title, |
| 122 jstring url, | 133 jstring url, |
| 123 jstring parent_id); | 134 jstring parent_id); |
| 124 }; | 135 }; |
| 125 | 136 |
| 126 #endif // SYNC_TEST_FAKE_SERVER_ANDROID_FAKE_SERVER_HELPER_ANDROID | 137 #endif // SYNC_TEST_FAKE_SERVER_ANDROID_FAKE_SERVER_HELPER_ANDROID |
| OLD | NEW |