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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java

Issue 614863002: Added test case for CopyImageUrl and CopyEmailAddress. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
Index: chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java
index e07e09a0550958d5fe7f9121f3ab9cf9358354cb..cc967fa057ea5b2662ecd64918f2c6b028c1b8bd 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java
@@ -9,6 +9,7 @@ import android.content.ClipboardManager;
import android.content.Context;
import android.os.Build;
import android.test.FlakyTest;
+import android.test.suitebuilder.annotation.MediumTest;
import android.view.ContextMenu;
import junit.framework.Assert;
@@ -209,6 +210,33 @@ public class ContextMenuTest extends ChromeShellTestBase {
}));
}
+ @MediumTest
Bernhard Bauer 2014/09/30 08:51:08 Why are these tests medium if e.g. testCopyLinkTex
ankit 2014/09/30 09:20:46 I tried running these test cases with @MediumTest
Bernhard Bauer 2014/09/30 10:05:25 Okay, let's try @MediumTest, but can you also chan
+ @Feature({"Browser"})
+ public void testCopyImageURL() throws InterruptedException, TimeoutException {
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) return;
Bernhard Bauer 2014/09/30 08:51:08 What do we need this check for?
ankit 2014/09/30 09:20:46 Not required.
+
+ Tab tab = getActivity().getActiveTab();
+ ContextMenuUtils.selectContextMenuItem(this, tab, "testImage",
+ R.id.contextmenu_copy_image_url);
+
+ String expectedUrl = TestHttpServerClient.getUrl(
+ "chrome/test/data/android/contextmenu/test_image.png");
+
+ assertEquals("Clipboard text is not correct", expectedUrl, getClipboardText());
+ }
+
+ @MediumTest
+ @Feature({"Browser"})
+ public void testCopyEmailAddress() throws InterruptedException, TimeoutException {
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) return;
+
+ Tab tab = getActivity().getActiveTab();
+ ContextMenuUtils.selectContextMenuItem(this, tab, "testEmail",
+ R.id.contextmenu_copy_email_address);
+
+ assertEquals("Clipboard text is not correct", "someone@example.com", getClipboardText());
+ }
+
private String getClipboardText() {
ClipboardManager clipMgr =
(ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE);

Powered by Google App Engine
This is Rietveld 408576698