mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Merged branch 'master' into AVPlayerItem-construction
This commit is contained in:
@@ -8,7 +8,8 @@
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <XCTest/XCTest.h>
|
||||
#import "ASVideoNode.h"
|
||||
#import <AVFoundation/AVFoundation.h>
|
||||
#import <AsyncDisplayKit/AsyncDisplayKit.h>
|
||||
|
||||
@interface ASVideoNodeTests : XCTestCase
|
||||
{
|
||||
@@ -21,6 +22,7 @@
|
||||
|
||||
@interface ASVideoNode () {
|
||||
ASDisplayNode *_playerNode;
|
||||
AVPlayer *_player;
|
||||
}
|
||||
@property (atomic) ASInterfaceState interfaceState;
|
||||
@property (atomic) ASDisplayNode *spinner;
|
||||
@@ -37,6 +39,11 @@
|
||||
_playerNode = playerNode;
|
||||
}
|
||||
|
||||
- (void)setPlayer:(AVPlayer *)player
|
||||
{
|
||||
_player = player;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation ASVideoNodeTests
|
||||
@@ -189,7 +196,7 @@
|
||||
- (void)doPlayerLayerNodeIsNotAddedIfVisibleButShouldNotBePlaying
|
||||
{
|
||||
[_videoNode pause];
|
||||
[_videoNode setInterfaceState:ASInterfaceStateVisible];
|
||||
[_videoNode setInterfaceState:ASInterfaceStateVisible | ASInterfaceStateDisplay];
|
||||
[_videoNode didLoad];
|
||||
|
||||
XCTAssert(![_videoNode.subnodes containsObject:_videoNode.playerNode]);
|
||||
@@ -268,4 +275,23 @@
|
||||
XCTAssertTrue(_videoNode.shouldBePlaying);
|
||||
}
|
||||
|
||||
- (void)testMutingShouldMutePlayer
|
||||
{
|
||||
[_videoNode setPlayer:[[AVPlayer alloc] init]];
|
||||
|
||||
_videoNode.muted = YES;
|
||||
|
||||
XCTAssertTrue(_videoNode.player.muted);
|
||||
}
|
||||
|
||||
- (void)testUnMutingShouldUnMutePlayer
|
||||
{
|
||||
[_videoNode setPlayer:[[AVPlayer alloc] init]];
|
||||
|
||||
_videoNode.muted = YES;
|
||||
_videoNode.muted = NO;
|
||||
|
||||
XCTAssertFalse(_videoNode.player.muted);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user