Skip to content

Commit 7722d1f

Browse files
AlbertWang0116Szymon Sobecki
authored and
Szymon Sobecki
committed
Remove run loop spin for search action.
The remote call for setting search action doesn't need to spin test runloop, because the remote execution doesn't require dispatching to other threads. But keeping runloop spinning would require adding a separate async API for Swift async/await. For simplicity, removing the runloop spinning and add comment. PiperOrigin-RevId: 569102794
1 parent 050886f commit 7722d1f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

TestLib/EarlGreyImpl/GREYElementInteractionProxy.m

+5-3
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,11 @@ - (void)assertWithMatcher:(id<GREYMatcher>)matcher
125125
onElementWithMatcher:(id<GREYMatcher>)matcher {
126126
GREYThrowOnNilParameterWithMessage(action, @"Action can't be nil.");
127127
GREYThrowOnNilParameterWithMessage(matcher, @"Matcher can't be nil.");
128-
GREYExecuteSyncBlockInBackgroundQueue(^{
129-
[self->_remoteElementInteraction usingSearchAction:action onElementWithMatcher:matcher];
130-
});
128+
// The remote interaction completes the whole execution within the target thread. If this is
129+
// changed at remote, the method call below should be wrapped with
130+
// `GREYExecuteSyncBlockInBackgroundQueue`, and a completion handler version of this API should be
131+
// provided for Swift async test.
132+
[self->_remoteElementInteraction usingSearchAction:action onElementWithMatcher:matcher];
131133
return self;
132134
}
133135

0 commit comments

Comments
 (0)