| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.contextualsearch; | 5 package org.chromium.chrome.browser.contextualsearch; |
| 6 | 6 |
| 7 import static org.chromium.base.test.util.Restriction.RESTRICTION_TYPE_NON_LOW_E
ND_DEVICE; | 7 import static org.chromium.base.test.util.Restriction.RESTRICTION_TYPE_NON_LOW_E
ND_DEVICE; |
| 8 import static org.chromium.content.browser.test.util.CriteriaHelper.DEFAULT_POLL
ING_INTERVAL; | 8 import static org.chromium.content.browser.test.util.CriteriaHelper.DEFAULT_POLL
ING_INTERVAL; |
| 9 | 9 |
| 10 import android.app.Activity; | 10 import android.app.Activity; |
| (...skipping 1834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1845 assertEquals(2, mPolicy.getPromoOpenCount()); | 1845 assertEquals(2, mPolicy.getPromoOpenCount()); |
| 1846 } | 1846 } |
| 1847 | 1847 |
| 1848 /** | 1848 /** |
| 1849 * Tests the promo open counter. | 1849 * Tests the promo open counter. |
| 1850 */ | 1850 */ |
| 1851 @SmallTest | 1851 @SmallTest |
| 1852 @Feature({"ContextualSearch"}) | 1852 @Feature({"ContextualSearch"}) |
| 1853 @Restriction({ChromeRestriction.RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON
_LOW_END_DEVICE}) | 1853 @Restriction({ChromeRestriction.RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON
_LOW_END_DEVICE}) |
| 1854 @DisableIf.Build(supported_abis_includes = "arm64-v8a", message = "crbug.com
/596533") | 1854 @DisableIf.Build(supported_abis_includes = "arm64-v8a", message = "crbug.com
/596533") |
| 1855 @RetryOnFailure |
| 1855 public void testPromoOpenCountForDecided() throws InterruptedException, Time
outException { | 1856 public void testPromoOpenCountForDecided() throws InterruptedException, Time
outException { |
| 1856 mPolicy.overrideDecidedStateForTesting(true); | 1857 mPolicy.overrideDecidedStateForTesting(true); |
| 1857 | 1858 |
| 1858 // An open should not count for decided users. | 1859 // An open should not count for decided users. |
| 1859 clickToExpandAndClosePanel(); | 1860 clickToExpandAndClosePanel(); |
| 1860 assertEquals(0, mPolicy.getPromoOpenCount()); | 1861 assertEquals(0, mPolicy.getPromoOpenCount()); |
| 1861 } | 1862 } |
| 1862 | 1863 |
| 1863 // -------------------------------------------------------------------------
------------------- | 1864 // -------------------------------------------------------------------------
------------------- |
| 1864 // Tap count - number of taps between opens. | 1865 // Tap count - number of taps between opens. |
| (...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2646 // Simulate a tap and assert that the panel peeks. | 2647 // Simulate a tap and assert that the panel peeks. |
| 2647 simulateTapSearch("search"); | 2648 simulateTapSearch("search"); |
| 2648 | 2649 |
| 2649 // Toggle tab to non-fullscreen. | 2650 // Toggle tab to non-fullscreen. |
| 2650 FullscreenTestUtils.togglePersistentFullscreenAndAssert(tab, false, getA
ctivity()); | 2651 FullscreenTestUtils.togglePersistentFullscreenAndAssert(tab, false, getA
ctivity()); |
| 2651 | 2652 |
| 2652 // Assert that the panel is closed. | 2653 // Assert that the panel is closed. |
| 2653 waitForPanelToClose(); | 2654 waitForPanelToClose(); |
| 2654 } | 2655 } |
| 2655 } | 2656 } |
| OLD | NEW |