Skip to content

Commit

Permalink
Remove docs events test
Browse files Browse the repository at this point in the history
  • Loading branch information
vince-hz committed Oct 31, 2023
1 parent 7d102b7 commit 66faaa4
Showing 1 changed file with 53 additions and 52 deletions.
105 changes: 53 additions & 52 deletions Example/Tests/MultiViewsRoomTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -262,58 +262,59 @@ - (void)fireRoomStateChanged:(WhiteRoomState *)modifyState {
}

#pragma mark - DocsEvent
- (void)testDocsEvents
{
// 本测试和 UI 有关,所以这里等待的时间要长一些,避免因为机器性能导致测试失败。
XCTestExpectation *exp = [self expectationWithDescription:NSStringFromSelector(_cmd)];
__weak typeof(self.room) weakRoom = self.room;
[self.room addApp:testPptAppParam completionHandler:^(NSString * _Nonnull appId) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
WhiteWindowDocsEventOptions *ops = [[WhiteWindowDocsEventOptions alloc] init];
ops.page = @(1);
[weakRoom dispatchDocsEvent:WhiteWindowDocsEventJumpToPage options:ops completionHandler:^(bool success) {
XCTAssert(success, @"WhiteWindowDocsEventJumpPage Fail");
}];
});

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(10 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[weakRoom dispatchDocsEvent:WhiteWindowDocsEventNextPage options:nil completionHandler:^(bool success) {
XCTAssert(success, @"WhiteWindowDocsEventNextPage Fail");
}];
});

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(15 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[weakRoom dispatchDocsEvent:WhiteWindowDocsEventPrevPage options:nil completionHandler:^(bool success) {
XCTAssert(success, @"WhiteWindowDocsEventPrevPage Fail");
}];
});

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(20 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[weakRoom dispatchDocsEvent:WhiteWindowDocsEventNextStep options:nil completionHandler:^(bool success) {
XCTAssert(success, @"WhiteWindowDocsEventNextStep Fail");
}];
});

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(25 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[weakRoom dispatchDocsEvent:WhiteWindowDocsEventPrevStep options:nil completionHandler:^(bool success) {
XCTAssert(success, @"WhiteWindowDocsEventPrevStep Fail");
}];
});

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(30 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
if ([appId length] > 0) {
[weakRoom closeApp:appId completionHandler:^{
[exp fulfill];
}];
}
});
}];
[self waitForExpectationsWithTimeout:40 handler:^(NSError * _Nullable error) {
if (error) {
NSLog(@"%s error: %@", __FUNCTION__, error);
}
}];
}
// 删除该测试,因为该测试和 UI 过于密切,机器卡顿的时候测试过不去。
//- (void)testDocsEvents
//{
// // 本测试和 UI 有关,所以这里等待的时间要长一些,避免因为机器性能导致测试失败。
// XCTestExpectation *exp = [self expectationWithDescription:NSStringFromSelector(_cmd)];
// __weak typeof(self.room) weakRoom = self.room;
// [self.room addApp:testPptAppParam completionHandler:^(NSString * _Nonnull appId) {
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// WhiteWindowDocsEventOptions *ops = [[WhiteWindowDocsEventOptions alloc] init];
// ops.page = @(1);
// [weakRoom dispatchDocsEvent:WhiteWindowDocsEventJumpToPage options:ops completionHandler:^(bool success) {
// XCTAssert(success, @"WhiteWindowDocsEventJumpPage Fail");
// }];
// });
//
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(10 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// [weakRoom dispatchDocsEvent:WhiteWindowDocsEventNextPage options:nil completionHandler:^(bool success) {
// XCTAssert(success, @"WhiteWindowDocsEventNextPage Fail");
// }];
// });
//
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(15 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// [weakRoom dispatchDocsEvent:WhiteWindowDocsEventPrevPage options:nil completionHandler:^(bool success) {
// XCTAssert(success, @"WhiteWindowDocsEventPrevPage Fail");
// }];
// });
//
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(20 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// [weakRoom dispatchDocsEvent:WhiteWindowDocsEventNextStep options:nil completionHandler:^(bool success) {
// XCTAssert(success, @"WhiteWindowDocsEventNextStep Fail");
// }];
// });
//
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(25 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// [weakRoom dispatchDocsEvent:WhiteWindowDocsEventPrevStep options:nil completionHandler:^(bool success) {
// XCTAssert(success, @"WhiteWindowDocsEventPrevStep Fail");
// }];
// });
//
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(30 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// if ([appId length] > 0) {
// [weakRoom closeApp:appId completionHandler:^{
// [exp fulfill];
// }];
// }
// });
// }];
// [self waitForExpectationsWithTimeout:40 handler:^(NSError * _Nullable error) {
// if (error) {
// NSLog(@"%s error: %@", __FUNCTION__, error);
// }
// }];
//}

#pragma mark - App API
- (void)testQueryApp
Expand Down

0 comments on commit 66faaa4

Please sign in to comment.