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

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: Replaced LargeTest with MediumTest 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
« no previous file with comments | « no previous file | chrome/test/data/android/contextmenu/context_menu_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b3692f81056ddd9caa75d89a45efe65fde995c3f 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;
@@ -41,7 +42,7 @@ public class ContextMenuTest extends ChromeShellTestBase {
// http://crbug.com/326769
@FlakyTest
- // @LargeTest
+ // @MediumTest
@Feature({"Browser", "Main"})
public void testCopyLinkURL() throws InterruptedException, TimeoutException {
Tab tab = getActivity().getActiveTab();
@@ -53,7 +54,7 @@ public class ContextMenuTest extends ChromeShellTestBase {
// http://crbug.com/326769
@FlakyTest
- // @LargeTest
+ // @MediumTest
@Feature({"Browser"})
public void testCopyImageLinkCopiesLinkURL() throws InterruptedException, TimeoutException {
Tab tab = getActivity().getActiveTab();
@@ -65,7 +66,7 @@ public class ContextMenuTest extends ChromeShellTestBase {
// http://crbug.com/326769
@FlakyTest
- // @LargeTest
+ // @MediumTest
@Feature({"Browser"})
public void testCopyLinkTextSimple() throws InterruptedException, TimeoutException {
Tab tab = getActivity().getActiveTab();
@@ -78,7 +79,7 @@ public class ContextMenuTest extends ChromeShellTestBase {
// http://crbug.com/326769
@FlakyTest
- // @LargeTest
+ // @MediumTest
@Feature({"Browser"})
public void testCopyLinkTextComplex() throws InterruptedException, TimeoutException {
Tab tab = getActivity().getActiveTab();
@@ -91,7 +92,7 @@ public class ContextMenuTest extends ChromeShellTestBase {
// http://crbug.com/326769
@FlakyTest
- // @LargeTest
+ // @MediumTest
@Feature({"Browser"})
public void testCopyImageToClipboard() throws InterruptedException, TimeoutException {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) return;
@@ -108,7 +109,7 @@ public class ContextMenuTest extends ChromeShellTestBase {
// http://crbug.com/326769
@FlakyTest
- // @LargeTest
+ // @MediumTest
@Feature({"Browser"})
public void testLongPressOnImage() throws InterruptedException, TimeoutException {
final Tab tab = getActivity().getActiveTab();
@@ -140,7 +141,7 @@ public class ContextMenuTest extends ChromeShellTestBase {
// http://crbug.com/326769
@FlakyTest
- // @LargeTest
+ // @MediumTest
@Feature({"Browser"})
public void testLongPressOnImageLink() throws InterruptedException, TimeoutException {
final Tab tab = getActivity().getActiveTab();
@@ -169,7 +170,7 @@ public class ContextMenuTest extends ChromeShellTestBase {
// http://crbug.com/326769
@FlakyTest
- // @LargeTest
+ // @MediumTest
@Feature({"Browser"})
public void testDismissContextMenuOnBack() throws InterruptedException, TimeoutException {
Tab tab = getActivity().getActiveTab();
@@ -190,7 +191,7 @@ public class ContextMenuTest extends ChromeShellTestBase {
// http://crbug.com/326769
@FlakyTest
- // @LargeTest
+ // @MediumTest
@Feature({"Browser"})
public void testDismissContextMenuOnClick() throws InterruptedException, TimeoutException {
Tab tab = getActivity().getActiveTab();
@@ -209,6 +210,30 @@ public class ContextMenuTest extends ChromeShellTestBase {
}));
}
+ @MediumTest
+ @Feature({"Browser"})
+ public void testCopyImageURL() throws InterruptedException, TimeoutException {
+ 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("Copied image URL is not correct", expectedUrl, getClipboardText());
+ }
+
+ @MediumTest
+ @Feature({"Browser"})
+ public void testCopyEmailAddress() throws InterruptedException, TimeoutException {
+ Tab tab = getActivity().getActiveTab();
+ ContextMenuUtils.selectContextMenuItem(this, tab, "testEmail",
+ R.id.contextmenu_copy_email_address);
+
+ assertEquals("Copied email address is not correct", "someone@example.com",
+ getClipboardText());
+ }
+
private String getClipboardText() {
ClipboardManager clipMgr =
(ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE);
« no previous file with comments | « no previous file | chrome/test/data/android/contextmenu/context_menu_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698