| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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.test; | 5 package org.chromium.chrome.test; |
| 6 | 6 |
| 7 import static org.chromium.chrome.test.util.ChromeRestriction.RESTRICTION_TYPE_P
HONE; | 7 import static org.chromium.chrome.test.util.ChromeRestriction.RESTRICTION_TYPE_P
HONE; |
| 8 | 8 |
| 9 import android.support.v7.widget.RecyclerView; | 9 import android.support.v7.widget.RecyclerView; |
| 10 | 10 |
| 11 import org.chromium.base.ThreadUtils; | 11 import org.chromium.base.ThreadUtils; |
| 12 import org.chromium.base.test.util.CommandLineFlags; | 12 import org.chromium.base.test.util.CommandLineFlags; |
| 13 import org.chromium.base.test.util.Restriction; | 13 import org.chromium.base.test.util.Restriction; |
| 14 import org.chromium.chrome.browser.preferences.ChromePreferenceManager; | 14 import org.chromium.chrome.browser.preferences.ChromePreferenceManager; |
| 15 import org.chromium.chrome.browser.widget.BottomSheet; | 15 import org.chromium.chrome.browser.widget.bottomsheet.BottomSheet; |
| 16 import org.chromium.chrome.browser.widget.BottomSheet.BottomSheetContent; | 16 import org.chromium.chrome.browser.widget.bottomsheet.BottomSheet.BottomSheetCon
tent; |
| 17 import org.chromium.chrome.test.util.browser.RecyclerViewTestUtils; | 17 import org.chromium.chrome.test.util.browser.RecyclerViewTestUtils; |
| 18 | 18 |
| 19 /** | 19 /** |
| 20 * Base class for instrumentation tests using the bottom sheet. | 20 * Base class for instrumentation tests using the bottom sheet. |
| 21 */ | 21 */ |
| 22 @CommandLineFlags.Add({"enable-features=ChromeHome"}) | 22 @CommandLineFlags.Add({"enable-features=ChromeHome"}) |
| 23 @Restriction(RESTRICTION_TYPE_PHONE) // ChromeHome is only enabled on phones | 23 @Restriction(RESTRICTION_TYPE_PHONE) // ChromeHome is only enabled on phones |
| 24 public abstract class BottomSheetTestCaseBase extends ChromeTabbedActivityTestBa
se { | 24 public abstract class BottomSheetTestCaseBase extends ChromeTabbedActivityTestBa
se { |
| 25 /** A handle to the bottom sheet. */ | 25 /** A handle to the bottom sheet. */ |
| 26 protected BottomSheet mBottomSheet; | 26 protected BottomSheet mBottomSheet; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 public void run() { | 87 public void run() { |
| 88 mBottomSheet.setSheetOffsetFromBottomForTesting(offset); | 88 mBottomSheet.setSheetOffsetFromBottomForTesting(offset); |
| 89 } | 89 } |
| 90 }); | 90 }); |
| 91 } | 91 } |
| 92 | 92 |
| 93 protected BottomSheetContent getBottomSheetContent() { | 93 protected BottomSheetContent getBottomSheetContent() { |
| 94 return getActivity().getBottomSheet().getCurrentSheetContent(); | 94 return getActivity().getBottomSheet().getCurrentSheetContent(); |
| 95 } | 95 } |
| 96 } | 96 } |
| OLD | NEW |