You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ac...@apache.org on 2017/07/12 08:33:45 UTC
[2/4] incubator-weex git commit: * [ios] add rotateX and rotateY unit
test case
* [ios] add rotateX and rotateY unit test case
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/18a1576f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/18a1576f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/18a1576f
Branch: refs/heads/0.15-dev
Commit: 18a1576fb716c8e811536a33b4e328116c027122
Parents: 46b5438
Author: acton393 <zh...@gmail.com>
Authored: Tue Jul 11 03:18:19 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Tue Jul 11 03:18:19 2017 +0800
----------------------------------------------------------------------
ios/sdk/WeexSDKTests/WXAnimationModuleTests.m | 29 ++++++++++++++++++++++
1 file changed, 29 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/18a1576f/ios/sdk/WeexSDKTests/WXAnimationModuleTests.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDKTests/WXAnimationModuleTests.m b/ios/sdk/WeexSDKTests/WXAnimationModuleTests.m
index b0bc67b..d2af216 100644
--- a/ios/sdk/WeexSDKTests/WXAnimationModuleTests.m
+++ b/ios/sdk/WeexSDKTests/WXAnimationModuleTests.m
@@ -55,6 +55,35 @@
XCTAssert(WXTransform3DApproximateToTransform(component.layer.transform, transformToVerify));
}
+- (void)testAnimationRotateZ {
+ WXComponent *component = [self component];
+ WXAnimationModule *object = [[WXAnimationModule alloc]init];
+ [object animation:component args:@{@"duration":@500, @"timingFunction":@"ease-in-out", @"styles":@{@"transform":@"rotateZ(90deg)"}} callback:nil];
+ [TestSupportUtils waitSecs:1];
+
+ CATransform3D transformToVerify = CATransform3DMakeRotation(M_PI/2, 0, 0, 1);
+ XCTAssert(WXTransform3DApproximateToTransform(component.layer.transform, transformToVerify));
+}
+
+- (void)testAnimationRotateY {
+ WXComponent *component = [self component];
+ WXAnimationModule *object = [[WXAnimationModule alloc]init];
+ [object animation:component args:@{@"duration":@500, @"timingFunction":@"ease-in-out", @"styles":@{@"transform":@"rotateY(90deg)"}} callback:nil];
+ [TestSupportUtils waitSecs:1];
+
+ CATransform3D transformToVerify = CATransform3DMakeRotation(M_PI/2, 0, 1, 0);
+ XCTAssert(WXTransform3DApproximateToTransform(component.layer.transform, transformToVerify));
+}
+- (void)testAnimationRotateX {
+ WXComponent *component = [self component];
+ WXAnimationModule *object = [[WXAnimationModule alloc]init];
+ [object animation:component args:@{@"duration":@500, @"timingFunction":@"ease-in-out", @"styles":@{@"transform":@"rotateX(90deg)"}} callback:nil];
+ [TestSupportUtils waitSecs:1];
+
+ CATransform3D transformToVerify = CATransform3DMakeRotation(M_PI/2, 1, 0, 0);
+ XCTAssert(WXTransform3DApproximateToTransform(component.layer.transform, transformToVerify));
+}
+
- (void)testAnimationTranslate {
WXComponent *component = [self component];
WXAnimationModule *object = [[WXAnimationModule alloc]init];