Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 5bd7351

Browse files
committed
take random itnerval of 1-2 seconds instead of a fixed interval of 1 second
1 parent edb7be7 commit 5bd7351

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/video_player/video_player_avfoundation/example/ios/RunnerUITests/VideoPlayerUITests.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ - (void)testEncryptedVideoStream {
8585
for (int i = 0; i < numberOfFrames; i++) {
8686
UIImage *image = self.app.screenshot.image;
8787
[frames addObject:UIImagePNGRepresentation(image)];
88-
[NSThread sleepForTimeInterval:1];
88+
// Take random interval between [1, 2) seconds, since the video length could be the same as a
89+
// fixed interval, which would always result in the same frame.
90+
NSTimeInterval sampleInterval = 1 + ((double)arc4random() / UINT32_MAX);
91+
[NSThread sleepForTimeInterval:sampleInterval];
8992
}
9093

9194
// At least 1 loading and 2 distinct frames (3 in total) to validate that the video is playing.

0 commit comments

Comments
 (0)