Skip to content

Commit

Permalink
Revert "[file_selector_android] Attempt to close system dialogs befor…
Browse files Browse the repository at this point in the history
…e integration tests run (#5805)"

This reverts commit c6b86c5.

Touched to retrigger testing 2
  • Loading branch information
reidbaker committed Jan 12, 2024
1 parent d74d687 commit 47edd6a
Showing 1 changed file with 0 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import android.content.ClipData;
import android.content.Intent;
import android.net.Uri;
import androidx.test.core.app.ActivityScenario;
import androidx.test.espresso.intent.rule.IntentsRule;
import androidx.test.ext.junit.rules.ActivityScenarioRule;
import org.junit.Rule;
Expand All @@ -33,28 +32,12 @@ public class FileSelectorAndroidTest {

@Rule public IntentsRule intentsRule = new IntentsRule();

public void clearAnySystemDialog() {
myActivityTestRule
.getScenario()
.onActivity(
new ActivityScenario.ActivityAction<DriverExtensionActivity>() {
@Override
public void perform(DriverExtensionActivity activity) {
Intent closeDialog = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
activity.sendBroadcast(closeDialog);
}
});
}

@Test
public void openImageFile() {
clearAnySystemDialog();

final Instrumentation.ActivityResult result =
new Instrumentation.ActivityResult(
Activity.RESULT_OK,
new Intent().setData(Uri.parse("content://file_selector_android_test/dummy.png")));

intending(hasAction(Intent.ACTION_OPEN_DOCUMENT)).respondWith(result);
onFlutterWidget(withText("Open an image")).perform(click());
onFlutterWidget(withText("Press to open an image file(png, jpg)")).perform(click());
Expand All @@ -65,8 +48,6 @@ public void openImageFile() {

@Test
public void openImageFiles() {
clearAnySystemDialog();

final ClipData.Item clipDataItem =
new ClipData.Item(Uri.parse("content://file_selector_android_test/dummy.png"));
final ClipData clipData = new ClipData("", new String[0], clipDataItem);
Expand Down

0 comments on commit 47edd6a

Please sign in to comment.