| Index: chrome/android/javatests/src/org/chromium/chrome/browser/hardware_acceleration/ChromeTabbedActivityHWATest.java
|
| diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/hardware_acceleration/ChromeTabbedActivityHWATest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/hardware_acceleration/ChromeTabbedActivityHWATest.java
|
| index 6beb986ce888cffee7da6020bfc12b5a5f0380e3..b4e646e8af599b92d569bf19d4b902379ca5fd8d 100644
|
| --- a/chrome/android/javatests/src/org/chromium/chrome/browser/hardware_acceleration/ChromeTabbedActivityHWATest.java
|
| +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/hardware_acceleration/ChromeTabbedActivityHWATest.java
|
| @@ -10,19 +10,32 @@ import android.test.suitebuilder.annotation.SmallTest;
|
|
|
| import org.chromium.base.test.util.Restriction;
|
| import org.chromium.base.test.util.UrlUtils;
|
| +import org.chromium.chrome.R;
|
| +import org.chromium.chrome.browser.tab.Tab;
|
| import org.chromium.chrome.test.ChromeTabbedActivityTestBase;
|
| +import org.chromium.chrome.test.util.browser.contextmenu.ContextMenuUtils;
|
|
|
| /**
|
| * Tests that ChromeTabbedActivity is hardware accelerated only high-end devices.
|
| */
|
| public class ChromeTabbedActivityHWATest extends ChromeTabbedActivityTestBase {
|
|
|
| + private static final String LINKED_URL = UrlUtils.encodeHtmlDataUri(
|
| + "<html>"
|
| + + " <head>"
|
| + + " <title>Linked Page</title>"
|
| + + " </head>"
|
| + + " <body style='margin: 0em; background: #ff00ff;'></body>"
|
| + + "</html>");
|
| +
|
| + private static final String LINK_ID = "testLink";
|
| private static final String URL = UrlUtils.encodeHtmlDataUri(
|
| "<html>"
|
| + " <head>"
|
| + " <title>Test Page</title>"
|
| + " </head>"
|
| + " <body style='margin: 0em; background: #ffff00;'></body>"
|
| + + " <a href='" + LINKED_URL + "' id='" + LINK_ID + "'>Test Link</a>"
|
| + "</html>");
|
|
|
| @Override
|
| @@ -40,4 +53,16 @@ public class ChromeTabbedActivityHWATest extends ChromeTabbedActivityTestBase {
|
| public void testNoRenderThread() throws Exception {
|
| Utils.assertNoRenderThread();
|
| }
|
| +
|
| + @Restriction(RESTRICTION_TYPE_LOW_END_DEVICE)
|
| + @SmallTest
|
| + public void testToastNoRenderThread() throws Exception {
|
| + // Open link in new tab (shows 'Tab Opened In Background' toast)
|
| + Tab tab = getActivity().getActivityTab();
|
| + ContextMenuUtils.selectContextMenuItem(this, tab, LINK_ID,
|
| + R.id.contextmenu_open_in_new_tab);
|
| + getInstrumentation().waitForIdleSync();
|
| +
|
| + Utils.assertNoRenderThread();
|
| + }
|
| }
|
|
|