test: align inspector acceptance with fully expanded module layout

这个提交包含在:
mac 于 2026-11-06 14:22:08 +08:00 提交
1 父节点 69040fd730
当前提交 03a1e2452e
2 个文件已更改
+5 -5

没有与搜索条件相匹配的文件

+4 -4
查看文件
@@ -267,11 +267,11 @@ extern "C" int DYRunDiagnostics(void) { @autoreleasepool {
DYDiagnosticManager *uiHost=[[[DYDiagnosticManager alloc]init]autorelease];DYCreateParameters(uiHost,nil);
DYInspector *inspector=[[[DYInspector alloc]initWithAPIManager:uiHost]autorelease];[inspector refresh];
NSArray *cards=[inspector valueForKey:@"cards"];BOOL initialUI=YES;
for(NSDictionary *card in cards){BOOL expected=[@[@"primary",@"spider",@"base",@"hsl"]containsObject:card[@"section"][@"key"]];initialUI&=[card[@"collapsed"]boolValue]&&[card[@"removed"]boolValue]!=expected;}
run.record(@"default-only-primary-spider-base-hsl-visible-and-collapsed",initialUI,@{@"modules":@(cards.count)});
for(NSDictionary *card in cards){BOOL expected=![card[@"section"][@"key"]isEqual:@"output"];initialUI&=![card[@"collapsed"]boolValue]&&[card[@"removed"]boolValue]!=expected;}
run.record(@"default-all-available-modules-visible-and-expanded",initialUI,@{@"modules":@(cards.count)});
DYUniforms uiBefore,uiAfter;DYReadUniforms(uiHost,kCMTimeZero,&uiBefore);BOOL foldingIndependent=YES;
for(NSDictionary *card in cards){NSButton *header=card[@"header"];BOOL was=[card[@"collapsed"]boolValue];[header performClick:nil];[inspector refresh];DYReadUniforms(uiHost,kCMTimeZero,&uiAfter);foldingIndependent&=[card[@"collapsed"]boolValue]!=was&&memcmp(&uiBefore,&uiAfter,sizeof(uiBefore))==0;[header performClick:nil];[inspector refresh];}
run.record(@"all-disclosure-actions-preserve-every-render-parameter",foldingIndependent);
for(NSDictionary *card in cards){NSButton *header=card[@"header"];[header performClick:nil];[inspector refresh];DYReadUniforms(uiHost,kCMTimeZero,&uiAfter);foldingIndependent&=![card[@"collapsed"]boolValue]&&memcmp(&uiBefore,&uiAfter,sizeof(uiBefore))==0;[header performClick:nil];[inspector refresh];}
run.record(@"expanded-header-actions-preserve-every-render-parameter",foldingIndependent);
NSDictionary *first=cards[0];if(![first[@"collapsed"]boolValue]){[(NSButton*)first[@"header"]performClick:nil];[inspector refresh];}BOOL wasFolded=[first[@"collapsed"]boolValue];[(NSButton*)first[@"enabled"]performClick:nil];[inspector refresh];DYReadUniforms(uiHost,kCMTimeZero,&uiAfter);
run.record(@"eye-only-toggles-enable-retains-disclosure",[first[@"collapsed"]boolValue]==wasFolded&&uiAfter.inputSectionEnabled==0);
[(NSButton*)first[@"header"]performClick:nil];[inspector refresh];DYReadUniforms(uiHost,kCMTimeZero,&uiAfter);
@@ -21,7 +21,7 @@
DYDiagnosticManager *host=[[[DYDiagnosticManager alloc]init]autorelease];DYCreateParameters(host,nil);DYAssetState *assets=[[[DYAssetState alloc]init]autorelease];assets.colorManagement=v4;DYWriteAssets(host,assets,kCMTimeZero);
DYInspector *view=[[[DYInspector alloc]initWithAPIManager:host]autorelease];[view refresh];[view setFrameSize:NSMakeSize(400,400)];[view layoutSubtreeIfNeeded];NSDictionary *output=nil;for(NSDictionary *card in [view valueForKey:@"cards"])if([card[@"section"][@"key"]isEqual:@"output"])output=card;
run.record(@"unified-inspector-output-visible-at-chain-tail",output&&![output[@"view"]isHidden]&&NSMaxY([output[@"view"]frame])>NSMaxY([[[view valueForKey:@"cards"]firstObject][@"view"]frame]));
[(NSButton*)output[@"repeatButton"]performClick:nil];run.record(@"unified-output-arrow-persists-and-creates-one-undo",[DYReadTools(host,kCMTimeZero).document[@"outputAfter"]isEqual:@"base:base"]&&host->_undoStarts==1&&host->_undoEnds==1);
[(NSButton*)output[@"repeatButton"]performClick:nil];run.record(@"unified-output-arrow-persists-and-creates-one-undo",[DYReadTools(host,kCMTimeZero).document[@"outputAfter"]isEqual:@"base:film"]&&host->_undoStarts==1&&host->_undoEnds==1);
}
{
const NSUInteger w=128,h=96;DYDiagnosticTile *src=[[[DYDiagnosticTile alloc]initWithDevice:gpu width:w height:h]autorelease],*dst=[[[DYDiagnosticTile alloc]initWithDevice:gpu width:w height:h]autorelease];Pixels chart(w*h*4);