blob: 56b66ea5d6337b3fadd61d22e7344a5df60e729f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
#import <Quick/Quick.h>
#import <Nimble/Nimble.h>
#import <VideoToolbox/VideoToolbox.h>
#import "SDLStreamingMediaConfiguration.h"
#import "SDLFakeSecurityManager.h"
#import "SDLFakeStreamingManagerDataSource.h"
QuickSpecBegin(SDLStreamingMediaConfigurationSpec)
describe(@"a streaming media configuration", ^{
__block SDLStreamingMediaConfiguration *testConfig = nil;
context(@"That is created with a full initializer", ^{
__block SDLFakeSecurityManager *testFakeSecurityManager = nil;
__block SDLStreamingEncryptionFlag testEncryptionFlag = SDLStreamingEncryptionFlagNone;
__block SDLFakeStreamingManagerDataSource *testDataSource = nil;
__block NSDictionary<NSString *, id> *testVideoEncoderSettings = nil;
__block UIViewController *testViewController = nil;
beforeEach(^{
testFakeSecurityManager = [[SDLFakeSecurityManager alloc] init];
testDataSource = [[SDLFakeStreamingManagerDataSource alloc] init];
testVideoEncoderSettings = @{
(__bridge NSString *)kVTCompressionPropertyKey_ExpectedFrameRate : @1
};
testViewController = [[UIViewController alloc] init];
testEncryptionFlag = SDLStreamingEncryptionFlagAuthenticateAndEncrypt;
testConfig = [[SDLStreamingMediaConfiguration alloc] initWithSecurityManagers:@[testFakeSecurityManager.class] encryptionFlag:testEncryptionFlag videoSettings:testVideoEncoderSettings dataSource:testDataSource rootViewController:testViewController];
});
it(@"should have properly set properties", ^{
expect(testConfig.securityManagers).to(contain(testFakeSecurityManager.class));
expect(@(testConfig.maximumDesiredEncryption)).to(equal(@(SDLStreamingEncryptionFlagAuthenticateAndEncrypt)));
expect(testConfig.customVideoEncoderSettings).to(equal(testVideoEncoderSettings));
expect(testConfig.dataSource).to(equal(testDataSource));
expect(testConfig.rootViewController).to(equal(testViewController));
});
});
context(@"that is created with insecure settings", ^{
beforeEach(^{
testConfig = [SDLStreamingMediaConfiguration insecureConfiguration];
});
it(@"should have properly set properties", ^{
expect(testConfig.securityManagers).to(beNil());
expect(@(testConfig.maximumDesiredEncryption)).to(equal(@(SDLStreamingEncryptionFlagNone)));
expect(testConfig.customVideoEncoderSettings).to(beNil());
expect(testConfig.dataSource).to(beNil());
expect(testConfig.rootViewController).to(beNil());
});
});
context(@"that is created with secure settings", ^{
__block SDLFakeSecurityManager *testFakeSecurityManager = nil;
beforeEach(^{
testFakeSecurityManager = [[SDLFakeSecurityManager alloc] init];
testConfig = [SDLStreamingMediaConfiguration secureConfigurationWithSecurityManagers:@[testFakeSecurityManager.class]];
});
it(@"should have properly set properties", ^{
expect(testConfig.securityManagers).to(contain(testFakeSecurityManager.class));
expect(@(testConfig.maximumDesiredEncryption)).to(equal(@(SDLStreamingEncryptionFlagAuthenticateAndEncrypt)));
expect(testConfig.customVideoEncoderSettings).to(beNil());
expect(testConfig.dataSource).to(beNil());
expect(testConfig.rootViewController).to(beNil());
});
});
});
QuickSpecEnd
|