Revert "Call setEditingState when text changes. (#47177)" (#47397)

This reverts commit d4b49ce9fc.
This commit is contained in:
Lau Ching Jun
2019-12-18 18:03:24 -08:00
committed by GitHub
parent 2df964581f
commit d51956a9ea
5 changed files with 8 additions and 73 deletions

View File

@@ -39,18 +39,6 @@ class TestTextInput {
/// The messenger which sends the bytes for this channel, not null.
BinaryMessenger get _binaryMessenger => ServicesBinding.instance.defaultBinaryMessenger;
/// Resets any internal state of this object and calls [register].
///
/// This method is invoked by the testing framework between tests. It should
/// not ordinarily be called by tests directly.
void resetAndRegister() {
log.clear();
editingState = null;
setClientArgs = null;
_client = 0;
_isVisible = false;
register();
}
/// Installs this object as a mock handler for [SystemChannels.textInput].
void register() {
SystemChannels.textInput.setMockMethodCallHandler(_handleTextInputCall);
@@ -76,7 +64,6 @@ class TestTextInput {
/// Whether this [TestTextInput] is registered with [SystemChannels.textInput].
///
/// Use [register] and [unregister] methods to control this value.
// TODO(dnfield): This is unreliable. https://github.com/flutter/flutter/issues/47180
bool get isRegistered => _isRegistered;
bool _isRegistered = false;

View File

@@ -121,7 +121,6 @@ void testWidgets(
return binding.runTest(
() async {
debugResetSemanticsIdCounter();
tester.resetTestTextInput();
await callback(tester);
semanticsHandle?.dispose();
},
@@ -693,17 +692,6 @@ class WidgetTester extends WidgetController implements HitTestDispatcher, Ticker
/// like [TextField] or [TextFormField], call [enterText].
TestTextInput get testTextInput => binding.testTextInput;
/// Ensures that [testTextInput] is registered and [TestTextInput.log] is
/// reset.
///
/// This is called by the testing framework before test runs, so that if a
/// previous test has set its own handler on [SystemChannels.textInput], the
/// [testTextInput] regains control and the log is fresh for the new test.
/// It should not typically need to be called by tests.
void resetTestTextInput() {
testTextInput.resetAndRegister();
}
/// Give the text input widget specified by [finder] the focus, as if the
/// onscreen keyboard had appeared.
///