Skip to content

Commit

Permalink
* [ios] fix test running problem
Browse files Browse the repository at this point in the history
  • Loading branch information
cxfeng1 committed Dec 29, 2016
1 parent 70de8e2 commit 617c749
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions ios/sdk/WeexSDKTests/WXRootViewTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ - (void)testInstanceAndWeexRootFrame {
[instance1 renderView:jsScript options:nil data:nil];
XCTestExpectation *expectation1 = [self expectationWithDescription:@"instance 1"];
instance1.renderFinish = ^(UIView *view){
XCTAssert(CGRectEqualToRect(view.frame, instanceFrame));
XCTAssert(CGRectEqualToRect(view.subviews[0].frame, CGRectMake(0, 0, instanceFrame.size.width, instanceFrame.size.height)));
XCTAssert(WXRectApproximateToRect(view.frame, instanceFrame));
XCTAssert(WXRectApproximateToRect(view.subviews[0].frame, CGRectMake(0, 0, instanceFrame.size.width, instanceFrame.size.height)));
[expectation1 fulfill];
};

Expand All @@ -65,8 +65,8 @@ - (void)testInstanceAndWeexRootFrame {
[instance2 renderView:jsScript options:nil data:templateRootFrameData];
XCTestExpectation *expectation2 = [self expectationWithDescription:@"instance 2"];
instance2.renderFinish = ^(UIView *view){
XCTAssert(CGRectEqualToRect(view.frame, instanceFrame));
XCTAssert(CGRectEqualToRect(view.subviews[0].frame,
XCTAssert(WXRectApproximateToRect(view.frame, instanceFrame));
XCTAssert(WXRectApproximateToRect(view.subviews[0].frame,
CGRectMake(
WXPixelResize(templateRootFrame.origin.x),
WXPixelResize(templateRootFrame.origin.y),
Expand All @@ -83,11 +83,11 @@ - (void)testInstanceAndWeexRootFrame {
XCTestExpectation *expectation3 = [self expectationWithDescription:@"instance 3"];
XCTestExpectation *expectation31 = [self expectationWithDescription:@"instance 3 onLayoutChange"];
instance3.renderFinish = ^(UIView *view){
XCTAssert(CGRectEqualToRect(view.frame,
XCTAssert(WXRectApproximateToRect(view.frame,
CGRectMake(0,0,
WXPixelResize(templateRootFrame.size.width),
WXPixelResize(templateRootFrame.size.height))));
XCTAssert(CGRectEqualToRect(view.subviews[0].frame,
XCTAssert(WXRectApproximateToRect(view.subviews[0].frame,
CGRectMake(
WXPixelResize(templateRootFrame.origin.x),
WXPixelResize(templateRootFrame.origin.y),
Expand All @@ -101,7 +101,7 @@ - (void)testInstanceAndWeexRootFrame {

[instance3 refreshInstance:changedFrameData];
instance3.onLayoutChange = ^(UIView *view) {
XCTAssert(CGRectEqualToRect(view.frame,
XCTAssert(WXRectApproximateToRect(view.frame,
CGRectMake(0,0,
WXPixelResize(templateRootFrame.size.width),
WXPixelResize(400))));
Expand All @@ -115,9 +115,9 @@ - (void)testInstanceAndWeexRootFrame {
[instance4 renderView:jsScript options:nil data:nil];
XCTestExpectation *expectation4 = [self expectationWithDescription:@"instance 4"];
instance4.renderFinish = ^(UIView *view){
XCTAssert(CGRectEqualToRect(view.frame,
XCTAssert(WXRectApproximateToRect(view.frame,
CGRectMake(0,0,WXPixelResize(100),WXPixelResize(200))));
XCTAssert(CGRectEqualToRect(view.subviews[0].frame,
XCTAssert(WXRectApproximateToRect(view.subviews[0].frame,
CGRectMake(0,0,WXPixelResize(100),WXPixelResize(200))));
[expectation4 fulfill];
};
Expand Down
2 changes: 1 addition & 1 deletion ios/sdk/WeexSDKTests/WXStreamModuleTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ - (void)sendHttp:(NSDictionary*)options {
callbackResult = result;
[_exp fulfill];
}];
[self waitForExpectationsWithTimeout:10 handler:^(NSError * error) {
[self waitForExpectationsWithTimeout:20 handler:^(NSError * error) {
XCTAssertNotNil(callbackResult);
}];

Expand Down

0 comments on commit 617c749

Please sign in to comment.