Skip to content

Commit a56af86

Browse files
Remove runloop spinner for other interaction setter APIs.
runloop spinner APIs are not compatible with Swift async tests, Runloop spinner is also not necessary for setter APIs because there is no thread safety issue. Removing them for now instead of creating async API version for these APIs. PiperOrigin-RevId: 570588092
1 parent 8dd5438 commit a56af86

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

TestLib/EarlGreyImpl/GREYElementInteractionProxy.m

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,11 @@ - (void)assertWithMatcher:(id<GREYMatcher>)matcher
115115

116116
- (id<GREYInteraction>)inRoot:(id<GREYMatcher>)rootMatcher {
117117
GREYThrowOnNilParameterWithMessage(rootMatcher, @"Root Matcher can't be nil.");
118-
GREYExecuteSyncBlockInBackgroundQueue(^{
119-
[self->_remoteElementInteraction inRoot:rootMatcher];
120-
});
118+
// The remote interaction completes the whole execution within the target thread. If this is
119+
// changed at remote, the method call below should be wrapped with
120+
// `GREYExecuteSyncBlockInBackgroundQueue`, and a completion handler version of this API should be
121+
// provided for Swift async test.
122+
[self->_remoteElementInteraction inRoot:rootMatcher];
121123
return self;
122124
}
123125

@@ -134,16 +136,20 @@ - (void)assertWithMatcher:(id<GREYMatcher>)matcher
134136
}
135137

136138
- (id<GREYInteraction>)atIndex:(NSUInteger)index {
137-
GREYExecuteSyncBlockInBackgroundQueue(^{
138-
[self->_remoteElementInteraction atIndex:index];
139-
});
139+
// The remote interaction completes the whole execution within the target thread. If this is
140+
// changed at remote, the method call below should be wrapped with
141+
// `GREYExecuteSyncBlockInBackgroundQueue`, and a completion handler version of this API should be
142+
// provided for Swift async test.
143+
[self->_remoteElementInteraction atIndex:index];
140144
return self;
141145
}
142146

143147
- (id<GREYInteraction>)includeStatusBar {
144-
GREYExecuteSyncBlockInBackgroundQueue(^{
145-
[self->_remoteElementInteraction includeStatusBar];
146-
});
148+
// The remote interaction completes the whole execution within the target thread. If this is
149+
// changed at remote, the method call below should be wrapped with
150+
// `GREYExecuteSyncBlockInBackgroundQueue`, and a completion handler version of this API should be
151+
// provided for Swift async test.
152+
[self->_remoteElementInteraction includeStatusBar];
147153
return self;
148154
}
149155

0 commit comments

Comments
 (0)