Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Instance Methods | Properties | List of all members
LocalizationInitializationTest Class Reference
Inheritance diagram for LocalizationInitializationTest:

Instance Methods

(void) - setUp [implementation]
 
(void) - testNoLocalePrepend [implementation]
 

Properties

XCUIApplication * application
 

Detailed Description

Definition at line 10 of file LocalizationInitializationTest.m.

Method Documentation

◆ setUp

- (void) setUp
implementation

Definition at line 11 of file LocalizationInitializationTest.m.

16 {
17 [super setUp];
18 self.continueAfterFailure = NO;
19
20 self.application = [[XCUIApplication alloc] init];
21 self.application.launchArguments = @[ @"--locale-initialization" ];
22 [self.application launch];
23}

◆ testNoLocalePrepend

- (void) testNoLocalePrepend
implementation

Definition at line 11 of file LocalizationInitializationTest.m.

25 {
26 NSTimeInterval timeout = 10.0;
27
28 // The locales received by dart:ui are exposed onBeginFrame via semantics label.
29 // There should only be one locale. The list should consist of the default
30 // locale provided by the iOS app.
31 NSArray<NSString*>* preferredLocales = [NSLocale preferredLanguages];
32 XCTAssertEqual(preferredLocales.count, 1);
33 // Dart connects the locale parts with `_` while iOS connects them with `-`.
34 // Converts to dart format before comparing.
35 NSString* localeDart = [preferredLocales.firstObject stringByReplacingOccurrencesOfString:@"-"
36 withString:@"_"];
37 NSString* expectedIdentifier = [NSString stringWithFormat:@"[%@]", localeDart];
38 XCUIElement* textInputSemanticsObject =
39 [self.application.textFields matchingIdentifier:expectedIdentifier].element;
40 XCTAssertTrue([textInputSemanticsObject waitForExistenceWithTimeout:timeout]);
41
42 [textInputSemanticsObject tap];
43}
timeout(deadline, cmd)

Property Documentation

◆ application

- (XCUIApplication*) application
readwritenonatomicstrong

Definition at line 11 of file LocalizationInitializationTest.m.


The documentation for this class was generated from the following file: