diff --git a/entry/src/ohosTest/ets/test/DefaultJobQueueTest.test.ets b/entry/src/ohosTest/ets/test/DefaultJobQueueTest.test.ets index eb13a71c22578922981891f1c2576411a34c8bf9..4e02044e3a62480b2ee6b8502941482d4225fa98 100644 --- a/entry/src/ohosTest/ets/test/DefaultJobQueueTest.test.ets +++ b/entry/src/ohosTest/ets/test/DefaultJobQueueTest.test.ets @@ -70,10 +70,10 @@ export default function DefaultJobQueueTest() { } function makeRequest(src: string, context: common.UIAbilityContext, priority?: taskpool.Priority): ImageKnifeRequest { - let option: ImageKnifeOption = { + let option: ImageKnifeOption = new ImageKnifeOption({ loadSrc: src, priority: priority - } + }) return new ImageKnifeRequest( option, context, diff --git a/entry/src/ohosTest/ets/test/FileLruCache.test.ets b/entry/src/ohosTest/ets/test/FileLruCache.test.ets index 2dd76f35d7c345dba7e6cf9055ff3d4e2560b89c..308197267051bc8a4b66085ef29fdc499271d206 100644 --- a/entry/src/ohosTest/ets/test/FileLruCache.test.ets +++ b/entry/src/ohosTest/ets/test/FileLruCache.test.ets @@ -153,9 +153,9 @@ export default function FileLruCacheTest() { }); it('fileCacheEngineKey', 0, () => { let engineKey: IEngineKey = new DefaultEngineKey() - let imageKnifeOption: ImageKnifeOption = { + let imageKnifeOption: ImageKnifeOption = new ImageKnifeOption({ loadSrc:"abc" - } + }) let imageKey = engineKey.generateFileKey(imageKnifeOption.loadSrc,"") let imageAnimatorKey = engineKey.generateFileKey(imageKnifeOption.loadSrc,"",true) expect(imageKey == imageAnimatorKey).assertFalse() diff --git a/entry/src/ohosTest/ets/test/ImageKnife.test.ets b/entry/src/ohosTest/ets/test/ImageKnife.test.ets index 8c6811f6a43aa3bd999eb679198f76ac8f8a2f38..7df3605fb0272186189a4067ebb1b4e23cb064c2 100644 --- a/entry/src/ohosTest/ets/test/ImageKnife.test.ets +++ b/entry/src/ohosTest/ets/test/ImageKnife.test.ets @@ -40,10 +40,10 @@ export default function ImageKnifeTest() { it('removeMemoryCache', 0, async () => { let a = 'https://hbimg.huabanimg.com/95a6d37a39aa0b70d48fa18dc7df8309e2e0e8e85571e-x4hhks_fw658/format/webp'; - let option: ImageKnifeOption = { + let option: ImageKnifeOption = new ImageKnifeOption({ loadSrc: 'https://hbimg.huabanimg.com/95a6d37a39aa0b70d48fa18dc7df8309e2e0e8e85571e-x4hhks_fw658/format/webp', signature: '' - } + }) let key = ImageKnife.getInstance() .getEngineKeyImpl() .generateMemoryKey('https://hbimg.huabanimg.com/95a6d37a39aa0b70d48fa18dc7df8309e2e0e8e85571e-x4hhks_fw658/format/webp', ImageKnifeRequestSource.SRC, option) diff --git a/entry/src/ohosTest/ets/test/MemoryLruCache.test.ets b/entry/src/ohosTest/ets/test/MemoryLruCache.test.ets index 98f2514513e64ebafe57371337a56e934f0d28d3..26ade90497983d91c2a66c3d846924d491e3f4c1 100644 --- a/entry/src/ohosTest/ets/test/MemoryLruCache.test.ets +++ b/entry/src/ohosTest/ets/test/MemoryLruCache.test.ets @@ -122,9 +122,9 @@ export default function MemoryLruCacheTest() { it('memoryCacheEngineKey', 0, () => { let engineKey: IEngineKey = new DefaultEngineKey() - let imageKnifeOption: ImageKnifeOption = { + let imageKnifeOption: ImageKnifeOption = new ImageKnifeOption({ loadSrc:"abc" - } + }) let imageKey = engineKey.generateMemoryKey(imageKnifeOption.loadSrc,ImageKnifeRequestSource.SRC,imageKnifeOption) let imageAnimatorKey = engineKey.generateMemoryKey(imageKnifeOption.loadSrc,ImageKnifeRequestSource.SRC,imageKnifeOption,true) expect(imageKey == imageAnimatorKey).assertFalse() diff --git a/entry/src/ohosTest/ets/test/imageknifeOption.test.ets b/entry/src/ohosTest/ets/test/imageknifeOption.test.ets index ffd20b9e09cc4fae0b64b8db92240ca17281ce59..6a3acac534399f1eb7d3f98e64cb06fb18727b09 100644 --- a/entry/src/ohosTest/ets/test/imageknifeOption.test.ets +++ b/entry/src/ohosTest/ets/test/imageknifeOption.test.ets @@ -44,7 +44,7 @@ export default function ImageKnifeOptionTest() { imageWidth: 0, imageHeight: 0, } - let ImageKnifeOption: ImageKnifeOption = { + let imageKnifeOption: ImageKnifeOption = new ImageKnifeOption({ loadSrc: $r("app.media.rabbit"), onLoadListener: { onLoadFailed: (err) => { @@ -58,10 +58,10 @@ export default function ImageKnifeOptionTest() { return data; }, }, - } - if (ImageKnifeOption.onLoadListener && ImageKnifeOption.onLoadListener.onLoadSuccess && ImageKnifeOption.onLoadListener.onLoadFailed) { - ImageKnifeOption.onLoadListener.onLoadSuccess(a,imageData); - ImageKnifeOption.onLoadListener.onLoadFailed(a); + }) + if (imageKnifeOption.onLoadListener && imageKnifeOption.onLoadListener.onLoadSuccess && imageKnifeOption.onLoadListener.onLoadFailed) { + imageKnifeOption.onLoadListener.onLoadSuccess(a,imageData); + imageKnifeOption.onLoadListener.onLoadFailed(a); } expect(a).assertEqual(b); });