Flutter Engine
The Flutter Engine
Instance Methods | List of all members
FlutterTextureRegistryRelayTest Class Reference
Inheritance diagram for FlutterTextureRegistryRelayTest:

Instance Methods

(void) - testCreate [implementation]
 
(void) - testRegisterTexture [implementation]
 
(void) - testTextureFrameAvailable [implementation]
 
(void) - testUnregisterTexture [implementation]
 
(void) - testRetainCycle [implementation]
 

Detailed Description

Definition at line 16 of file FlutterTextureRegistryRelayTest.mm.

Method Documentation

◆ testCreate

- (void) testCreate
implementation

Definition at line 14 of file FlutterTextureRegistryRelayTest.mm.

21 {
22 id textureRegistry = OCMProtocolMock(@protocol(FlutterTextureRegistry));
24 [[FlutterTextureRegistryRelay alloc] initWithParent:textureRegistry];
25 XCTAssertNotNil(relay);
26 XCTAssertEqual(textureRegistry, relay.parent);
27}
NSObject< FlutterTextureRegistry > * parent

◆ testRegisterTexture

- (void) testRegisterTexture
implementation

Definition at line 14 of file FlutterTextureRegistryRelayTest.mm.

29 {
30 id textureRegistry = OCMProtocolMock(@protocol(FlutterTextureRegistry));
32 [[FlutterTextureRegistryRelay alloc] initWithParent:textureRegistry];
33 id texture = OCMProtocolMock(@protocol(FlutterTexture));
34 [relay registerTexture:texture];
35 OCMVerify([textureRegistry registerTexture:texture]);
36}
int64_t registerTexture:(NSObject< FlutterTexture > *texture)
FlTexture * texture

◆ testRetainCycle

- (void) testRetainCycle
implementation

Definition at line 14 of file FlutterTextureRegistryRelayTest.mm.

54 {
55 __weak FlutterEngine* weakEngine;
56 NSObject<FlutterTextureRegistry>* strongRelay;
57 @autoreleasepool {
58 FlutterDartProject* project = [[FlutterDartProject alloc] init];
59 FlutterEngine* engine = [[FlutterEngine alloc] initWithName:@"foobar" project:project];
60 strongRelay = [engine textureRegistry];
61 weakEngine = engine;
62 }
63 XCTAssertNil(weakEngine);
64 XCTAssertNotNil(strongRelay);
65}
FlutterEngine engine
Definition: main.cc:68
NSObject< FlutterTextureRegistry > * textureRegistry

◆ testTextureFrameAvailable

- (void) testTextureFrameAvailable
implementation

Definition at line 14 of file FlutterTextureRegistryRelayTest.mm.

38 {
39 id textureRegistry = OCMProtocolMock(@protocol(FlutterTextureRegistry));
41 [[FlutterTextureRegistryRelay alloc] initWithParent:textureRegistry];
42 [relay textureFrameAvailable:0];
43 OCMVerify([textureRegistry textureFrameAvailable:0]);
44}
void textureFrameAvailable:(int64_t textureId)

◆ testUnregisterTexture

- (void) testUnregisterTexture
implementation

Definition at line 14 of file FlutterTextureRegistryRelayTest.mm.

46 {
47 id textureRegistry = OCMProtocolMock(@protocol(FlutterTextureRegistry));
49 [[FlutterTextureRegistryRelay alloc] initWithParent:textureRegistry];
50 [relay unregisterTexture:0];
51 OCMVerify([textureRegistry unregisterTexture:0]);
52}

The documentation for this class was generated from the following file: