Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
2a6f1b73
Unverified
Commit
2a6f1b73
authored
Aug 15, 2019
by
Dan Field
Committed by
GitHub
Aug 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix up iOS Add to App tests (#38603)
parent
c55d2516
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
42 additions
and
40 deletions
+42
-40
.cirrus.yml
.cirrus.yml
+2
-0
build_and_test.sh
dev/integration_tests/ios_add2app/build_and_test.sh
+12
-1
project.pbxproj
...n_tests/ios_add2app/ios_add2app.xcodeproj/project.pbxproj
+15
-1
AppDelegate.h
dev/integration_tests/ios_add2app/ios_add2app/AppDelegate.h
+0
-1
AppDelegate.m
dev/integration_tests/ios_add2app/ios_add2app/AppDelegate.m
+1
-1
HybridViewController.m
...tion_tests/ios_add2app/ios_add2app/HybridViewController.m
+1
-1
FlutterViewControllerTests.m
...ios_add2app/ios_add2appTests/FlutterViewControllerTests.m
+1
-1
IntegrationTests.m
...ion_tests/ios_add2app/ios_add2appTests/IntegrationTests.m
+10
-34
No files found.
.cirrus.yml
View file @
2a6f1b73
...
...
@@ -534,6 +534,8 @@ task:
-
name
:
add2app-macos
env
:
SHARD
:
add2app_test
setup_xcpretty_script
:
-
sudo gem install xcpretty
test_all_script
:
-
ulimit -S -n 2048
# https://github.com/flutter/flutter/issues/2976
-
dart --enable-asserts dev/bots/test.dart
...
...
dev/integration_tests/ios_add2app/build_and_test.sh
View file @
2a6f1b73
...
...
@@ -10,4 +10,15 @@ popd
pod
install
os_version
=
$(
xcrun
--show-sdk-version
--sdk
iphonesimulator
)
xcodebuild
-workspace
ios_add2app.xcworkspace
-scheme
ios_add2appTests
-sdk
"iphonesimulator
$os_version
"
-destination
"OS=
$os_version
,name=iPhone X"
test
\ No newline at end of file
PRETTY
=
"cat"
if
which xcpretty
;
then
PRETTY
=
"xcpretty"
fi
set
-o
pipefail
&&
xcodebuild
\
-workspace
ios_add2app.xcworkspace
\
-scheme
ios_add2appTests
\
-sdk
"iphonesimulator
$os_version
"
\
-destination
"OS=
$os_version
,name=iPhone X"
test
|
$PRETTY
dev/integration_tests/ios_add2app/ios_add2app.xcodeproj/project.pbxproj
View file @
2a6f1b73
...
...
@@ -338,7 +338,7 @@
name
=
"[CP-User] Run Flutter Build Script"
;
runOnlyForDeploymentPostprocessing
=
0
;
shellPath
=
/bin/sh
;
shellScript
=
"set -e\nset -u\nsource \"${SRCROOT}/flutterapp/.ios/Flutter/flutter_export_environment.sh\"\n\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/xcode_backend.sh build
\n
"
;
shellScript
=
"set -e\nset -u\nsource \"${SRCROOT}/flutterapp/.ios/Flutter/flutter_export_environment.sh\"\n\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/xcode_backend.sh build"
;
};
DE5CDCD8B3565EAB9F38F455
/* [CP] Check Pods Manifest.lock */
=
{
isa
=
PBXShellScriptBuildPhase
;
...
...
@@ -502,8 +502,10 @@
"DEBUG=1"
,
"$(inherited)"
,
);
GCC_TREAT_WARNINGS_AS_ERRORS
=
YES
;
GCC_WARN_64_TO_32_BIT_CONVERSION
=
YES
;
GCC_WARN_ABOUT_RETURN_TYPE
=
YES_ERROR
;
GCC_WARN_PEDANTIC
=
YES
;
GCC_WARN_UNDECLARED_SELECTOR
=
YES
;
GCC_WARN_UNINITIALIZED_AUTOS
=
YES_AGGRESSIVE
;
GCC_WARN_UNUSED_FUNCTION
=
YES
;
...
...
@@ -513,6 +515,11 @@
MTL_FAST_MATH
=
YES
;
ONLY_ACTIVE_ARCH
=
YES
;
SDKROOT
=
iphoneos
;
WARNING_CFLAGS
=
"-Wno-gnu"
;
WARNING_LDFLAGS
=
(
"-Wall"
,
"-Werror"
,
);
};
name
=
Debug
;
};
...
...
@@ -556,8 +563,10 @@
ENABLE_STRICT_OBJC_MSGSEND
=
YES
;
GCC_C_LANGUAGE_STANDARD
=
gnu11
;
GCC_NO_COMMON_BLOCKS
=
YES
;
GCC_TREAT_WARNINGS_AS_ERRORS
=
YES
;
GCC_WARN_64_TO_32_BIT_CONVERSION
=
YES
;
GCC_WARN_ABOUT_RETURN_TYPE
=
YES_ERROR
;
GCC_WARN_PEDANTIC
=
YES
;
GCC_WARN_UNDECLARED_SELECTOR
=
YES
;
GCC_WARN_UNINITIALIZED_AUTOS
=
YES_AGGRESSIVE
;
GCC_WARN_UNUSED_FUNCTION
=
YES
;
...
...
@@ -567,6 +576,11 @@
MTL_FAST_MATH
=
YES
;
SDKROOT
=
iphoneos
;
VALIDATE_PRODUCT
=
YES
;
WARNING_CFLAGS
=
"-Wno-gnu"
;
WARNING_LDFLAGS
=
(
"-Wall"
,
"-Werror"
,
);
};
name
=
Release
;
};
...
...
dev/integration_tests/ios_add2app/ios_add2app/AppDelegate.h
View file @
2a6f1b73
...
...
@@ -8,7 +8,6 @@
@interface
AppDelegate
:
FlutterAppDelegate
@property
(
nonatomic
,
strong
)
FlutterEngine
*
engine
;
@property
(
nonatomic
,
strong
)
UIWindow
*
window
;
@property
(
nonatomic
,
strong
)
FlutterBasicMessageChannel
*
reloadMessageChannel
;
@end
dev/integration_tests/ios_add2app/ios_add2app/AppDelegate.m
View file @
2a6f1b73
...
...
@@ -41,7 +41,7 @@ static NSString *_kReloadChannelName = @"reload";
_reloadMessageChannel
=
[[
FlutterBasicMessageChannel
alloc
]
initWithName
:
_kReloadChannelName
binaryMessenger
:
_engine
binaryMessenger
:
_engine
.
binaryMessenger
codec
:
[
FlutterStringCodec
sharedInstance
]];
self
.
window
.
rootViewController
=
_navigationController
;
...
...
dev/integration_tests/ios_add2app/ios_add2app/HybridViewController.m
View file @
2a6f1b73
...
...
@@ -56,7 +56,7 @@ static NSString *_kPing = @"ping";
_messageChannel
=
[[
FlutterBasicMessageChannel
alloc
]
initWithName
:
_kChannel
binaryMessenger
:
_flutterViewController
binaryMessenger
:
_flutterViewController
.
binaryMessenger
codec
:
[
FlutterStringCodec
sharedInstance
]];
[
self
addChildViewController
:
_flutterViewController
];
[
stackView
addArrangedSubview
:
_flutterViewController
.
view
];
...
...
dev/integration_tests/ios_add2app/ios_add2appTests/FlutterViewControllerTests.m
View file @
2a6f1b73
...
...
@@ -21,7 +21,7 @@
[
viewController
viewWillAppear
:
NO
];
[
viewController
viewDidDisappear
:
NO
];
}
XCTAssertNil
(
weakEngine
);
XCTAssertNil
(
weakEngine
,
@"Engine failed to release."
);
}
@end
dev/integration_tests/ios_add2app/ios_add2appTests/IntegrationTests.m
View file @
2a6f1b73
...
...
@@ -11,36 +11,6 @@
#import "../ios_add2app/MainViewController.h"
#import "../ios_add2app/HybridViewController.h"
static
void
waitForFlutterSemanticsTree
(
FlutterViewController
*
viewController
)
{
int
tries
=
10
;
double
delay
=
1
.
0
;
// ensureSemanticsEnabled is a synchronous call, but only ensures that the
// semantics tree will be built on a subsequent frame (as opposed to being
// available at time it returns).
// To actually get the tree, we have to wait for the FlutterSemanticsUpdate
// notification, which lets us know that a semantics tree has been built;
// but we cannot block the main thread while waiting (so we use
// CFRunLoopRunInMode).
__block
BOOL
semanticsAvailable
=
NO
;
__block
id
<
NSObject
>
observer
=
[[
NSNotificationCenter
defaultCenter
]
addObserverForName
:
@"FlutterSemanticsUpdate"
object
:
viewController
queue:
nil
usingBlock:
^
(
NSNotification
*
notification
)
{
semanticsAvailable
=
YES
;
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
observer
];
}];
[
viewController
.
engine
ensureSemanticsEnabled
];
while
(
semanticsAvailable
==
NO
&&
tries
!=
0
)
{
CFRunLoopRunInMode
(
kCFRunLoopDefaultMode
,
delay
,
false
);
tries
--
;
[
viewController
.
engine
ensureSemanticsEnabled
];
}
GREYAssertTrue
(
semanticsAvailable
,
@"Semantics Tree did not build!"
);
}
@interface
FlutterTests
:
XCTestCase
@end
...
...
@@ -58,6 +28,12 @@ static void waitForFlutterSemanticsTree(FlutterViewController *viewController) {
return
self
;
}
-
(
void
)
expectSemanticsNotification
:
(
FlutterViewController
*
)
viewController
{
[
self
expectationForNotification
:
FlutterSemanticsUpdateNotification
object
:
viewController
handler
:
nil
];
[
viewController
.
engine
ensureSemanticsEnabled
];
[
self
waitForExpectationsWithTimeout
:
30
.
0
handler
:
nil
];
}
-
(
void
)
testFullScreenCanPop
{
[[
EarlGrey
selectElementWithMatcher
:
grey_keyWindow
()]
assertWithMatcher
:
grey_sufficientlyVisible
()];
...
...
@@ -74,7 +50,7 @@ static void waitForFlutterSemanticsTree(FlutterViewController *viewController) {
.
window
.
rootViewController
;
weakViewController
=
(
FullScreenViewController
*
)
navController
.
visibleViewController
;
waitForFlutterSemanticsTree
(
weakViewController
)
;
[
self
expectSemanticsNotification
:
weakViewController
]
;
GREYAssertNotNil
(
weakViewController
,
@"Expected non-nil FullScreenViewController."
);
}
...
...
@@ -112,8 +88,8 @@ static void waitForFlutterSemanticsTree(FlutterViewController *viewController) {
(
DualFlutterViewController
*
)
navController
.
visibleViewController
;
GREYAssertNotNil
(
viewController
,
@"Expected non-nil DualFlutterViewController."
);
waitForFlutterSemanticsTree
(
viewController
.
topFlutterViewController
)
;
waitForFlutterSemanticsTree
(
viewController
.
bottomFlutterViewController
)
;
[
self
expectSemanticsNotification
:
viewController
.
topFlutterViewController
]
;
[
self
expectSemanticsNotification
:
viewController
.
bottomFlutterViewController
]
;
}
// Verify that there are two Flutter views with the expected marquee text.
...
...
@@ -148,7 +124,7 @@ static void waitForFlutterSemanticsTree(FlutterViewController *viewController) {
(
HybridViewController
*
)
navController
.
visibleViewController
;
GREYAssertNotNil
(
viewController
.
flutterViewController
,
@"Expected non-nil FlutterViewController."
);
waitForFlutterSemanticsTree
(
viewController
.
flutterViewController
)
;
[
self
expectSemanticsNotification
:
viewController
.
flutterViewController
]
;
}
[
self
validateCountsFlutter
:
@"Platform"
count
:
0
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment