@@ -61,54 +61,4 @@ - (void)testPlayVideo {
6161 }
6262}
6363
64- - (void )testEncryptedVideoStream {
65- // This is to fix a bug (https://github.com/flutter/flutter/issues/111457) in iOS 16 with blank
66- // video for encrypted video streams.
67-
68- NSString *tabName = @" Remote enc m3u8" ;
69-
70- NSPredicate *predicate = [NSPredicate predicateWithFormat: @" label BEGINSWITH %@" , tabName];
71- XCUIElement *unselectedTab = [self .app.staticTexts elementMatchingPredicate: predicate];
72- XCTAssertTrue ([unselectedTab waitForExistenceWithTimeout: 30.0 ]);
73- XCTAssertFalse (unselectedTab.isSelected );
74- [unselectedTab tap ];
75-
76- XCUIElement *selectedTab = [self .app.otherElements
77- elementMatchingPredicate: [NSPredicate predicateWithFormat: @" label BEGINSWITH %@" , tabName]];
78- XCTAssertTrue ([selectedTab waitForExistenceWithTimeout: 30.0 ]);
79- XCTAssertTrue (selectedTab.isSelected );
80-
81- // Wait until the video is loaded.
82- [NSThread sleepForTimeInterval: 60 ];
83-
84- NSMutableSet *frames = [NSMutableSet set ];
85- int numberOfFrames = 60 ;
86- for (int i = 0 ; i < numberOfFrames; i++) {
87- UIImage *image = self.app .screenshot .image ;
88-
89- // Plugin CI does not support attaching screenshot.
90- // Convert the image to base64 encoded string, and print it out for debugging purpose.
91- // NSLog truncates long strings, so need to scale downn image.
92- CGSize smallerSize = CGSizeMake (100 , 200 );
93- UIGraphicsBeginImageContextWithOptions (smallerSize, NO , 0.0 );
94- [image drawInRect: CGRectMake (0 , 0 , smallerSize.width, smallerSize.height)];
95- UIImage *smallerImage = UIGraphicsGetImageFromCurrentImageContext ();
96- UIGraphicsEndImageContext ();
97-
98- // 0.5 compression is good enough for debugging purpose.
99- NSData *imageData = UIImageJPEGRepresentation (smallerImage, 0.5 );
100- NSString *imageString = [imageData base64EncodedStringWithOptions: 0 ];
101- NSLog (@" frame %d image data:\n %@ " , i, imageString);
102-
103- [frames addObject: imageString];
104-
105- // The sample interval must NOT be the same as video length.
106- // Otherwise it would always result in the same frame.
107- [NSThread sleepForTimeInterval: 1 ];
108- }
109-
110- // At least 1 loading and 2 distinct frames (3 in total) to validate that the video is playing.
111- XCTAssert (frames.count >= 3 , @" Must have at least 3 distinct frames." );
112- }
113-
11464@end
0 commit comments