diff --git a/pages/API/compress-video/compress-video.test.js b/pages/API/compress-video/compress-video.test.js index 2afb262508d276b3e051349d152e5073a3efd3dc..a80a04e4ece9ab81ecc9674d22a652f6cbbf77f1 100644 --- a/pages/API/compress-video/compress-video.test.js +++ b/pages/API/compress-video/compress-video.test.js @@ -19,7 +19,7 @@ describe('API-compressVideo', () => { expect(await page.data('videoInfoForTest')).toEqual({ width: 640, height: 360, - // isSizeReduce: true + isSizeReduce: true }); }); }); diff --git a/pages/API/compress-video/compress-video.uvue b/pages/API/compress-video/compress-video.uvue index f4ccd2c8f62b154ed7af48364b6e7da1863bad49..f71c492ae8335a294d55930348e0fb904ef13ec5 100644 --- a/pages/API/compress-video/compress-video.uvue +++ b/pages/API/compress-video/compress-video.uvue @@ -132,7 +132,7 @@ this.videoInfoForTest = { "width": __res.width, "height": __res.height, - // "isSizeReduce": afterComoressSize < beforeCompressSize + "isSizeReduce": afterComoressSize < beforeCompressSize }; } }); diff --git a/pages/component/web-view-local/web-view-local.test.js b/pages/component/web-view-local/web-view-local.test.js index 62c2e0893d05af2c35dbdee6a9aa9d703759552d..b11d372854a240c8e9bb777730f1fb8ad3a79d8f 100644 --- a/pages/component/web-view-local/web-view-local.test.js +++ b/pages/component/web-view-local/web-view-local.test.js @@ -42,15 +42,29 @@ describe('component-native-web-view', () => { }); return; } - expect(await page.data('eventDownload')).toEqual({ - tagName: 'WEB-VIEW', - type: 'download', - url: 'https://web-ext-storage.dcloud.net.cn/uni-app-x/pkg/hello-uniappx.apk', - userAgent: `uni-app-x/${process.env.HX_Version.split('-')[0].split('.').slice(0, 2).join('.')}`, - contentDisposition: `attachment; filename="hello-uniappx.apk"; filename*=utf-8''hello-uniappx.apk`, - mimetype: 'application/vnd.android.package-archive', - contentLength: 27317517 - }); + const infos = process.env.uniTestPlatformInfo.split(' '); + const version = parseInt(infos[infos.length - 1]); + if (version > 8) { + expect(await page.data('eventDownload')).toEqual({ + tagName: 'WEB-VIEW', + type: 'download', + url: 'https://web-ext-storage.dcloud.net.cn/uni-app-x/pkg/hello-uniappx.apk', + userAgent: `uni-app-x/${process.env.HX_Version.split('-')[0].split('.').slice(0, 2).join('.')}`, + contentDisposition: `attachment; filename="hello-uniappx.apk"; filename*=utf-8''hello-uniappx.apk`, + mimetype: 'application/vnd.android.package-archive', + contentLength: 27317517 + }); + } else { // 低版本webview内核,部分属性无有效值 + expect(await page.data('eventDownload')).toEqual({ + tagName: 'WEB-VIEW', + type: 'download', + url: 'https://web-ext-storage.dcloud.net.cn/uni-app-x/pkg/hello-uniappx.apk', + userAgent: '', + contentDisposition: '', + mimetype: '', + contentLength: -1 + }); + } }); it('test event message', async () => {