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

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

Issue 1582513003: Add a testing restriction for whether Google Play Services is up-to-date. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 11 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/TabsTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/TabsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/TabsTest.java
index 3bcd471c319bace1c33626cee3adb8bd2d3bdbde..119b3f9a01b0f10d0c818ce06c612d8d28409679 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/TabsTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/TabsTest.java
@@ -5,7 +5,6 @@
package org.chromium.chrome.browser;
import static org.chromium.base.test.util.Restriction.RESTRICTION_TYPE_NON_LOW_END_DEVICE;
-import static org.chromium.base.test.util.Restriction.RESTRICTION_TYPE_PHONE;
import android.content.DialogInterface;
import android.content.pm.ActivityInfo;
@@ -53,6 +52,7 @@ import org.chromium.chrome.browser.tabmodel.TabModelSelectorImpl;
import org.chromium.chrome.browser.tabmodel.TabModelUtils;
import org.chromium.chrome.browser.toolbar.ToolbarPhone;
import org.chromium.chrome.test.ChromeTabbedActivityTestBase;
+import org.chromium.chrome.test.util.ChromeRestriction;
import org.chromium.chrome.test.util.ChromeTabUtils;
import org.chromium.chrome.test.util.MenuUtils;
import org.chromium.chrome.test.util.NewTabPageTestUtils;
@@ -204,7 +204,7 @@ public class TabsTest extends ChromeTabbedActivityTestBase {
* https://crbug.com/490473
* @LargeTest
* @Feature({"Android-TabSwitcher"})
- * @Restriction(RESTRICTION_TYPE_PHONE)
+ * @ChromeRestriction(RESTRICTION_TYPE_PHONE)
*/
@DisabledTest
public void testOpenAndCloseNewTabButton() throws InterruptedException {
@@ -373,7 +373,8 @@ public class TabsTest extends ChromeTabbedActivityTestBase {
* @throws InterruptedException
*/
@LargeTest
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE})
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE})
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE})
@Feature({"Android-TabSwitcher"})
public void testTabSwitcherPortraitCloseButton() throws InterruptedException {
getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
@@ -390,7 +391,8 @@ public class TabsTest extends ChromeTabbedActivityTestBase {
* This code does not handle properly different screen densities.
* @throws InterruptedException
* Bug: crbug.com/170179
- * @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE})
+ * @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE})
+ * @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE})
* @LargeTest
* @Feature({"Android-TabSwitcher"})
*/
@@ -556,7 +558,8 @@ public class TabsTest extends ChromeTabbedActivityTestBase {
Bug http://crbug.com/156746
*/
@DisabledTest
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE})
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE})
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE})
public void testTabsCulling() throws InterruptedException {
// Open one more tabs than maxTabsDrawn.
final int maxTabsDrawn = 8;
@@ -601,7 +604,8 @@ public class TabsTest extends ChromeTabbedActivityTestBase {
* @Feature({"Android-TabSwitcher"})
*/
@FlakyTest
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE})
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE})
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE})
public void testTabsStacking() throws InterruptedException {
final int count = openTabs(12, false);
@@ -667,7 +671,7 @@ public class TabsTest extends ChromeTabbedActivityTestBase {
* @Feature({"Android-TabSwitcher"})
*/
@FlakyTest
- @Restriction(RESTRICTION_TYPE_PHONE)
+ @ChromeRestriction(ChromeRestriction.RESTRICTION_TYPE_PHONE)
public void testTabSwitcherMemoryLeak() throws InterruptedException {
openTabs(4, true);
@@ -696,7 +700,7 @@ public class TabsTest extends ChromeTabbedActivityTestBase {
* Verify that switching back and forth stay stable. This test last for at least 8 seconds.
*/
@LargeTest
- @Restriction(RESTRICTION_TYPE_PHONE)
+ @ChromeRestriction(ChromeRestriction.RESTRICTION_TYPE_PHONE)
@Feature({"Android-TabSwitcher"})
public void testTabSwitcherStability() throws InterruptedException {
openTabs(8, true);
@@ -716,7 +720,8 @@ public class TabsTest extends ChromeTabbedActivityTestBase {
@LargeTest
@Feature({"Android-TabSwitcher"})
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE})
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE})
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE})
public void testTabSelectionPortrait() throws InterruptedException {
getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
checkTabSelection(2, 0, false);
@@ -740,7 +745,8 @@ public class TabsTest extends ChromeTabbedActivityTestBase {
* @Feature({"Android-TabSwitcher"})
*/
@FlakyTest
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE})
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE})
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE})
public void testTabSelectionLandscape() throws InterruptedException {
getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
checkTabSelection(2, 0, true);
@@ -762,7 +768,7 @@ public class TabsTest extends ChromeTabbedActivityTestBase {
* Verify that we don't crash and show the overview mode after closing the last tab.
*/
@SmallTest
- @Restriction(RESTRICTION_TYPE_PHONE)
+ @ChromeRestriction(ChromeRestriction.RESTRICTION_TYPE_PHONE)
@Feature({"Android-TabSwitcher"})
public void testCloseLastTabFromMain() throws InterruptedException {
OverviewModeBehaviorWatcher overviewModeWatcher = new OverviewModeBehaviorWatcher(
@@ -936,7 +942,8 @@ public class TabsTest extends ChromeTabbedActivityTestBase {
* Test closing few tabs by swiping them in Overview portrait mode.
*/
@MediumTest
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE})
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE})
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE})
@Feature({"Android-TabSwitcher", "Main"})
public void testCloseTabPortrait() throws InterruptedException {
startMainActivityWithURL(TestHttpServerClient.getUrl("chrome/test/data/android/test.html"));
@@ -960,7 +967,8 @@ public class TabsTest extends ChromeTabbedActivityTestBase {
*/
@MediumTest
@Feature({"Android-TabSwitcher", "Main"})
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE})
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE})
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE})
public void testCloseTabLandscape() throws InterruptedException {
startMainActivityWithURL(TestHttpServerClient.getUrl("chrome/test/data/android/test.html"));
@@ -985,7 +993,8 @@ public class TabsTest extends ChromeTabbedActivityTestBase {
*/
@MediumTest
@Feature({"Android-TabSwitcher"})
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE})
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE})
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE})
public void testCloseIncognitoTabPortrait() throws InterruptedException {
getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
newIncognitoTabsFromMenu(2);
@@ -1000,7 +1009,8 @@ public class TabsTest extends ChromeTabbedActivityTestBase {
*/
@Feature({"Android-TabSwitcher"})
@MediumTest
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE})
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE})
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE})
public void testCloseFiveIncognitoTabPortrait() throws InterruptedException {
getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
newIncognitoTabsFromMenu(5);
@@ -1014,7 +1024,8 @@ public class TabsTest extends ChromeTabbedActivityTestBase {
* Simple swipe gesture should not close tabs when two Tabstacks are open in Overview mode.
* Test in Portrait Mode.
*/
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE})
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE})
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE})
@MediumTest
@Feature({"Android-TabSwitcher"})
public void testSwitchTabStackWithoutClosingTabsInPortrait() throws InterruptedException {
@@ -1061,7 +1072,8 @@ public class TabsTest extends ChromeTabbedActivityTestBase {
@Feature({"Android-TabSwitcher"})
Bug http://crbug.com/157259
*/
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE})
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE})
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE})
@DisabledTest
public void testSwitchTabStackWithoutClosingTabsInLandscape() throws InterruptedException {
getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
@@ -1103,7 +1115,8 @@ public class TabsTest extends ChromeTabbedActivityTestBase {
*/
@MediumTest
@Feature({"Android-TabSwitcher"})
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE})
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE})
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE})
public void testCloseIncognitoTabLandscape() throws InterruptedException {
getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
newIncognitoTabFromMenu();
@@ -1118,7 +1131,8 @@ public class TabsTest extends ChromeTabbedActivityTestBase {
*/
@MediumTest
@Feature({"Android-TabSwitcher"})
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE})
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE})
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE})
public void testCloseFiveIncognitoTabLandscape() throws InterruptedException {
getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
newIncognitoTabsFromMenu(5);
@@ -1148,7 +1162,7 @@ public class TabsTest extends ChromeTabbedActivityTestBase {
/**
* Flaky on instrumentation-yakju-clankium-ics. See https://crbug.com/431296.
- * @Restriction(RESTRICTION_TYPE_PHONE)
+ * @ChromeRestriction(RESTRICTION_TYPE_PHONE)
* @MediumTest
* @Feature({"Android-TabSwitcher"})
*/
@@ -1196,7 +1210,7 @@ public class TabsTest extends ChromeTabbedActivityTestBase {
*/
@MediumTest
@Feature({"Android-TabSwitcher"})
- @Restriction(RESTRICTION_TYPE_PHONE)
+ @ChromeRestriction(ChromeRestriction.RESTRICTION_TYPE_PHONE)
public void testNewTabButton() throws InterruptedException {
MenuUtils.invokeCustomMenuActionSync(getInstrumentation(), getActivity(),
R.id.close_all_tabs_menu_id);
@@ -1405,7 +1419,8 @@ public class TabsTest extends ChromeTabbedActivityTestBase {
* Test that swipes and tab transitions are not causing URL bar to be focused.
*/
@MediumTest
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE})
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE})
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE})
@Feature({"Android-TabSwitcher"})
public void testOSKIsNotShownDuringSwipe() throws InterruptedException {
final View urlBar = getActivity().findViewById(R.id.url_bar);
@@ -1507,7 +1522,8 @@ public class TabsTest extends ChromeTabbedActivityTestBase {
*/
@MediumTest
@Feature({"Android-TabSwitcher"})
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE})
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE})
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE})
public void testOrientationChangeCausesLiveTabReflowInTabSwitcher()
throws InterruptedException, TimeoutException {
getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

Powered by Google App Engine
This is Rietveld 408576698