Merge "Deprecating LauncherInstrumentation constructor with parameter" into ub-launcher3-qt-qpr1-dev

This commit is contained in:
Vadim Tryshev
2019-09-27 19:57:00 +00:00
committed by Android (Google) Code Review
3 changed files with 12 additions and 3 deletions

View File

@@ -79,7 +79,7 @@ public class FallbackRecentsTest {
Context context = instrumentation.getContext();
mDevice = UiDevice.getInstance(instrumentation);
mDevice.setOrientationNatural();
mLauncher = new LauncherInstrumentation(instrumentation);
mLauncher = new LauncherInstrumentation();
mOrderSensitiveRules = RuleChain.
outerRule(new NavigationModeSwitchRule(mLauncher)).

View File

@@ -92,8 +92,7 @@ public abstract class AbstractLauncherUiTest {
protected MainThreadExecutor mMainThreadExecutor = new MainThreadExecutor();
protected final UiDevice mDevice = UiDevice.getInstance(getInstrumentation());
protected final LauncherInstrumentation mLauncher =
new LauncherInstrumentation(getInstrumentation());
protected final LauncherInstrumentation mLauncher = new LauncherInstrumentation();
protected Context mTargetContext;
protected String mTargetPackage;

View File

@@ -51,6 +51,7 @@ import android.view.accessibility.AccessibilityEvent;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.test.InstrumentationRegistry;
import androidx.test.uiautomator.By;
import androidx.test.uiautomator.BySelector;
import androidx.test.uiautomator.Configurator;
@@ -144,6 +145,15 @@ public final class LauncherInstrumentation {
/**
* Constructs the root of TAPL hierarchy. You get all other objects from it.
*/
public LauncherInstrumentation() {
this(InstrumentationRegistry.getInstrumentation());
}
/**
* Constructs the root of TAPL hierarchy. You get all other objects from it.
* Deprecated: use the constructor without parameters instead.
*/
@Deprecated
public LauncherInstrumentation(Instrumentation instrumentation) {
mInstrumentation = instrumentation;
mDevice = UiDevice.getInstance(instrumentation);