forked from flutter/engine
-
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.
Reply to accessibility method call even if semantics is not enabled (f…
- Loading branch information
Showing
3 changed files
with
39 additions
and
1 deletion.
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
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
33 changes: 33 additions & 0 deletions
33
...orm/android/test/io/flutter/embedding/engine/systemchannels/AccessibilityChannelTest.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,33 @@ | ||
package io.flutter.embedding.engine.systemchannels; | ||
|
||
import static org.mockito.Mockito.mock; | ||
import static org.mockito.Mockito.verify; | ||
|
||
import android.annotation.TargetApi; | ||
import io.flutter.embedding.engine.FlutterJNI; | ||
import io.flutter.embedding.engine.dart.DartExecutor; | ||
import io.flutter.plugin.common.BasicMessageChannel; | ||
import org.json.JSONException; | ||
import org.json.JSONObject; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.robolectric.RobolectricTestRunner; | ||
import org.robolectric.annotation.Config; | ||
|
||
@Config( | ||
manifest = Config.NONE, | ||
shadows = {}) | ||
@RunWith(RobolectricTestRunner.class) | ||
@TargetApi(24) | ||
public class AccessibilityChannelTest { | ||
@Test | ||
public void repliesWhenNoAccessibilityHandler() throws JSONException { | ||
AccessibilityChannel accessibilityChannel = | ||
new AccessibilityChannel(mock(DartExecutor.class), mock(FlutterJNI.class)); | ||
JSONObject arguments = new JSONObject(); | ||
arguments.put("type", "announce"); | ||
BasicMessageChannel.Reply reply = mock(BasicMessageChannel.Reply.class); | ||
accessibilityChannel.parsingMessageHandler.onMessage(arguments, reply); | ||
verify(reply).reply(null); | ||
} | ||
} |