forked from flutter/plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds test harnesses for integration tests on Android (flutter#4200)
- Loading branch information
1 parent
c8b1d96
commit 97fa266
Showing
27 changed files
with
262 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...android/app/src/androidTest/java/io/flutter/plugins/googlemapsexample/GoogleMapsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright 2013 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 io.flutter.plugins.googlemapsexample; | ||
|
||
import static org.junit.Assert.assertTrue; | ||
|
||
import androidx.test.core.app.ActivityScenario; | ||
import io.flutter.plugins.googlemaps.GoogleMapsPlugin; | ||
import org.junit.Test; | ||
|
||
public class GoogleMapsTest { | ||
@Test | ||
public void googleMapsPluginIsAdded() { | ||
final ActivityScenario<GoogleMapsTestActivity> scenario = | ||
ActivityScenario.launch(GoogleMapsTestActivity.class); | ||
scenario.onActivity( | ||
activity -> { | ||
assertTrue(activity.engine.getPlugins().has(GoogleMapsPlugin.class)); | ||
}); | ||
} | ||
} |
File renamed without changes.
17 changes: 17 additions & 0 deletions
17
...google_maps_flutter/google_maps_flutter/example/android/app/src/debug/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="io.flutter.plugins.googlemapsexample"> | ||
<!-- Flutter needs internet permission to communicate with the running application | ||
to allow setting breakpoints, to provide hot reload, etc. | ||
--> | ||
<uses-permission android:name="android.permission.INTERNET"/> | ||
<application android:usesCleartextTraffic="true"> | ||
<activity | ||
android:name=".GoogleMapsTestActivity" | ||
android:launchMode="singleTop" | ||
android:theme="@style/LaunchTheme" | ||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" | ||
android:hardwareAccelerated="true" | ||
android:windowSoftInputMode="adjustResize"> | ||
</activity> | ||
</application> | ||
</manifest> |
20 changes: 20 additions & 0 deletions
20
...droid/app/src/debug/java/io/flutter/plugins/googlemapsexample/GoogleMapsTestActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2013 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 io.flutter.plugins.googlemapsexample; | ||
|
||
import androidx.annotation.NonNull; | ||
import io.flutter.embedding.android.FlutterActivity; | ||
import io.flutter.embedding.engine.FlutterEngine; | ||
|
||
// Makes the FlutterEngine accessible for testing. | ||
public class GoogleMapsTestActivity extends FlutterActivity { | ||
public FlutterEngine engine; | ||
|
||
@Override | ||
public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) { | ||
super.configureFlutterEngine(flutterEngine); | ||
engine = flutterEngine; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
23 changes: 23 additions & 0 deletions
23
...oid/app/src/androidTest/java/io/flutter/plugins/googlesigninexample/GoogleSignInTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright 2013 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 io.flutter.plugins.googlesigninexample; | ||
|
||
import static org.junit.Assert.assertTrue; | ||
|
||
import androidx.test.core.app.ActivityScenario; | ||
import io.flutter.plugins.googlesignin.GoogleSignInPlugin; | ||
import org.junit.Test; | ||
|
||
public class GoogleSignInTest { | ||
@Test | ||
public void googleSignInPluginIsAdded() { | ||
final ActivityScenario<GoogleSignInTestActivity> scenario = | ||
ActivityScenario.launch(GoogleSignInTestActivity.class); | ||
scenario.onActivity( | ||
activity -> { | ||
assertTrue(activity.engine.getPlugins().has(GoogleSignInPlugin.class)); | ||
}); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
packages/google_sign_in/google_sign_in/example/android/app/src/debug/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="io.flutter.plugins.googlesigninexample"> | ||
<!-- Flutter needs internet permission to communicate with the running application | ||
to allow setting breakpoints, to provide hot reload, etc. | ||
--> | ||
<uses-permission android:name="android.permission.INTERNET"/> | ||
<application android:usesCleartextTraffic="true"> | ||
<activity | ||
android:name=".GoogleSignInTestActivity" | ||
android:launchMode="singleTop" | ||
android:theme="@android:style/Theme.Black.NoTitleBar" | ||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" | ||
android:hardwareAccelerated="true" | ||
android:windowSoftInputMode="adjustResize"> | ||
</activity> | ||
</application> | ||
</manifest> |
20 changes: 20 additions & 0 deletions
20
...id/app/src/main/java/io/flutter/plugins/googlesigninexample/GoogleSignInTestActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2013 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 io.flutter.plugins.googlesigninexample; | ||
|
||
import androidx.annotation.NonNull; | ||
import io.flutter.embedding.android.FlutterActivity; | ||
import io.flutter.embedding.engine.FlutterEngine; | ||
|
||
// Makes the FlutterEngine accessible for testing. | ||
public class GoogleSignInTestActivity extends FlutterActivity { | ||
public FlutterEngine engine; | ||
|
||
@Override | ||
public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) { | ||
super.configureFlutterEngine(flutterEngine); | ||
engine = flutterEngine; | ||
} | ||
} |
1 change: 0 additions & 1 deletion
1
...n/example/android/app/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
23 changes: 23 additions & 0 deletions
23
...droid/app/src/androidTest/java/io/flutter/plugins/imagepickerexample/ImagePickerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright 2013 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 io.flutter.plugins.imagepickerexample; | ||
|
||
import static org.junit.Assert.assertTrue; | ||
|
||
import androidx.test.core.app.ActivityScenario; | ||
import io.flutter.plugins.imagepicker.ImagePickerPlugin; | ||
import org.junit.Test; | ||
|
||
public class ImagePickerTest { | ||
@Test | ||
public void imagePickerPluginIsAdded() { | ||
final ActivityScenario<ImagePickerTestActivity> scenario = | ||
ActivityScenario.launch(ImagePickerTestActivity.class); | ||
scenario.onActivity( | ||
activity -> { | ||
assertTrue(activity.engine.getPlugins().has(ImagePickerPlugin.class)); | ||
}); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
packages/image_picker/image_picker/example/android/app/src/debug/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="io.flutter.plugins.imagepickerexample"> | ||
<!-- Flutter needs internet permission to communicate with the running application | ||
to allow setting breakpoints, to provide hot reload, etc. | ||
--> | ||
<uses-permission android:name="android.permission.INTERNET"/> | ||
<application android:usesCleartextTraffic="true"> | ||
<activity | ||
android:name=".ImagePickerTestActivity" | ||
android:launchMode="singleTop" | ||
android:theme="@android:style/Theme.Black.NoTitleBar" | ||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" | ||
android:hardwareAccelerated="true" | ||
android:windowSoftInputMode="adjustResize"> | ||
</activity> | ||
</application> | ||
</manifest> |
20 changes: 20 additions & 0 deletions
20
...roid/app/src/main/java/io/flutter/plugins/imagepickerexample/ImagePickerTestActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2013 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 io.flutter.plugins.imagepickerexample; | ||
|
||
import androidx.annotation.NonNull; | ||
import io.flutter.embedding.android.FlutterActivity; | ||
import io.flutter.embedding.engine.FlutterEngine; | ||
|
||
// Makes the FlutterEngine accessible for testing. | ||
public class ImagePickerTestActivity extends FlutterActivity { | ||
public FlutterEngine engine; | ||
|
||
@Override | ||
public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) { | ||
super.configureFlutterEngine(flutterEngine); | ||
engine = flutterEngine; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
23 changes: 23 additions & 0 deletions
23
...oid/app/src/androidTest/java/io/flutter/plugins/quickactionsexample/QuickActionsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright 2013 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 io.flutter.plugins.quickactionsexample; | ||
|
||
import static org.junit.Assert.assertTrue; | ||
|
||
import androidx.test.core.app.ActivityScenario; | ||
import io.flutter.plugins.quickactions.QuickActionsPlugin; | ||
import org.junit.Test; | ||
|
||
public class QuickActionsTest { | ||
@Test | ||
public void imagePickerPluginIsAdded() { | ||
final ActivityScenario<QuickActionsTestActivity> scenario = | ||
ActivityScenario.launch(QuickActionsTestActivity.class); | ||
scenario.onActivity( | ||
activity -> { | ||
assertTrue(activity.engine.getPlugins().has(QuickActionsPlugin.class)); | ||
}); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
packages/quick_actions/quick_actions/example/android/app/src/debug/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="io.flutter.plugins.quickactionsexample"> | ||
<!-- Flutter needs internet permission to communicate with the running application | ||
to allow setting breakpoints, to provide hot reload, etc. | ||
--> | ||
<uses-permission android:name="android.permission.INTERNET"/> | ||
<application android:usesCleartextTraffic="true"> | ||
<activity | ||
android:name=".QuickActionsTestActivity" | ||
android:launchMode="singleTop" | ||
android:theme="@style/LaunchTheme" | ||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" | ||
android:hardwareAccelerated="true" | ||
android:windowSoftInputMode="adjustResize"> | ||
</activity> | ||
</application> | ||
</manifest> |
20 changes: 20 additions & 0 deletions
20
...id/app/src/main/java/io/flutter/plugins/quickactionsexample/QuickActionsTestActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2013 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 io.flutter.plugins.quickactionsexample; | ||
|
||
import androidx.annotation.NonNull; | ||
import io.flutter.embedding.android.FlutterActivity; | ||
import io.flutter.embedding.engine.FlutterEngine; | ||
|
||
// Makes the FlutterEngine accessible for testing. | ||
public class QuickActionsTestActivity extends FlutterActivity { | ||
public FlutterEngine engine; | ||
|
||
@Override | ||
public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) { | ||
super.configureFlutterEngine(flutterEngine); | ||
engine = flutterEngine; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters