Commit d789ea44 authored by aruslan@chromium.org's avatar aruslan@chromium.org

Add VisibleForTesting to content/public/android

BUG=168615


Review URL: https://chromiumcodereview.appspot.com/11784028

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175537 0039d316-1c4b-4281-b951-d872f2087c98
parent 992ec970
...@@ -29,6 +29,8 @@ import android.provider.Browser.SearchColumns; ...@@ -29,6 +29,8 @@ import android.provider.Browser.SearchColumns;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import com.google.common.annotations.VisibleForTesting;
import org.chromium.base.CalledByNative; import org.chromium.base.CalledByNative;
import org.chromium.base.CalledByNativeUnchecked; import org.chromium.base.CalledByNativeUnchecked;
import org.chromium.base.ThreadUtils; import org.chromium.base.ThreadUtils;
...@@ -724,8 +726,7 @@ public class ChromeBrowserProvider extends ContentProvider { ...@@ -724,8 +726,7 @@ public class ChromeBrowserProvider extends ContentProvider {
private byte[] mThumbnail; private byte[] mThumbnail;
/** Used to pass structured data back from the native code. */ /** Used to pass structured data back from the native code. */
// TODO(leandrogracia): remove public when VisibleForTesting works. @VisibleForTesting
// @VisibleForTesting
public BookmarkNode(long id, Type type, String name, String url, BookmarkNode parent) { public BookmarkNode(long id, Type type, String name, String url, BookmarkNode parent) {
mId = id; mId = id;
mName = name; mName = name;
...@@ -789,8 +790,7 @@ public class ChromeBrowserProvider extends ContentProvider { ...@@ -789,8 +790,7 @@ public class ChromeBrowserProvider extends ContentProvider {
* <p> * <p>
* Used solely by the native code. * Used solely by the native code.
*/ */
// TODO(leandrogracia): remove public when VisibleForTesting works. @VisibleForTesting
// @VisibleForTesting
@CalledByNativeUnchecked("BookmarkNode") @CalledByNativeUnchecked("BookmarkNode")
public void addChild(BookmarkNode child) { public void addChild(BookmarkNode child) {
mChildren.add(child); mChildren.add(child);
...@@ -840,14 +840,12 @@ public class ChromeBrowserProvider extends ContentProvider { ...@@ -840,14 +840,12 @@ public class ChromeBrowserProvider extends ContentProvider {
return new BookmarkNode(id, Type.values()[type], name, url, parent); return new BookmarkNode(id, Type.values()[type], name, url, parent);
} }
// TODO(leandrogracia): remove public when VisibleForTesting works. @VisibleForTesting
// @VisibleForTesting
public void setFavicon(byte[] favicon) { public void setFavicon(byte[] favicon) {
mFavicon = favicon; mFavicon = favicon;
} }
// TODO(leandrogracia): remove public when VisibleForTesting works. @VisibleForTesting
// @VisibleForTesting
public void setThumbnail(byte[] thumbnail) { public void setThumbnail(byte[] thumbnail) {
mThumbnail = thumbnail; mThumbnail = thumbnail;
} }
...@@ -866,8 +864,7 @@ public class ChromeBrowserProvider extends ContentProvider { ...@@ -866,8 +864,7 @@ public class ChromeBrowserProvider extends ContentProvider {
getHierarchyRoot().writeNodeContentsRecursive(dest); getHierarchyRoot().writeNodeContentsRecursive(dest);
} }
// TODO(leandrogracia): remove public when VisibleForTesting works. @VisibleForTesting
// @VisibleForTesting
public BookmarkNode getHierarchyRoot() { public BookmarkNode getHierarchyRoot() {
BookmarkNode root = this; BookmarkNode root = this;
while (root.parent() != null) { while (root.parent() != null) {
......
...@@ -284,6 +284,7 @@ ...@@ -284,6 +284,7 @@
'dependencies': [ 'dependencies': [
'../base/base.gyp:base', '../base/base.gyp:base',
'../net/net.gyp:net', '../net/net.gyp:net',
'../third_party/guava/guava.gyp:guava_javalib',
'../ui/ui.gyp:ui_java', '../ui/ui.gyp:ui_java',
'common_aidl', 'common_aidl',
'content_common', 'content_common',
......
...@@ -21,6 +21,8 @@ import android.view.inputmethod.EditorInfo; ...@@ -21,6 +21,8 @@ import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection; import android.view.inputmethod.InputConnection;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import com.google.common.annotations.VisibleForTesting;
import org.chromium.content.common.TraceEvent; import org.chromium.content.common.TraceEvent;
import org.chromium.ui.gfx.NativeWindow; import org.chromium.ui.gfx.NativeWindow;
...@@ -211,7 +213,7 @@ public class ContentView extends FrameLayout implements ContentViewCore.Internal ...@@ -211,7 +213,7 @@ public class ContentView extends FrameLayout implements ContentViewCore.Internal
mContentViewCore.setContentViewClient(client); mContentViewCore.setContentViewClient(client);
} }
// @VisibleForTesting @VisibleForTesting
public ContentViewClient getContentViewClient() { public ContentViewClient getContentViewClient() {
return mContentViewCore.getContentViewClient(); return mContentViewCore.getContentViewClient();
} }
...@@ -344,18 +346,16 @@ public class ContentView extends FrameLayout implements ContentViewCore.Internal ...@@ -344,18 +346,16 @@ public class ContentView extends FrameLayout implements ContentViewCore.Internal
/** /**
* Start profiling the update speed. You must call {@link #stopFpsProfiling} * Start profiling the update speed. You must call {@link #stopFpsProfiling}
* to stop profiling. * to stop profiling.
*
* @VisibleForTesting
*/ */
@VisibleForTesting
public void startFpsProfiling() { public void startFpsProfiling() {
// TODO(nileshagrawal): Implement this. // TODO(nileshagrawal): Implement this.
} }
/** /**
* Stop profiling the update speed. * Stop profiling the update speed.
*
* @VisibleForTesting
*/ */
@VisibleForTesting
public float stopFpsProfiling() { public float stopFpsProfiling() {
// TODO(nileshagrawal): Implement this. // TODO(nileshagrawal): Implement this.
return 0.0f; return 0.0f;
...@@ -367,9 +367,8 @@ public class ContentView extends FrameLayout implements ContentViewCore.Internal ...@@ -367,9 +367,8 @@ public class ContentView extends FrameLayout implements ContentViewCore.Internal
* @param y Fling touch starting position * @param y Fling touch starting position
* @param velocityX Initial velocity of the fling (X) measured in pixels per second. * @param velocityX Initial velocity of the fling (X) measured in pixels per second.
* @param velocityY Initial velocity of the fling (Y) measured in pixels per second. * @param velocityY Initial velocity of the fling (Y) measured in pixels per second.
*
* @VisibleForTesting
*/ */
@VisibleForTesting
public void fling(long timeMs, int x, int y, int velocityX, int velocityY) { public void fling(long timeMs, int x, int y, int velocityX, int velocityY) {
mContentViewCore.getContentViewGestureHandler().fling(timeMs, x, y, velocityX, velocityY); mContentViewCore.getContentViewGestureHandler().fling(timeMs, x, y, velocityX, velocityY);
} }
...@@ -380,18 +379,16 @@ public class ContentView extends FrameLayout implements ContentViewCore.Internal ...@@ -380,18 +379,16 @@ public class ContentView extends FrameLayout implements ContentViewCore.Internal
/** /**
* Start pinch zoom. You must call {@link #pinchEnd} to stop. * Start pinch zoom. You must call {@link #pinchEnd} to stop.
*
* @VisibleForTesting
*/ */
@VisibleForTesting
public void pinchBegin(long timeMs, int x, int y) { public void pinchBegin(long timeMs, int x, int y) {
mContentViewCore.getContentViewGestureHandler().pinchBegin(timeMs, x, y); mContentViewCore.getContentViewGestureHandler().pinchBegin(timeMs, x, y);
} }
/** /**
* Stop pinch zoom. * Stop pinch zoom.
*
* @VisibleForTesting
*/ */
@VisibleForTesting
public void pinchEnd(long timeMs) { public void pinchEnd(long timeMs) {
mContentViewCore.getContentViewGestureHandler().pinchEnd(timeMs); mContentViewCore.getContentViewGestureHandler().pinchEnd(timeMs);
} }
...@@ -411,9 +408,8 @@ public class ContentView extends FrameLayout implements ContentViewCore.Internal ...@@ -411,9 +408,8 @@ public class ContentView extends FrameLayout implements ContentViewCore.Internal
* coordinate. * coordinate.
* @param anchorY The magnification anchor (Y) in the current view * @param anchorY The magnification anchor (Y) in the current view
* coordinate. * coordinate.
*
* @VisibleForTesting
*/ */
@VisibleForTesting
public void pinchBy(long timeMs, int anchorX, int anchorY, float delta) { public void pinchBy(long timeMs, int anchorX, int anchorY, float delta) {
mContentViewCore.getContentViewGestureHandler().pinchBy(timeMs, anchorX, anchorY, delta); mContentViewCore.getContentViewGestureHandler().pinchBy(timeMs, anchorX, anchorY, delta);
} }
......
...@@ -37,6 +37,8 @@ import android.view.inputmethod.EditorInfo; ...@@ -37,6 +37,8 @@ import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection; import android.view.inputmethod.InputConnection;
import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodManager;
import com.google.common.annotations.VisibleForTesting;
import org.chromium.base.CalledByNative; import org.chromium.base.CalledByNative;
import org.chromium.base.JNINamespace; import org.chromium.base.JNINamespace;
import org.chromium.base.WeakContext; import org.chromium.base.WeakContext;
...@@ -749,8 +751,8 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient { ...@@ -749,8 +751,8 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient {
* *
* @param url The URL being blocked by the interstitial. * @param url The URL being blocked by the interstitial.
* @param delegate The delegate handling the interstitial. * @param delegate The delegate handling the interstitial.
* @VisibleForTesting
*/ */
@VisibleForTesting
public void showInterstitialPage( public void showInterstitialPage(
String url, InterstitialPageDelegateAndroid delegate) { String url, InterstitialPageDelegateAndroid delegate) {
if (mNativeContentViewCore == 0) return; if (mNativeContentViewCore == 0) return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment