Bubble collapse.

pull/1/head
Matthew Chen 7 years ago
parent 8d74c68f9d
commit 643c6385b5

@ -442,6 +442,8 @@ NS_ASSUME_NONNULL_BEGIN
[self sendJpegAction:thread hasCaption:YES], [self sendJpegAction:thread hasCaption:YES],
[self sendGifAction:thread hasCaption:NO], [self sendGifAction:thread hasCaption:NO],
[self sendGifAction:thread hasCaption:YES], [self sendGifAction:thread hasCaption:YES],
[self sendLargeGifAction:thread hasCaption:NO],
[self sendLargeGifAction:thread hasCaption:YES],
[self sendMp3Action:thread hasCaption:NO], [self sendMp3Action:thread hasCaption:NO],
[self sendMp3Action:thread hasCaption:YES], [self sendMp3Action:thread hasCaption:YES],
[self sendMp4Action:thread hasCaption:NO], [self sendMp4Action:thread hasCaption:NO],
@ -470,6 +472,16 @@ NS_ASSUME_NONNULL_BEGIN
thread:thread]; thread:thread];
} }
+ (DebugUIMessagesAction *)sendLargeGifAction:(TSThread *)thread hasCaption:(BOOL)hasCaption
{
OWSAssert(thread);
return [self sendMediaAction:@"Send Large Gif"
hasCaption:hasCaption
fakeAssetLoader:[DebugUIMessagesAssetLoader largeGifInstance]
thread:thread];
}
+ (DebugUIMessagesAction *)sendMp3Action:(TSThread *)thread hasCaption:(BOOL)hasCaption + (DebugUIMessagesAction *)sendMp3Action:(TSThread *)thread hasCaption:(BOOL)hasCaption
{ {
OWSAssert(thread); OWSAssert(thread);
@ -574,6 +586,19 @@ NS_ASSUME_NONNULL_BEGIN
thread:thread]; thread:thread];
} }
+ (DebugUIMessagesAction *)fakeOutgoingLargeGifAction:(TSThread *)thread
messageState:(TSOutgoingMessageState)messageState
hasCaption:(BOOL)hasCaption
{
OWSAssert(thread);
return [self fakeOutgoingMediaAction:@"Fake Outgoing Large Gif"
messageState:messageState
hasCaption:hasCaption
fakeAssetLoader:[DebugUIMessagesAssetLoader largeGifInstance]
thread:thread];
}
+ (DebugUIMessagesAction *)fakeOutgoingMp3Action:(TSThread *)thread + (DebugUIMessagesAction *)fakeOutgoingMp3Action:(TSThread *)thread
messageState:(TSOutgoingMessageState)messageState messageState:(TSOutgoingMessageState)messageState
hasCaption:(BOOL)hasCaption hasCaption:(BOOL)hasCaption
@ -876,6 +901,19 @@ NS_ASSUME_NONNULL_BEGIN
thread:thread]; thread:thread];
} }
+ (DebugUIMessagesAction *)fakeIncomingLargeGifAction:(TSThread *)thread
isAttachmentDownloaded:(BOOL)isAttachmentDownloaded
hasCaption:(BOOL)hasCaption
{
OWSAssert(thread);
return [self fakeIncomingMediaAction:@"Fake Incoming Large Gif"
isAttachmentDownloaded:isAttachmentDownloaded
hasCaption:hasCaption
fakeAssetLoader:[DebugUIMessagesAssetLoader largeGifInstance]
thread:thread];
}
+ (DebugUIMessagesAction *)fakeIncomingMp3Action:(TSThread *)thread + (DebugUIMessagesAction *)fakeIncomingMp3Action:(TSThread *)thread
isAttachmentDownloaded:(BOOL)isAttachmentDownloaded isAttachmentDownloaded:(BOOL)isAttachmentDownloaded
hasCaption:(BOOL)hasCaption hasCaption:(BOOL)hasCaption
@ -1182,6 +1220,7 @@ NS_ASSUME_NONNULL_BEGIN
[actions addObjectsFromArray:@[ [actions addObjectsFromArray:@[
// Don't bother with multiple GIF states. // Don't bother with multiple GIF states.
[self fakeOutgoingGifAction:thread messageState:TSOutgoingMessageStateSentToService hasCaption:NO], [self fakeOutgoingGifAction:thread messageState:TSOutgoingMessageStateSentToService hasCaption:NO],
[self fakeOutgoingLargeGifAction:thread messageState:TSOutgoingMessageStateSentToService hasCaption:NO],
]]; ]];
if (includeLabels) { if (includeLabels) {
[actions addObject:[self fakeOutgoingTextMessageAction:thread [actions addObject:[self fakeOutgoingTextMessageAction:thread
@ -1363,6 +1402,7 @@ NS_ASSUME_NONNULL_BEGIN
} }
[actions addObjectsFromArray:@[ [actions addObjectsFromArray:@[
[self fakeIncomingGifAction:thread isAttachmentDownloaded:YES hasCaption:NO], [self fakeIncomingGifAction:thread isAttachmentDownloaded:YES hasCaption:NO],
[self fakeIncomingLargeGifAction:thread isAttachmentDownloaded:YES hasCaption:NO],
]]; ]];
if (includeLabels) { if (includeLabels) {
[actions addObject:[self fakeIncomingTextMessageAction:thread text:@"⚠️ Incoming Mp3 ⚠️"]]; [actions addObject:[self fakeIncomingTextMessageAction:thread text:@"⚠️ Incoming Mp3 ⚠️"]];

@ -19,6 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
+ (instancetype)jpegInstance; + (instancetype)jpegInstance;
+ (instancetype)gifInstance; + (instancetype)gifInstance;
+ (instancetype)largeGifInstance;
+ (instancetype)mp3Instance; + (instancetype)mp3Instance;
+ (instancetype)mp4Instance; + (instancetype)mp4Instance;
+ (instancetype)compactPortraitPngInstance; + (instancetype)compactPortraitPngInstance;

@ -342,6 +342,18 @@ NS_ASSUME_NONNULL_BEGIN
return instance; return instance;
} }
+ (instancetype)largeGifInstance
{
static DebugUIMessagesAssetLoader *instance = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
instance =
[DebugUIMessagesAssetLoader fakeAssetLoaderWithUrl:@"https://i.giphy.com/media/LTw0F3GAdaao8/source.gif"
mimeType:@"image/gif"];
});
return instance;
}
+ (instancetype)mp3Instance + (instancetype)mp3Instance
{ {
static DebugUIMessagesAssetLoader *instance = nil; static DebugUIMessagesAssetLoader *instance = nil;

Loading…
Cancel
Save