From 867f81819731c35646a73a9fcc7865d558c8c417 Mon Sep 17 00:00:00 2001 From: yinjiacheng Date: Wed, 12 Jun 2024 19:27:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0video=E3=80=81web-view?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=8C=96=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/component/video/video.test.js | 3 +++ pages/component/web-view-local/web-view-local.test.js | 6 +++--- pages/component/web-view-local/web-view-local.uvue | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pages/component/video/video.test.js b/pages/component/video/video.test.js index 39516114..41e613d5 100644 --- a/pages/component/video/video.test.js +++ b/pages/component/video/video.test.js @@ -100,6 +100,9 @@ describe('component-native-video', () => { }); it('test event fullscreenchange fullscreenclick controlstoggle', async () => { + if (process.env.uniTestPlatformInfo.startsWith('ios')) { + return; + } await page.callMethod('requestFullScreen'); await page.waitFor(async () => { return await page.data('eventFullscreenchange'); 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 b11d3728..0647e676 100644 --- a/pages/component/web-view-local/web-view-local.test.js +++ b/pages/component/web-view-local/web-view-local.test.js @@ -38,7 +38,7 @@ describe('component-native-web-view', () => { userAgent: `uni-app-x/${process.env.HX_Version.split('-')[0].split('.').slice(0, 2).join('.')}`, contentDisposition: '', mimetype: 'application/vnd.android.package-archive', - contentLength: 27317517 + isContentLengthValid: true }); return; } @@ -52,7 +52,7 @@ describe('component-native-web-view', () => { 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 + isContentLengthValid: true }); } else { // 低版本webview内核,部分属性无有效值 expect(await page.data('eventDownload')).toEqual({ @@ -62,7 +62,7 @@ describe('component-native-web-view', () => { userAgent: '', contentDisposition: '', mimetype: '', - contentLength: -1 + isContentLengthValid: false }); } }); diff --git a/pages/component/web-view-local/web-view-local.uvue b/pages/component/web-view-local/web-view-local.uvue index add414e6..8dde3139 100644 --- a/pages/component/web-view-local/web-view-local.uvue +++ b/pages/component/web-view-local/web-view-local.uvue @@ -57,7 +57,7 @@ "userAgent": arr[arr.length - 1], "contentDisposition": event.detail.contentDisposition, "mimetype": event.detail.mimetype, - "contentLength": event.detail.contentLength.toInt() + "isContentLengthValid": (event.detail.contentLength / 1024 / 1024).toInt() > 1 }; } }, -- GitLab