diff --git a/pages/API/create-inner-audio-context/create-inner-audio-context.test.js b/pages/API/create-inner-audio-context/create-inner-audio-context.test.js index e465c28f19e4caa74a46f2d662377a7b4b9cb26b..36e47f0c540fe70433fbced68609017db591037a 100644 --- a/pages/API/create-inner-audio-context/create-inner-audio-context.test.js +++ b/pages/API/create-inner-audio-context/create-inner-audio-context.test.js @@ -75,5 +75,16 @@ describe('inner-audio', () => { await page.waitFor(3000); // expect(await page.data('isPlayEnd')).toBeTruthy(); }); - + it('onEnded-android', async () => { + if (!process.env.uniTestPlatformInfo.startsWith('android')) { + expect(1).toBe(1) + return + } + await page.setData({ + isPlayEnd: false + }) + await page.callMethod('setSrc','/static/uni-autoTest/alert2s.mp3') + await page.waitFor(3000); + expect(await page.data('isPlayEnd')).toBeTruthy(); + }); }); diff --git a/pages/API/create-inner-audio-context/create-inner-audio-context.uvue b/pages/API/create-inner-audio-context/create-inner-audio-context.uvue index ac523f47813d6291c8373cb19e6d113a65d14601..d1894fa4fa6e21e881f8f2517ecc0f920ec84c97 100644 --- a/pages/API/create-inner-audio-context/create-inner-audio-context.uvue +++ b/pages/API/create-inner-audio-context/create-inner-audio-context.uvue @@ -280,6 +280,12 @@ this._audioContext!.playbackRate = parseFloat(e.detail.value) // } }, + //just for test + setSrc(src:string){ + if( this._audioContext!=null){ + this._audioContext!.src = src + } + } } } diff --git a/pages/API/get-file-system-manager/get-file-system-manager.test.js b/pages/API/get-file-system-manager/get-file-system-manager.test.js index 9b2ef897493f15e21a299af51d63a33aa2b22e7f..b0f23a6aa95075ac71d893193be13109de5c8add 100644 --- a/pages/API/get-file-system-manager/get-file-system-manager.test.js +++ b/pages/API/get-file-system-manager/get-file-system-manager.test.js @@ -1483,4 +1483,22 @@ describe('ExtApi-FileManagerTest', () => { let arrayBufferRes = await getData("arrayBufferRes") expect(arrayBufferRes).toEqual(1.2222222) }); + + it('testReadAssetFile', async () => { + if (!isAndroid()) { + return + } + + await page.setData({ + basePath: '/static/uni-app-x/version.json', + logAble: false, + readFileRet: "", + readFile: '/version.json' + }) + let btnReadFileButton = await page.$('#btn-read-file-sync') + await btnReadFileButton.tap() + await isDone() + let readFileRet = await getData('readFileRet') + expect(readFileRet.length>0).toBe(true) + }); });