@@ -666,6 +666,23 @@ void main() {
666
666
test ('VMServiceFlutterDriver does not support webDriver' , () async {
667
667
expect (() => driver.webDriver, throwsUnsupportedError);
668
668
});
669
+
670
+ group ('runUnsynchronized' , () {
671
+ test ('wrap waitFor with runUnsynchronized' , () async {
672
+ fakeClient.responses['waitFor' ] = makeFakeResponse (< String , dynamic > {});
673
+ fakeClient.responses['set_frame_sync' ] = makeFakeResponse (< String , dynamic > {});
674
+
675
+ await driver.runUnsynchronized (() async {
676
+ await driver.waitFor (find.byTooltip ('foo' ), timeout: _kTestTimeout);
677
+ });
678
+
679
+ expect (fakeClient.commandLog, < String > [
680
+ 'ext.flutter.driver {command: set_frame_sync, enabled: false}' ,
681
+ 'ext.flutter.driver {command: waitFor, timeout: $_kSerializedTestTimeout , finderType: ByTooltipMessage, text: foo}' ,
682
+ 'ext.flutter.driver {command: set_frame_sync, enabled: true}'
683
+ ]);
684
+ });
685
+ });
669
686
});
670
687
671
688
group ('VMServiceFlutterDriver with custom timeout' , () {
@@ -965,6 +982,23 @@ void main() {
965
982
expect (() => driver.serviceClient.getVM (), throwsUnsupportedError);
966
983
});
967
984
});
985
+
986
+ group ('runUnsynchronized' , () {
987
+ test ('wrap waitFor with runUnsynchronized' , () async {
988
+ fakeConnection.responses['waitFor' ] = jsonEncode (makeFakeResponse (< String , dynamic > {'text' : 'hello' }));
989
+ fakeConnection.responses['set_frame_sync' ] = jsonEncode (makeFakeResponse (< String , dynamic > {}));
990
+
991
+ await driver.runUnsynchronized (() async {
992
+ await driver.waitFor (find.byTooltip ('foo' ), timeout: _kTestTimeout);
993
+ });
994
+
995
+ expect (fakeConnection.commandLog, < String > [
996
+ r'''window.$flutterDriver('{"command":"set_frame_sync","enabled":"false"}') null''' ,
997
+ r'''window.$flutterDriver('{"command":"waitFor","timeout":"1234","finderType":"ByTooltipMessage","text":"foo"}') 0:00:01.234000''' ,
998
+ r'''window.$flutterDriver('{"command":"set_frame_sync","enabled":"true"}') null''' ,
999
+ ]);
1000
+ });
1001
+ });
968
1002
});
969
1003
970
1004
group ('WebFlutterDriver with non-chrome browser' , () {
0 commit comments