Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
GoldenPlatformViewTests.m
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
6
7#include <sys/sysctl.h>
9
10static const NSInteger kSecondsToWaitForPlatformView = 30;
11
12@interface GoldenPlatformViewTests ()
13
14@property(nonatomic, copy) NSString* goldenName;
15
16@property(nonatomic, strong) GoldenTestManager* manager;
17
18@end
19
20@implementation GoldenPlatformViewTests
21
22- (instancetype)initWithManager:(GoldenTestManager*)manager invocation:(NSInvocation*)invocation {
23 self = [super initWithInvocation:invocation];
24 _manager = manager;
25 _rmseThreadhold = kDefaultRmseThreshold;
26 return self;
27}
28
29- (void)setUp {
30 [super setUp];
31 self.continueAfterFailure = NO;
32
33 self.application = [[XCUIApplication alloc] init];
34 self.application.launchArguments = @[ self.manager.launchArg, @"--enable-software-rendering" ];
35 [self.application launch];
36}
37
38// Note: don't prefix with "test" or GoldenPlatformViewTests will run instead of the subclasses.
40 XCUIElement* element = self.application.textViews.firstMatch;
41 BOOL exists = [element waitForExistenceWithTimeout:kSecondsToWaitForPlatformView];
42 if (!exists) {
43 XCTFail(@"It took longer than %@ second to find the platform view."
44 @"There might be issues with the platform view's construction,"
45 @"or with how the scenario is built.",
47 }
48
49 [self.manager checkGoldenForTest:self rmesThreshold:self.rmseThreadhold];
50}
51@end
static const NSInteger kSecondsToWaitForPlatformView
const double kDefaultRmseThreshold
Definition copy.py:1
int BOOL