Index: chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java |
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java |
index 8857d6b3e1b09e37abc19191ab42c7d2bb49e923..65efc3c26c72ec1a9aba9e38820f16e604bb4de2 100644 |
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java |
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java |
@@ -5,7 +5,6 @@ |
package org.chromium.chrome.browser.contextualsearch; |
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 static org.chromium.content.browser.test.util.CriteriaHelper.DEFAULT_POLLING_INTERVAL; |
import android.app.Activity; |
@@ -46,6 +45,7 @@ import org.chromium.chrome.browser.tabmodel.TabModelSelectorObserver; |
import org.chromium.chrome.browser.tabmodel.TabModelUtils; |
import org.chromium.chrome.browser.util.FeatureUtilities; |
import org.chromium.chrome.test.ChromeActivityTestCaseBase; |
+import org.chromium.chrome.test.util.ChromeRestriction; |
import org.chromium.chrome.test.util.ChromeTabUtils; |
import org.chromium.chrome.test.util.OmniboxTestUtils; |
import org.chromium.chrome.test.util.TestHttpServerClient; |
@@ -1002,7 +1002,8 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
*/ |
@SmallTest |
@Feature({"ContextualSearch"}) |
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE}) |
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
public void testSwipeExpand() throws InterruptedException, TimeoutException { |
assertNoSearchesLoaded(); |
clickWordNode("intelligence"); |
@@ -1028,7 +1029,8 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
*/ |
@SmallTest |
@Feature({"ContextualSearch"}) |
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE}) |
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
public void testLongPressSwipeExpand() throws InterruptedException, TimeoutException { |
longPressNode("intelligence"); |
assertNoContentViewCore(); |
@@ -1062,7 +1064,8 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
*/ |
@SmallTest |
@Feature({"ContextualSearch"}) |
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE}) |
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
public void testTapCausesOneLowPriorityRequest() throws InterruptedException, TimeoutException { |
mFakeServer.reset(); |
clickWordNode("states"); |
@@ -1091,7 +1094,8 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
*/ |
@SmallTest |
@Feature({"ContextualSearch"}) |
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE}) |
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
public void testPrefetchFailoverRequestMadeAfterOpen() |
throws InterruptedException, TimeoutException { |
mFakeServer.reset(); |
@@ -1385,7 +1389,8 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
* @SmallTest |
* @Feature({"ContextualSearch"}) |
*/ |
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE}) |
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
@CommandLineFlags.Add(ChromeSwitches.DISABLE_DOCUMENT_MODE) |
@FlakyTest |
public void testTapSearchBarPromotesToTab() throws InterruptedException, TimeoutException { |
@@ -1475,7 +1480,8 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
*/ |
@SmallTest |
@Feature({"ContextualSearch"}) |
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE}) |
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
public void testTapResolveLimitForDecided() throws InterruptedException, TimeoutException { |
mPolicy.setTapResolveLimitForDecidedForTesting(2); |
clickToTriggerSearchTermResolution(); |
@@ -1499,7 +1505,8 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
*/ |
@SmallTest |
@Feature({"ContextualSearch"}) |
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE}) |
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
public void testTapResolveLimitForUndecided() throws InterruptedException, TimeoutException { |
mPolicy.setTapResolveLimitForUndecidedForTesting(2); |
mPolicy.overrideDecidedStateForTesting(false); |
@@ -1525,7 +1532,8 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
*/ |
@SmallTest |
@Feature({"ContextualSearch"}) |
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE}) |
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
public void testTapPrefetchLimitForDecided() throws InterruptedException, TimeoutException { |
mPolicy.setTapPrefetchLimitForDecidedForTesting(2); |
clickToTriggerPrefetch(); |
@@ -1549,7 +1557,8 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
*/ |
@SmallTest |
@Feature({"ContextualSearch"}) |
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE}) |
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
public void testTapPrefetchLimitForUndecided() throws InterruptedException, TimeoutException { |
mPolicy.setTapPrefetchLimitForUndecidedForTesting(2); |
mPolicy.overrideDecidedStateForTesting(false); |
@@ -1576,7 +1585,8 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
*/ |
@SmallTest |
@Feature({"ContextualSearch"}) |
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE}) |
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
public void testExpandBeforeSearchTermResolution() |
throws InterruptedException, TimeoutException { |
clickWordNode("states"); |
@@ -1600,7 +1610,8 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
*/ |
@SmallTest |
@Feature({"ContextualSearch"}) |
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE}) |
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
public void testSearchTermResolutionError() throws InterruptedException, TimeoutException { |
clickWordNode("states"); |
assertSearchTermRequested(); |
@@ -1696,7 +1707,8 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
*/ |
@SmallTest |
@Feature({"ContextualSearch"}) |
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE}) |
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
public void testAppMenuSuppressedWhenExpanded() throws InterruptedException, TimeoutException { |
clickWordNode("states"); |
tapPeekingBarToExpandAndAssert(); |
@@ -1745,7 +1757,8 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
*/ |
@SmallTest |
@Feature({"ContextualSearch"}) |
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE}) |
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
public void testPromoTapCount() throws InterruptedException, TimeoutException { |
mPolicy.setPromoTapTriggeredLimitForTesting(2); |
mPolicy.overrideDecidedStateForTesting(false); |
@@ -1790,7 +1803,8 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
*/ |
@SmallTest |
@Feature({"ContextualSearch"}) |
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE}) |
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
public void testPromoOpenCountForUndecided() throws InterruptedException, TimeoutException { |
mPolicy.overrideDecidedStateForTesting(false); |
@@ -1817,7 +1831,8 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
*/ |
@SmallTest |
@Feature({"ContextualSearch"}) |
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE}) |
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
public void testPromoOpenCountForDecided() throws InterruptedException, TimeoutException { |
mPolicy.overrideDecidedStateForTesting(true); |
@@ -1873,7 +1888,8 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
*/ |
@SmallTest |
@Feature({"ContextualSearch"}) |
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE}) |
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
public void testNotifyObserverHideAfterLongPress() |
throws InterruptedException, TimeoutException { |
TestContextualSearchObserver observer = new TestContextualSearchObserver(); |
@@ -1891,7 +1907,8 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
*/ |
@SmallTest |
@Feature({"ContextualSearch"}) |
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE}) |
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
public void testNotifyObserverHideAfterTap() throws InterruptedException, TimeoutException { |
TestContextualSearchObserver observer = new TestContextualSearchObserver(); |
mManager.addObserver(observer); |
@@ -2097,7 +2114,8 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
* @SmallTest |
* @Feature({"ContextualSearch"}) |
*/ |
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE}) |
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
@FlakyTest |
@CommandLineFlags.Add(ContextualSearchFieldTrial.PEEK_PROMO_ENABLED + "=true") |
public void testLongPressShowsPeekPromo() throws InterruptedException, TimeoutException { |
@@ -2139,7 +2157,8 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
*/ |
@SmallTest |
@Feature({"ContextualSearch"}) |
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE}) |
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
public void testTapContentVisibility() throws InterruptedException, TimeoutException { |
// Simulate a tap and make sure Content is not visible. |
simulateTapSearch("search"); |
@@ -2160,7 +2179,8 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
*/ |
@SmallTest |
@Feature({"ContextualSearch"}) |
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE}) |
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
public void testLongPressContentVisibility() throws InterruptedException, TimeoutException { |
// Simulate a long press and make sure no Content is created. |
simulateLongPressSearch("search"); |
@@ -2182,7 +2202,8 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
*/ |
@SmallTest |
@Feature({"ContextualSearch"}) |
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE}) |
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
public void testTapMultipleSwipeOnlyLoadsContentOnce() |
throws InterruptedException, TimeoutException { |
// Simulate a tap and make sure Content is not visible. |
@@ -2217,7 +2238,8 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
*/ |
@SmallTest |
@Feature({"ContextualSearch"}) |
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE}) |
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
public void testLongPressMultipleSwipeOnlyLoadsContentOnce() |
throws InterruptedException, TimeoutException { |
// Simulate a long press and make sure no Content is created. |
@@ -2292,7 +2314,8 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
@DisabledTest // https://crbug.com/551711 |
@SmallTest |
@Feature({"ContextualSearch"}) |
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE}) |
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
public void testChainedSearchLoadsCorrectSearchTerm() |
throws InterruptedException, TimeoutException { |
// Simulate a tap and make sure Content is not visible. |
@@ -2337,7 +2360,8 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
*/ |
@SmallTest |
@Feature({"ContextualSearch"}) |
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE}) |
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
public void testChainedSearchContentVisibility() throws InterruptedException, TimeoutException { |
// Simulate a tap and make sure Content is not visible. |
simulateTapSearch("search"); |
@@ -2391,7 +2415,8 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
*/ |
@SmallTest |
@Feature({"ContextualSearch"}) |
- @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
+ @ChromeRestriction({ChromeRestriction.RESTRICTION_TYPE_PHONE}) |
+ @Restriction({RESTRICTION_TYPE_NON_LOW_END_DEVICE}) |
public void testTapExpandNotRemovedFromHistory() |
throws InterruptedException, TimeoutException { |
// Simulate a tap and make sure a URL was loaded. |