Merge pull request #1729 from levi/reverseFlatten
[Tests] Update FBSnapshotTestCase and generate @3x images
@ -85,6 +85,13 @@
|
|||||||
ReferencedContainer = "container:AsyncDisplayKit.xcodeproj">
|
ReferencedContainer = "container:AsyncDisplayKit.xcodeproj">
|
||||||
</BuildableReference>
|
</BuildableReference>
|
||||||
</MacroExpansion>
|
</MacroExpansion>
|
||||||
|
<EnvironmentVariables>
|
||||||
|
<EnvironmentVariable
|
||||||
|
key = "FB_REFERENCE_IMAGE_DIR"
|
||||||
|
value = "$(SOURCE_ROOT)/$(PROJECT_NAME)Tests/ReferenceImages"
|
||||||
|
isEnabled = "YES">
|
||||||
|
</EnvironmentVariable>
|
||||||
|
</EnvironmentVariables>
|
||||||
<AdditionalOptions>
|
<AdditionalOptions>
|
||||||
</AdditionalOptions>
|
</AdditionalOptions>
|
||||||
</LaunchAction>
|
</LaunchAction>
|
||||||
|
|||||||
@ -21,12 +21,6 @@ static const ASSizeRange kSize = {{100, 120}, {320, 160}};
|
|||||||
|
|
||||||
@implementation ASCenterLayoutSpecSnapshotTests
|
@implementation ASCenterLayoutSpecSnapshotTests
|
||||||
|
|
||||||
- (void)setUp
|
|
||||||
{
|
|
||||||
[super setUp];
|
|
||||||
self.recordMode = NO;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)testWithOptions
|
- (void)testWithOptions
|
||||||
{
|
{
|
||||||
[self testWithCenteringOptions:ASCenterLayoutSpecCenteringNone sizingOptions:{}];
|
[self testWithCenteringOptions:ASCenterLayoutSpecCenteringNone sizingOptions:{}];
|
||||||
|
|||||||
@ -45,12 +45,6 @@ static NSString *nameForInsets(UIEdgeInsets insets)
|
|||||||
|
|
||||||
@implementation ASInsetLayoutSpecSnapshotTests
|
@implementation ASInsetLayoutSpecSnapshotTests
|
||||||
|
|
||||||
- (void)setUp
|
|
||||||
{
|
|
||||||
[super setUp];
|
|
||||||
self.recordMode = NO;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)testInsetsWithVariableSize
|
- (void)testInsetsWithVariableSize
|
||||||
{
|
{
|
||||||
for (NSUInteger combination = 0; combination < 16; combination++) {
|
for (NSUInteger combination = 0; combination < 16; combination++) {
|
||||||
|
|||||||
@ -20,6 +20,12 @@
|
|||||||
|
|
||||||
@implementation ASLayoutSpecSnapshotTestCase
|
@implementation ASLayoutSpecSnapshotTestCase
|
||||||
|
|
||||||
|
- (void)setUp
|
||||||
|
{
|
||||||
|
[super setUp];
|
||||||
|
self.recordMode = NO;
|
||||||
|
}
|
||||||
|
|
||||||
- (void)testLayoutSpec:(ASLayoutSpec *)layoutSpec
|
- (void)testLayoutSpec:(ASLayoutSpec *)layoutSpec
|
||||||
sizeRange:(ASSizeRange)sizeRange
|
sizeRange:(ASSizeRange)sizeRange
|
||||||
subnodes:(NSArray *)subnodes
|
subnodes:(NSArray *)subnodes
|
||||||
|
|||||||
@ -20,12 +20,6 @@ static const ASSizeRange kSize = {{320, 320}, {320, 320}};
|
|||||||
|
|
||||||
@implementation ASOverlayLayoutSpecSnapshotTests
|
@implementation ASOverlayLayoutSpecSnapshotTests
|
||||||
|
|
||||||
- (void)setUp
|
|
||||||
{
|
|
||||||
[super setUp];
|
|
||||||
self.recordMode = NO;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)testOverlay
|
- (void)testOverlay
|
||||||
{
|
{
|
||||||
ASDisplayNode *backgroundNode = ASDisplayNodeWithBackgroundColor([UIColor blueColor]);
|
ASDisplayNode *backgroundNode = ASDisplayNodeWithBackgroundColor([UIColor blueColor]);
|
||||||
|
|||||||
@ -19,12 +19,6 @@ static const ASSizeRange kFixedSize = {{0, 0}, {100, 100}};
|
|||||||
|
|
||||||
@implementation ASRatioLayoutSpecSnapshotTests
|
@implementation ASRatioLayoutSpecSnapshotTests
|
||||||
|
|
||||||
- (void)setUp
|
|
||||||
{
|
|
||||||
[super setUp];
|
|
||||||
self.recordMode = NO;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)testRatioLayoutSpecWithRatio:(CGFloat)ratio childSize:(CGSize)childSize identifier:(NSString *)identifier
|
- (void)testRatioLayoutSpecWithRatio:(CGFloat)ratio childSize:(CGSize)childSize identifier:(NSString *)identifier
|
||||||
{
|
{
|
||||||
ASStaticSizeDisplayNode *subnode = ASDisplayNodeWithBackgroundColor([UIColor greenColor]);
|
ASStaticSizeDisplayNode *subnode = ASDisplayNodeWithBackgroundColor([UIColor greenColor]);
|
||||||
|
|||||||
@ -21,12 +21,6 @@ static const ASSizeRange kSize = {{100, 120}, {320, 160}};
|
|||||||
|
|
||||||
@implementation ASRelativeLayoutSpecSnapshotTests
|
@implementation ASRelativeLayoutSpecSnapshotTests
|
||||||
|
|
||||||
- (void)setUp
|
|
||||||
{
|
|
||||||
[super setUp];
|
|
||||||
self.recordMode = NO;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)testWithOptions
|
- (void)testWithOptions
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@ -21,12 +21,6 @@
|
|||||||
|
|
||||||
@implementation ASStackLayoutSpecSnapshotTests
|
@implementation ASStackLayoutSpecSnapshotTests
|
||||||
|
|
||||||
- (void)setUp
|
|
||||||
{
|
|
||||||
[super setUp];
|
|
||||||
self.recordMode = NO;
|
|
||||||
}
|
|
||||||
|
|
||||||
#pragma mark - Utility methods
|
#pragma mark - Utility methods
|
||||||
|
|
||||||
static NSArray *defaultSubnodes()
|
static NSArray *defaultSubnodes()
|
||||||
|
|||||||
@ -16,12 +16,6 @@
|
|||||||
|
|
||||||
@implementation ASStaticLayoutSpecSnapshotTests
|
@implementation ASStaticLayoutSpecSnapshotTests
|
||||||
|
|
||||||
- (void)setUp
|
|
||||||
{
|
|
||||||
[super setUp];
|
|
||||||
self.recordMode = NO;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)testSizingBehaviour
|
- (void)testSizingBehaviour
|
||||||
{
|
{
|
||||||
[self testWithSizeRange:ASSizeRangeMake(CGSizeMake(150, 200), CGSizeMake(FLT_MAX, FLT_MAX))
|
[self testWithSizeRange:ASSizeRangeMake(CGSizeMake(150, 200), CGSizeMake(FLT_MAX, FLT_MAX))
|
||||||
|
|||||||
@ -81,7 +81,7 @@ static BOOL checkAttributes(const ASTextKitAttributes &attributes, const CGSize
|
|||||||
FBSnapshotTestController *controller = [[FBSnapshotTestController alloc] init];
|
FBSnapshotTestController *controller = [[FBSnapshotTestController alloc] init];
|
||||||
UIImage *labelImage = UITextViewImageWithAttributes(attributes, constrainedSize, linkTextAttributes);
|
UIImage *labelImage = UITextViewImageWithAttributes(attributes, constrainedSize, linkTextAttributes);
|
||||||
UIImage *textKitImage = ASTextKitImageWithAttributes(attributes, constrainedSize);
|
UIImage *textKitImage = ASTextKitImageWithAttributes(attributes, constrainedSize);
|
||||||
return [controller compareReferenceImage:labelImage toImage:textKitImage error:nil];
|
return [controller compareReferenceImage:labelImage toImage:textKitImage tolerance:0.0 error:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
@implementation ASTextKitTests
|
@implementation ASTextKitTests
|
||||||
|
|||||||
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 9.3 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 589 B |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 651 B |
|
After Width: | Height: | Size: 513 B |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 7.7 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 6.3 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 9.9 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 841 B |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 9.1 KiB |
|
After Width: | Height: | Size: 9.2 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 8.8 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 8.8 KiB |
|
After Width: | Height: | Size: 9.1 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 11 KiB |