mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-19 04:39:36 +00:00
Make ASNetworkImageNode test wait (#2406)
This commit is contained in:
parent
ae9e128214
commit
925e343e32
@ -37,9 +37,18 @@
|
|||||||
- (void)testThatProgressBlockIsSetAndClearedCorrectlyOnVisibility
|
- (void)testThatProgressBlockIsSetAndClearedCorrectlyOnVisibility
|
||||||
{
|
{
|
||||||
node.URL = [NSURL URLWithString:@"http://imageA"];
|
node.URL = [NSURL URLWithString:@"http://imageA"];
|
||||||
|
|
||||||
|
// Enter preload range, wait for download start.
|
||||||
|
[[[downloader expect] andForwardToRealObject] downloadImageWithURL:[OCMArg isNotNil] callbackQueue:OCMOCK_ANY downloadProgress:OCMOCK_ANY completion:OCMOCK_ANY];
|
||||||
|
[node enterInterfaceState:ASInterfaceStatePreload];
|
||||||
|
[downloader verifyWithDelay:5];
|
||||||
|
|
||||||
|
// Make the node visible.
|
||||||
[[downloader expect] setProgressImageBlock:[OCMArg isNotNil] callbackQueue:OCMOCK_ANY withDownloadIdentifier:@0];
|
[[downloader expect] setProgressImageBlock:[OCMArg isNotNil] callbackQueue:OCMOCK_ANY withDownloadIdentifier:@0];
|
||||||
[node enterInterfaceState:ASInterfaceStateInHierarchy];
|
[node enterInterfaceState:ASInterfaceStateInHierarchy];
|
||||||
[downloader verify];
|
[downloader verify];
|
||||||
|
|
||||||
|
// Make the node invisible.
|
||||||
[[downloader expect] setProgressImageBlock:[OCMArg isNil] callbackQueue:OCMOCK_ANY withDownloadIdentifier:@0];
|
[[downloader expect] setProgressImageBlock:[OCMArg isNil] callbackQueue:OCMOCK_ANY withDownloadIdentifier:@0];
|
||||||
[node exitInterfaceState:ASInterfaceStateInHierarchy];
|
[node exitInterfaceState:ASInterfaceStateInHierarchy];
|
||||||
[downloader verify];
|
[downloader verify];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user