From 9a0378c5746e0f7a2a25e4cb54a05b69d2429e83 Mon Sep 17 00:00:00 2001 From: qinliwen Date: Sat, 6 Aug 2022 15:19:04 +0800 Subject: [PATCH] =?UTF-8?q?<=E4=BF=AE=E6=94=B9medialibrary=20xts>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: qinliwen --- .../src/main/js/test/fileAsset2.test.js | 5 ++++- .../src/main/js/test/fileAssetPromise2.test.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAsset2.test.js b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAsset2.test.js index c3e0de030..b317c1375 100644 --- a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAsset2.test.js +++ b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAsset2.test.js @@ -40,6 +40,9 @@ function checkAttrs(done, asset, tNum) { done(); } } +function sleep(time){ + for (let t = Date.now(); Date.now() - t <= time;); +} describe('fileAsset2.test.js', async function () { let fileKeyObj = mediaLibrary.FileKey; @@ -207,7 +210,7 @@ describe('fileAsset2.test.js', async function () { asset.orientation = neworientation; const id = asset.id; await asset.commitModify(); - + sleep(1000); const fetchFileResult2 = await media.getFileAssets(imagesfetchOp); const dataList = await fetchFileResult2.getAllObject(); let passed = false; diff --git a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetPromise2.test.js b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetPromise2.test.js index 0671c14cd..11be163fd 100644 --- a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetPromise2.test.js +++ b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetPromise2.test.js @@ -40,6 +40,9 @@ function checkAttrs(done, asset, tNum) { done(); } } +function sleep(time){ + for (let t = Date.now(); Date.now() - t <= time;); +} describe('fileAssetPromise2.test.js', async function () { let fileKeyObj = mediaLibrary.FileKey; @@ -207,7 +210,7 @@ describe('fileAssetPromise2.test.js', async function () { asset.orientation = neworientation; const id = asset.id; await asset.commitModify(); - + sleep(1000); const fetchFileResult2 = await media.getFileAssets(imagesfetchOp); const dataList = await fetchFileResult2.getAllObject(); let passed = false; -- GitLab