feat: 更新 WebView 数据目录,添加持久存储清理逻辑;优化 URL 生成和 H5 路由刷新时的品牌保持
This commit is contained in:
@@ -28,4 +28,23 @@ void main() {
|
||||
expect(uri.toString(), isNot(contains('%25')));
|
||||
expect(Uri.splitQueryString(uri.fragment)['shell_app_logo'], logo);
|
||||
});
|
||||
|
||||
test('keeps shell branding when refreshing an H5 route URL', () {
|
||||
const logo = 'data:image/png;base64,routeLogo+/=';
|
||||
|
||||
final uri = Uri.parse(
|
||||
AppConfig.withFreshShellParams(
|
||||
'https://h5-im.imharry.work/login?from=runtime',
|
||||
appName: 'Shell Route',
|
||||
appLogo: logo,
|
||||
),
|
||||
);
|
||||
|
||||
expect(uri.path, '/login');
|
||||
expect(uri.queryParameters['from'], 'runtime');
|
||||
expect(uri.queryParameters['flutter_shell'], '1');
|
||||
expect(uri.queryParameters['shell_app_name'], 'Shell Route');
|
||||
expect(uri.queryParameters['shell_cache_bust'], isNotEmpty);
|
||||
expect(Uri.splitQueryString(uri.fragment)['shell_app_logo'], logo);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user