218 {
219 XCUIApplication*
app = [[XCUIApplication alloc] init];
220 app.launchArguments = @[ @"--platform-view-multiple-background-foreground" ];
221 [app launch];
222
223 XCUIElement* platform_view1 =
app.otherElements[@"platform_view[0]"];
224 XCTAssertTrue([platform_view1 waitForExistenceWithTimeout:1.0]);
225 XCTAssertEqual(platform_view1.frame.origin.x, 25);
226 XCTAssertEqual(platform_view1.frame.origin.y, 300);
227 XCTAssertEqual(platform_view1.frame.size.width, 250);
228 XCTAssertEqual(platform_view1.frame.size.height, 250);
229
230 XCUIElement* platform_view2 =
app.otherElements[@"platform_view[1]"];
231 XCTAssertTrue(platform_view2.exists);
232 XCTAssertEqual(platform_view2.frame.origin.x, 25);
233 XCTAssertEqual(platform_view2.frame.origin.y, 0);
234 XCTAssertEqual(platform_view2.frame.size.width, 250);
235 XCTAssertEqual(platform_view2.frame.size.height, 250);
236
237 XCUIElement* overlay1 =
app.otherElements[@"platform_view[0].overlay[0]"];
238 XCTAssertTrue(overlay1.exists);
239 XCTAssertEqual(overlay1.frame.origin.x, 25);
240 XCTAssertEqual(overlay1.frame.origin.y, 300);
241 XCTAssertEqual(overlay1.frame.size.width, 225);
242 XCTAssertEqual(overlay1.frame.size.height, 200);
243
244 XCUIElement* overlay2 =
app.otherElements[@"platform_view[1].overlay[0]"];
245 XCTAssertTrue(overlay2.exists);
246 XCTAssertEqual(overlay2.frame.origin.x, 25);
247 XCTAssertEqual(overlay2.frame.origin.y, 0);
248 XCTAssertEqual(overlay2.frame.size.width, 225);
249 XCTAssertEqual(overlay2.frame.size.height, 250);
250
251 XCUIElement* overlayView0 =
app.otherElements[@"platform_view[0].overlay_view[0]"];
252 XCTAssertTrue(overlayView0.exists);
253
254 XCTAssertEqualWithAccuracy(overlayView0.frame.origin.x,
app.frame.origin.x,
kCompareAccuracy);
255 XCTAssertEqualWithAccuracy(overlayView0.frame.origin.y,
app.frame.origin.x,
kCompareAccuracy);
256 XCTAssertEqualWithAccuracy(overlayView0.frame.size.width,
app.frame.size.width,
kCompareAccuracy);
257 XCTAssertEqualWithAccuracy(overlayView0.frame.size.height,
app.frame.size.height,
259
260 XCUIElement* overlayView1 =
app.otherElements[@"platform_view[1].overlay_view[0]"];
261 XCTAssertTrue(overlayView1.exists);
262
263 XCTAssertEqualWithAccuracy(overlayView1.frame.origin.x,
app.frame.origin.x,
kCompareAccuracy);
264 XCTAssertEqualWithAccuracy(overlayView1.frame.origin.y,
app.frame.origin.x,
kCompareAccuracy);
265 XCTAssertEqualWithAccuracy(overlayView1.frame.size.width,
app.frame.size.width,
kCompareAccuracy);
266 XCTAssertEqualWithAccuracy(overlayView1.frame.size.height,
app.frame.size.height,
268}