| Index: chrome/android/javatests/src/org/chromium/chrome/browser/SmartClipProviderTest.java
|
| diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/SmartClipProviderTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/SmartClipProviderTest.java
|
| index 2866e152a2798b9ca959ab50180e5b033dfdd19e..74e29521707db24c641f53e2c5fcac1b6dc7e33a 100644
|
| --- a/chrome/android/javatests/src/org/chromium/chrome/browser/SmartClipProviderTest.java
|
| +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/SmartClipProviderTest.java
|
| @@ -7,6 +7,7 @@ package org.chromium.chrome.browser;
|
| import android.annotation.TargetApi;
|
| import android.content.pm.ApplicationInfo;
|
| import android.content.pm.PackageManager;
|
| +import android.graphics.Rect;
|
| import android.os.Build;
|
| import android.os.Bundle;
|
| import android.os.Handler;
|
| @@ -53,11 +54,16 @@ public class SmartClipProviderTest
|
| return mHtml;
|
| }
|
|
|
| - public void notifyCalled(String title, String url, String text, String html) {
|
| + public Rect getRect() {
|
| + return mRect;
|
| + }
|
| +
|
| + public void notifyCalled(String title, String url, String text, String html, Rect rect) {
|
| mTitle = title;
|
| mUrl = url;
|
| mText = text;
|
| mHtml = html;
|
| + mRect = rect;
|
| super.notifyCalled();
|
| }
|
|
|
| @@ -65,6 +71,7 @@ public class SmartClipProviderTest
|
| private String mUrl;
|
| private String mText;
|
| private String mHtml;
|
| + private Rect mRect;
|
| }
|
|
|
| private ChromeActivity mActivity;
|
| @@ -125,8 +132,9 @@ public class SmartClipProviderTest
|
| String title = bundle.getString("title");
|
| String text = bundle.getString("text");
|
| String html = bundle.getString("html");
|
| + Rect rect = bundle.getParcelable("rect");
|
| // We don't care about other values for now.
|
| - mCallbackHelper.notifyCalled(title, url, text, html);
|
| + mCallbackHelper.notifyCalled(title, url, text, html, rect);
|
| return true;
|
| }
|
|
|
| @@ -160,6 +168,7 @@ public class SmartClipProviderTest
|
| @Feature({"SmartClip"})
|
| @RetryOnFailure
|
| public void testSmartClipDataCallback() throws InterruptedException, TimeoutException {
|
| + final Rect rect = new Rect(10, 20, 110, 190);
|
| ThreadUtils.runOnUiThreadBlocking(new Runnable() {
|
| @Override
|
| public void run() {
|
| @@ -171,7 +180,8 @@ public class SmartClipProviderTest
|
| assertNotNull(scp);
|
| try {
|
| mSetSmartClipResultHandlerMethod.invoke(scp, mHandler);
|
| - mExtractSmartClipDataMethod.invoke(scp, 10, 20, 100, 70);
|
| + mExtractSmartClipDataMethod.invoke(
|
| + scp, rect.left, rect.top, rect.width(), rect.height());
|
| } catch (Exception e) {
|
| e.printStackTrace();
|
| fail();
|
| @@ -183,6 +193,11 @@ public class SmartClipProviderTest
|
| assertEquals("about:blank", mCallbackHelper.getUrl());
|
| assertNotNull(mCallbackHelper.getText());
|
| assertNotNull(mCallbackHelper.getHtml());
|
| + assertNotNull(mCallbackHelper.getRect());
|
| + assertEquals(rect.left, mCallbackHelper.getRect().left);
|
| + assertEquals(rect.top, mCallbackHelper.getRect().top);
|
| + assertEquals(rect.width(), mCallbackHelper.getRect().width());
|
| + assertEquals(rect.height(), mCallbackHelper.getRect().height());
|
| }
|
|
|
| @MediumTest
|
|
|