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

Side by Side Diff: chrome/test/android/javatests/src/org/chromium/chrome/test/BottomSheetTestCaseBase.java

Issue 2781093004: Disable BottomSheetTest on pre-Lollipop MR1 (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.os.Build;
9 import android.support.v7.widget.RecyclerView; 10 import android.support.v7.widget.RecyclerView;
10 11
11 import org.chromium.base.ThreadUtils; 12 import org.chromium.base.ThreadUtils;
12 import org.chromium.base.test.util.CommandLineFlags; 13 import org.chromium.base.test.util.CommandLineFlags;
14 import org.chromium.base.test.util.MinAndroidSdkLevel;
13 import org.chromium.base.test.util.Restriction; 15 import org.chromium.base.test.util.Restriction;
14 import org.chromium.chrome.R; 16 import org.chromium.chrome.R;
15 import org.chromium.chrome.browser.preferences.ChromePreferenceManager; 17 import org.chromium.chrome.browser.preferences.ChromePreferenceManager;
16 import org.chromium.chrome.browser.widget.bottomsheet.BottomSheet; 18 import org.chromium.chrome.browser.widget.bottomsheet.BottomSheet;
17 import org.chromium.chrome.browser.widget.bottomsheet.BottomSheet.BottomSheetCon tent; 19 import org.chromium.chrome.browser.widget.bottomsheet.BottomSheet.BottomSheetCon tent;
18 import org.chromium.chrome.browser.widget.bottomsheet.BottomSheetContentControll er; 20 import org.chromium.chrome.browser.widget.bottomsheet.BottomSheetContentControll er;
19 import org.chromium.chrome.test.util.browser.RecyclerViewTestUtils; 21 import org.chromium.chrome.test.util.browser.RecyclerViewTestUtils;
20 22
21 /** 23 /**
22 * Base class for instrumentation tests using the bottom sheet. 24 * Base class for instrumentation tests using the bottom sheet.
23 */ 25 */
24 @CommandLineFlags.Add({"enable-features=ChromeHome"}) 26 @CommandLineFlags.Add({"enable-features=ChromeHome"})
25 @Restriction(RESTRICTION_TYPE_PHONE) // ChromeHome is only enabled on phones 27 @Restriction(RESTRICTION_TYPE_PHONE) // ChromeHome is only enabled on phones
28 @MinAndroidSdkLevel(Build.VERSION_CODES.LOLLIPOP_MR1)
26 public abstract class BottomSheetTestCaseBase extends ChromeTabbedActivityTestBa se { 29 public abstract class BottomSheetTestCaseBase extends ChromeTabbedActivityTestBa se {
27 /** A handle to the bottom sheet. */ 30 /** A handle to the bottom sheet. */
28 protected BottomSheet mBottomSheet; 31 protected BottomSheet mBottomSheet;
29 32
30 /** A handle to the {@link BottomSheetContentController}. */ 33 /** A handle to the {@link BottomSheetContentController}. */
31 protected BottomSheetContentController mBottomSheetContentController; 34 protected BottomSheetContentController mBottomSheetContentController;
32 35
33 private boolean mOldChromeHomeFlagValue; 36 private boolean mOldChromeHomeFlagValue;
34 @Override 37 @Override
35 protected void setUp() throws Exception { 38 protected void setUp() throws Exception {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 */ 110 */
108 protected void selectBottomSheetContent(final int itemId) { 111 protected void selectBottomSheetContent(final int itemId) {
109 ThreadUtils.runOnUiThreadBlocking(new Runnable() { 112 ThreadUtils.runOnUiThreadBlocking(new Runnable() {
110 @Override 113 @Override
111 public void run() { 114 public void run() {
112 mBottomSheetContentController.selectItemForTests(itemId); 115 mBottomSheetContentController.selectItemForTests(itemId);
113 } 116 }
114 }); 117 });
115 } 118 }
116 } 119 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698