@@ -72,6 +72,10 @@ void main() {
72
72
connectionLog.add ('streamListen' );
73
73
return null ;
74
74
});
75
+ when (mockPeer.sendRequest ('setFlag' , any)).thenAnswer ((Invocation invocation) {
76
+ connectionLog.add ('setFlag' );
77
+ return null ;
78
+ });
75
79
when (mockIsolate.pauseEvent).thenReturn (MockVMPauseStartEvent ());
76
80
when (mockIsolate.resume ()).thenAnswer ((Invocation invocation) {
77
81
connectionLog.add ('resume' );
@@ -85,9 +89,26 @@ void main() {
85
89
final FlutterDriver driver = await FlutterDriver .connect (dartVmServiceUrl: '' );
86
90
expect (driver, isNotNull);
87
91
expectLogContains ('Isolate is paused at start' );
88
- expect (connectionLog, < String > ['resume' , 'streamListen' , 'onExtensionAdded' ]);
92
+ expect (connectionLog, < String > ['setFlag' , ' resume' , 'streamListen' , 'onExtensionAdded' ]);
89
93
});
90
94
95
+ test ('ignores setFlag failure' , () async {
96
+ when (mockPeer.sendRequest ('setFlag' , any)).thenThrow (Exception ('setFlag failed' ));
97
+ when (mockIsolate.pauseEvent).thenReturn (MockVMPauseStartEvent ());
98
+ when (mockIsolate.resume ()).thenAnswer ((Invocation invocation) {
99
+ return Future <dynamic >.value (null );
100
+ });
101
+ when (mockIsolate.onExtensionAdded).thenAnswer ((Invocation invocation) {
102
+ return Stream <String >.fromIterable (< String > ['ext.flutter.driver' ]);
103
+ });
104
+
105
+ final FlutterDriver driver = await FlutterDriver .connect (dartVmServiceUrl: '' );
106
+ expectLogContains ('Failed to set pause_isolates_on_start=false, proceeding. '
107
+ 'Error: Exception: setFlag failed' );
108
+ expect (driver, isNotNull);
109
+ });
110
+
111
+
91
112
test ('connects to isolate paused mid-flight' , () async {
92
113
when (mockIsolate.pauseEvent).thenReturn (MockVMPauseBreakpointEvent ());
93
114
when (mockIsolate.resume ()).thenAnswer ((Invocation invocation) => Future <dynamic >.value (null ));
0 commit comments