This repository was archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Fix webview_flutter Android integration tests and add Espresso #4147
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
18e6d22
lets see if integration tests run
bparrishMines 2025b84
change folder name
bparrishMines ddf5d91
create a running test with ./gradlew app:connectedAndroidTest -Ptarge…
bparrishMines 562cc4d
see if tests run on ci?.
bparrishMines cad641b
fix a few tests
bparrishMines b94cfbb
try get all tests passing
bparrishMines 744c395
fluttertestrunner and placeholder test
bparrishMines 6d9f282
formatting
bparrishMines e5ea80c
fix blank test, formatting, license
bparrishMines 2489c44
undo formatting change and remove navigation delegate
bparrishMines 76d612e
Improve example test and version bump test dependencies
bparrishMines dc6be9a
remove assertequals
bparrishMines 8713690
small format changes
bparrishMines 648e94c
license
bparrishMines 3619762
remove truth dependency, change core dep and follow example
bparrishMines ffe0058
undo the test change
bparrishMines f624087
Merge branch 'master' of github.com:flutter/plugins into androidTest
bparrishMines a10bfde
readd analysisoptions
bparrishMines 42b7238
remove top line
bparrishMines 927b9fe
empty commit to check for flakes
bparrishMines 089fa76
skip tests
bparrishMines 77b45f1
Merge branch 'master' of github.com:flutter/plugins into androidTest
bparrishMines 7e73bb1
remove webview_flutter
bparrishMines 79d82c4
Merge branch 'master' of github.com:flutter/plugins into androidTest
bparrishMines d34c705
Merge branch 'master' into androidTest
bparrishMines File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
...ndroid/app/src/androidTest/java/io/flutter/plugins/webviewflutterexample/WebViewTest.java
This file contains hidden or 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.webviewflutterexample; | ||
|
||
import static org.junit.Assert.assertTrue; | ||
|
||
import androidx.test.core.app.ActivityScenario; | ||
import io.flutter.plugins.webviewflutter.WebViewFlutterPlugin; | ||
import org.junit.Test; | ||
|
||
public class WebViewTest { | ||
@Test | ||
public void webViewPluginIsAdded() { | ||
final ActivityScenario<WebViewTestActivity> scenario = | ||
ActivityScenario.launch(WebViewTestActivity.class); | ||
scenario.onActivity( | ||
activity -> { | ||
assertTrue(activity.engine.getPlugins().has(WebViewFlutterPlugin.class)); | ||
}); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
packages/webview_flutter/webview_flutter/example/android/app/src/debug/AndroidManifest.xml
This file contains hidden or 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.webviewflutterexample"> | ||
<!-- Flutter needs it 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=".WebViewTestActivity" | ||
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> |
2 changes: 2 additions & 0 deletions
2
packages/webview_flutter/webview_flutter/example/android/app/src/main/AndroidManifest.xml
This file contains hidden or 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
20 changes: 20 additions & 0 deletions
20
...droid/app/src/main/java/io/flutter/plugins/webviewflutterexample/WebViewTestActivity.java
This file contains hidden or 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.webviewflutterexample; | ||
|
||
import androidx.annotation.NonNull; | ||
import io.flutter.embedding.android.FlutterActivity; | ||
import io.flutter.embedding.engine.FlutterEngine; | ||
|
||
// Extends FlutterActivity to make the FlutterEngine accessible for testing. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what about: |
||
public class WebViewTestActivity extends FlutterActivity { | ||
public FlutterEngine engine; | ||
|
||
@Override | ||
public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) { | ||
super.configureFlutterEngine(flutterEngine); | ||
engine = flutterEngine; | ||
} | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"needs internet permission to"