diff --git a/dev/benchmarks/macrobenchmarks/android/app/build.gradle b/dev/benchmarks/macrobenchmarks/android/app/build.gradle index caa5acfc5a..f4273a1d91 100644 --- a/dev/benchmarks/macrobenchmarks/android/app/build.gradle +++ b/dev/benchmarks/macrobenchmarks/android/app/build.gradle @@ -41,6 +41,7 @@ android { targetSdkVersion 28 versionCode flutterVersionCode.toInteger() versionName flutterVersionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { @@ -54,3 +55,11 @@ android { flutter { source '../..' } + +dependencies { + testImplementation 'junit:junit:4.12' + + // https://developer.android.com/jetpack/androidx/releases/test/#1.2.0 + androidTestImplementation 'androidx.test:runner:1.2.0' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' +} diff --git a/dev/benchmarks/macrobenchmarks/android/app/src/androidTest/java/com/example/macrobenchmarks/MainActivityTest.java b/dev/benchmarks/macrobenchmarks/android/app/src/androidTest/java/com/example/macrobenchmarks/MainActivityTest.java new file mode 100644 index 0000000000..568553827f --- /dev/null +++ b/dev/benchmarks/macrobenchmarks/android/app/src/androidTest/java/com/example/macrobenchmarks/MainActivityTest.java @@ -0,0 +1,16 @@ +// Copyright 2014 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package com.example.macrobenchmarks; + +import androidx.test.rule.ActivityTestRule; +import dev.flutter.plugins.e2e.FlutterTestRunner; +import org.junit.Rule; +import org.junit.runner.RunWith; + +@RunWith(FlutterTestRunner.class) +public class MainActivityTest { + @Rule + public ActivityTestRule rule = new ActivityTestRule<>(MainActivity.class, true, false); +}