Merged branch 'master' into AVPlayerItem-construction

This commit is contained in:
Gareth Reese
2016-04-06 15:22:10 +01:00
194 changed files with 5456 additions and 2227 deletions

View File

@@ -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