Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Revert "[file_selector_android] Attempt to close system dialogs befor…
…e integration tests run (#5805)"

This reverts commit c6b86c5.

Touched to retrigger testing 3
  • Loading branch information
reidbaker committed Jan 12, 2024
commit efe43db5a9074bd6fe192074fab0b12761ea87ff
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