Unverified Commit ee3e621f authored by Dan Field's avatar Dan Field Committed by GitHub

Remove timeout from add2app test for iOS (#28746)

parent 5e27ebbe
...@@ -6,16 +6,23 @@ interaction. ...@@ -6,16 +6,23 @@ interaction.
The following functionality is currently implemented: The following functionality is currently implemented:
1. A regular iOS view controller (UIViewController), similar to the default `flutter create` template. 1. A regular iOS view controller (UIViewController), similar to the default
1. A FlutterViewController subclass that takes over full screen. Demos showing this both from a cold/fresh engine state and a warm engine state. `flutter create` template (NativeViewController.m).
1. A FlutterViewController subclass that takes over full screen. Demos showing
this both from a cold/fresh engine state and a warm engine state
(FullScreenViewController.m).
1. A demo of pushing a FlutterViewController on as a child view. 1. A demo of pushing a FlutterViewController on as a child view.
1. A demo of showing both the native and the Flutter views using a platform channel to to interact with each other. 1. A demo of showing both the native and the Flutter views using a platform
1. A demo of showing two FlutterViewControllers simultaneously. channel to to interact with each other (HybridViewController.m).
1. A demo of showing two FlutterViewControllers simultaneously
(DualViewController.m).
A few key things are tested here: A few key things are tested here (IntegrationTests.m):
1. The ability to pre-warm the engine and attach/detatch a ViewController from it. 1. The ability to pre-warm the engine and attach/detatch a ViewController from
1. The ability to simultaneously run two instances of the engine. it.
1. The ability to use platform channels to communicate between views. 1. The ability to use platform channels to communicate between views.
1. That a FlutterViewController can be freed when no longer in use. 1. The ability to simultaneously run two instances of the engine.
1. That a FlutterViewController can be freed when no longer in use (also tested
from FlutterViewControllerTests.m).
1. That a FlutterEngine can be freed when no longer in use. 1. That a FlutterEngine can be freed when no longer in use.
\ No newline at end of file
...@@ -500,6 +500,7 @@ ...@@ -500,6 +500,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf; DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_BITCODE = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES; ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11; GCC_C_LANGUAGE_STANDARD = gnu11;
...@@ -559,6 +560,7 @@ ...@@ -559,6 +560,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_BITCODE = NO;
ENABLE_NS_ASSERTIONS = NO; ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11; GCC_C_LANGUAGE_STANDARD = gnu11;
......
...@@ -8,6 +8,9 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -8,6 +8,9 @@ NS_ASSUME_NONNULL_BEGIN
@interface DualFlutterViewController : UIViewController @interface DualFlutterViewController : UIViewController
@property (readonly, strong, nonatomic) FlutterViewController* topFlutterViewController;
@property (readonly, strong, nonatomic) FlutterViewController* bottomFlutterViewController;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
...@@ -23,19 +23,18 @@ ...@@ -23,19 +23,18 @@
stackView.layoutMarginsRelativeArrangement = YES; stackView.layoutMarginsRelativeArrangement = YES;
[self.view addSubview:stackView]; [self.view addSubview:stackView];
_topFlutterViewController = [[FlutterViewController alloc] init];
FlutterViewController* topFlutterViewController = [[FlutterViewController alloc] init]; _bottomFlutterViewController= [[FlutterViewController alloc] init];
FlutterViewController* bottomFlutterViewController= [[FlutterViewController alloc] init];
[_topFlutterViewController setInitialRoute:@"marquee_green"];
[topFlutterViewController setInitialRoute:@"marquee_green"]; [self addChildViewController:_topFlutterViewController];
[self addChildViewController:topFlutterViewController]; [stackView addArrangedSubview:_topFlutterViewController.view];
[stackView addArrangedSubview:topFlutterViewController.view]; [_topFlutterViewController didMoveToParentViewController:self];
[topFlutterViewController didMoveToParentViewController:self];
[_bottomFlutterViewController setInitialRoute:@"marquee_purple"];
[bottomFlutterViewController setInitialRoute:@"marquee_purple"]; [self addChildViewController:_bottomFlutterViewController];
[self addChildViewController:bottomFlutterViewController]; [stackView addArrangedSubview:_bottomFlutterViewController.view];
[stackView addArrangedSubview:bottomFlutterViewController.view]; [_bottomFlutterViewController didMoveToParentViewController:self];
[topFlutterViewController didMoveToParentViewController:self];
} }
@end @end
...@@ -10,6 +10,8 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -10,6 +10,8 @@ NS_ASSUME_NONNULL_BEGIN
@interface HybridViewController : UIViewController<NativeViewControllerDelegate> @interface HybridViewController : UIViewController<NativeViewControllerDelegate>
@property (readonly, strong, nonatomic) FlutterViewController* flutterViewController;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
...@@ -43,7 +43,7 @@ static NSString *_kPing = @"ping"; ...@@ -43,7 +43,7 @@ static NSString *_kPing = @"ping";
[stackView addArrangedSubview:nativeViewController.view]; [stackView addArrangedSubview:nativeViewController.view];
[nativeViewController didMoveToParentViewController:self]; [nativeViewController didMoveToParentViewController:self];
FlutterViewController *flutterViewController = _flutterViewController =
[[FlutterViewController alloc] initWithEngine:[self engine] [[FlutterViewController alloc] initWithEngine:[self engine]
nibName:nil nibName:nil
bundle:nil]; bundle:nil];
...@@ -51,11 +51,11 @@ static NSString *_kPing = @"ping"; ...@@ -51,11 +51,11 @@ static NSString *_kPing = @"ping";
_messageChannel = [[FlutterBasicMessageChannel alloc] _messageChannel = [[FlutterBasicMessageChannel alloc]
initWithName:_kChannel initWithName:_kChannel
binaryMessenger:flutterViewController binaryMessenger:_flutterViewController
codec:[FlutterStringCodec sharedInstance]]; codec:[FlutterStringCodec sharedInstance]];
[self addChildViewController:flutterViewController]; [self addChildViewController:_flutterViewController];
[stackView addArrangedSubview:flutterViewController.view]; [stackView addArrangedSubview:_flutterViewController.view];
[flutterViewController didMoveToParentViewController:self]; [_flutterViewController didMoveToParentViewController:self];
__weak NativeViewController *weakNativeViewController = nativeViewController; __weak NativeViewController *weakNativeViewController = nativeViewController;
[_messageChannel setMessageHandler:^(id message, FlutterReply reply) { [_messageChannel setMessageHandler:^(id message, FlutterReply reply) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment