Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Unified Diff: sync/test/fake_server/android/fake_server_helper_android.h

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/test/fake_encryptor.cc ('k') | sync/test/fake_server/android/fake_server_helper_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/test/fake_server/android/fake_server_helper_android.h
diff --git a/sync/test/fake_server/android/fake_server_helper_android.h b/sync/test/fake_server/android/fake_server_helper_android.h
deleted file mode 100644
index c588e4e0f36cc411315da043e50662146d511238..0000000000000000000000000000000000000000
--- a/sync/test/fake_server/android/fake_server_helper_android.h
+++ /dev/null
@@ -1,152 +0,0 @@
-// Copyright 2014 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.
-
-#ifndef SYNC_TEST_FAKE_SERVER_ANDROID_FAKE_SERVER_HELPER_ANDROID_H_
-#define SYNC_TEST_FAKE_SERVER_ANDROID_FAKE_SERVER_HELPER_ANDROID_H_
-
-#include <jni.h>
-#include <string>
-
-#include "base/android/scoped_java_ref.h"
-#include "sync/test/fake_server/entity_builder_factory.h"
-
-// Helper for utilizing native FakeServer infrastructure in Android tests.
-class FakeServerHelperAndroid {
- public:
- // Registers the native methods.
- static bool Register(JNIEnv* env);
-
- // Creates a FakeServerHelperAndroid.
- FakeServerHelperAndroid(JNIEnv* env, jobject obj);
-
- // Factory method for creating a native FakeServer object. The caller assumes
- // ownership.
- jlong CreateFakeServer(JNIEnv* env,
- const base::android::JavaParamRef<jobject>& obj);
-
- // Factory method for creating a native NetworkResources object. The caller
- // assumes ownership.
- jlong CreateNetworkResources(JNIEnv* env,
- const base::android::JavaParamRef<jobject>& obj,
- jlong fake_server);
-
- // Deletes the given |fake_server| (a FakeServer pointer created via
- // CreateFakeServer).
- void DeleteFakeServer(JNIEnv* env,
- const base::android::JavaParamRef<jobject>& obj,
- jlong fake_server);
-
- // Returns true if and only if |fake_server| contains |count| entities that
- // match |model_type_string| and |name|.
- jboolean VerifyEntityCountByTypeAndName(
- JNIEnv* env,
- const base::android::JavaParamRef<jobject>& obj,
- jlong fake_server,
- jlong count,
- jint model_type_int,
- const base::android::JavaParamRef<jstring>& name);
-
- // Returns true iff |fake_server| has exactly one window of sessions with
- // tabs matching |url_array|. The order of the array does not matter.
- jboolean VerifySessions(
- JNIEnv* env,
- const base::android::JavaParamRef<jobject>& obj,
- jlong fake_server,
- const base::android::JavaParamRef<jobjectArray>& url_array);
-
- // Return the entities for |model_type_string| on |fake_server|.
- base::android::ScopedJavaLocalRef<jobjectArray> GetSyncEntitiesByModelType(
- JNIEnv* env,
- const base::android::JavaParamRef<jobject>& obj,
- jlong fake_server,
- jint model_type_int);
-
- // Injects a UniqueClientEntity into |fake_server|.
- void InjectUniqueClientEntity(
- JNIEnv* env,
- const base::android::JavaParamRef<jobject>& obj,
- jlong fake_server,
- const base::android::JavaParamRef<jstring>& name,
- const base::android::JavaParamRef<jbyteArray>&
- serialized_entity_specifics);
-
- // Modifies the entity with |id| on |fake_server|.
- void ModifyEntitySpecifics(JNIEnv* env,
- const base::android::JavaParamRef<jobject>& obj,
- jlong fake_server,
- const base::android::JavaParamRef<jstring>& name,
- const base::android::JavaParamRef<jbyteArray>&
- serialized_entity_specifics);
-
- // Injects a BookmarkEntity into |fake_server|.
- void InjectBookmarkEntity(
- JNIEnv* env,
- const base::android::JavaParamRef<jobject>& obj,
- jlong fake_server,
- const base::android::JavaParamRef<jstring>& title,
- const base::android::JavaParamRef<jstring>& url,
- const base::android::JavaParamRef<jstring>& parent_id);
-
- // Injects a bookmark folder entity into |fake_server|.
- void InjectBookmarkFolderEntity(
- JNIEnv* env,
- const base::android::JavaParamRef<jobject>& obj,
- jlong fake_server,
- const base::android::JavaParamRef<jstring>& title,
- const base::android::JavaParamRef<jstring>& parent_id);
-
- // Modify the BookmarkEntity with |entity_id| on |fake_server|.
- void ModifyBookmarkEntity(
- JNIEnv* env,
- const base::android::JavaParamRef<jobject>& obj,
- jlong fake_server,
- const base::android::JavaParamRef<jstring>& entity_id,
- const base::android::JavaParamRef<jstring>& title,
- const base::android::JavaParamRef<jstring>& url,
- const base::android::JavaParamRef<jstring>& parent_id);
-
- // Modify the bookmark folder with |entity_id| on |fake_server|.
- void ModifyBookmarkFolderEntity(
- JNIEnv* env,
- const base::android::JavaParamRef<jobject>& obj,
- jlong fake_server,
- const base::android::JavaParamRef<jstring>& entity_id,
- const base::android::JavaParamRef<jstring>& title,
- const base::android::JavaParamRef<jstring>& parent_id);
-
- // Returns the bookmark bar folder ID.
- base::android::ScopedJavaLocalRef<jstring> GetBookmarkBarFolderId(
- JNIEnv* env,
- const base::android::JavaParamRef<jobject>& obj,
- jlong fake_server);
-
- // Deletes an entity on the server. This is the JNI way of injecting a
- // tombstone.
- void DeleteEntity(JNIEnv* env,
- const base::android::JavaParamRef<jobject>& obj,
- jlong fake_server,
- const base::android::JavaParamRef<jstring>& id);
-
- // Simulates a dashboard stop and clear.
- void ClearServerData(JNIEnv* env,
- const base::android::JavaParamRef<jobject>& obj,
- jlong fake_server);
-
- private:
- virtual ~FakeServerHelperAndroid();
-
- // Deserializes |serialized_entity_specifics| into |entity_specifics|.
- void DeserializeEntitySpecifics(JNIEnv* env,
- jbyteArray serialized_entity_specifics,
- sync_pb::EntitySpecifics* entity_specifics);
-
- // Creates a bookmark entity.
- std::unique_ptr<fake_server::FakeServerEntity> CreateBookmarkEntity(
- JNIEnv* env,
- jstring title,
- jstring url,
- jstring parent_id);
-};
-
-#endif // SYNC_TEST_FAKE_SERVER_ANDROID_FAKE_SERVER_HELPER_ANDROID_H_
« no previous file with comments | « sync/test/fake_encryptor.cc ('k') | sync/test/fake_server/android/fake_server_helper_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698