Flutter Engine
LocalizationInitializationTest.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 
5 #import <Flutter/Flutter.h>
6 #import <XCTest/XCTest.h>
7 
9 
10 @interface LocalizationInitializationTest : XCTestCase
11 @property(nonatomic, strong) XCUIApplication* application;
12 @end
13 
14 @implementation LocalizationInitializationTest
15 
16 - (void)setUp {
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 }
24 
25 - (void)testNoLocalePrepend {
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, since the default iOS app only has en_US as
30  // the locale. The list should consist of just the en locale.
31  XCUIElement* textInputSemanticsObject =
32  [self.application.textFields matchingIdentifier:@"[en]"].element;
33  XCTAssertTrue([textInputSemanticsObject waitForExistenceWithTimeout:timeout]);
34 
35  [textInputSemanticsObject tap];
36 }
37 
38 @end
#define FLUTTER_ASSERT_ARC
Definition: FlutterMacros.h:44