mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-25 17:43:18 +00:00
Wait to begin thrashing until we have completed reloading the data so we aren't trying to do both operations concurrently.
This commit is contained in:
parent
8c72118e69
commit
3da7305abb
@ -151,8 +151,19 @@
|
|||||||
|
|
||||||
tableView.asyncDelegate = dataSource;
|
tableView.asyncDelegate = dataSource;
|
||||||
tableView.asyncDataSource = dataSource;
|
tableView.asyncDataSource = dataSource;
|
||||||
|
|
||||||
|
XCTestExpectation *reloadDataExpectation = [self expectationWithDescription:@"reloadData"];
|
||||||
|
|
||||||
[tableView reloadData];
|
[tableView reloadDataWithCompletion:^{
|
||||||
|
NSLog(@"*** Reload Complete ***");
|
||||||
|
[reloadDataExpectation fulfill];
|
||||||
|
}];
|
||||||
|
|
||||||
|
[self waitForExpectationsWithTimeout:5 handler:^(NSError *error) {
|
||||||
|
if (error) {
|
||||||
|
XCTFail(@"Expectation failed: %@", error);
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
|
||||||
for (int i = 0; i < NumberOfReloadIterations; ++i) {
|
for (int i = 0; i < NumberOfReloadIterations; ++i) {
|
||||||
UITableViewRowAnimation rowAnimation = (arc4random_uniform(2) == 0 ? UITableViewRowAnimationMiddle : UITableViewRowAnimationNone);
|
UITableViewRowAnimation rowAnimation = (arc4random_uniform(2) == 0 ? UITableViewRowAnimationMiddle : UITableViewRowAnimationNone);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user