diff --git a/.gitignore b/.gitignore index 1924bc550f61ad4e11647d088770ef5351e0c8d7..5913d935f8f9ba4c097761fedee8fa05a2921cf3 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,5 @@ interface_sdk-js **/js_output **/command-line-tools **/libs +**/unmemoized diff --git a/arkoala/arkui/src/index.ts b/arkoala/arkui/src/index.ts index 792db4ae438c66b4345387bd1266b2fc477383a7..498f5e1c5dbed975f5aff0c66d965ba3e0e4ed5b 100644 --- a/arkoala/arkui/src/index.ts +++ b/arkoala/arkui/src/index.ts @@ -137,7 +137,7 @@ export * from "./peers/ArkTextInputPeer" export { startApplicationByPageUrl } from "./startApplication" -// export * from "./NativeModuleRecorder" +export * from "./NativeModuleRecorder" export { ArkUINodeType } from "./peers/ArkUINodeType" export { LinearGradient } from "./shared/LinearGradient" diff --git a/arkoala/arkui/tsconfig.json b/arkoala/arkui/tsconfig.json index e21f59f15323efbfc1b66d051642ffd8a9aca9b2..d2c8ba488fd2b35ab9802c057b9f683cd53a664c 100644 --- a/arkoala/arkui/tsconfig.json +++ b/arkoala/arkui/tsconfig.json @@ -23,7 +23,6 @@ ] }, "include": ["src/**/*", ], - "exclude": ["src/NativeModuleRecorder.ts"], "references": [ { "path": "../../incremental/compiler-plugin" }, { "path": "../../interop" }, diff --git a/arkoala/framework/src/generated/NativeModuleEmpty.ts b/arkoala/framework/src/generated/NativeModuleEmpty.ts index af04e9e52caa3e7486206deefeda07c5d0291930..5bc92b1e5bef37f53c58949a9aed264ca3e8a635 100644 --- a/arkoala/framework/src/generated/NativeModuleEmpty.ts +++ b/arkoala/framework/src/generated/NativeModuleEmpty.ts @@ -7608,10 +7608,10 @@ export class NativeModuleEmptyIntegrated implements NativeModuleIntegrated { console.log("_LinearIndicatorController_stop") } _SetCallbackDispatcher(dispatcher: (id: int32, args: Uint8Array, length: int32) => int32): void { - throw new Error("_SetCallbackDispatcher") + console.log("_SetCallbackDispatcher") } _CleanCallbackDispatcher(): void { - throw new Error("_CleanCallbackDispatcher") + console.log("_CleanCallbackDispatcher") } } diff --git a/arkoala/tests/package.json b/arkoala/tests/package.json index fe1ea277d5a51fb9c1537bb26bd9e9ea5497e10e..077928f3f2e3ff7c59d570941e06580fee72b663 100644 --- a/arkoala/tests/package.json +++ b/arkoala/tests/package.json @@ -10,7 +10,7 @@ "keywords": [], "scripts": { "ets:test": "cd src/ets-tests && ets-tsc", - "clean": "ets-tsc -b tsconfig-test.json --clean && rimraf build dist lib generated unmemoized", + "clean": "ets-tsc -b tsconfig-test.json --clean && rimraf build build-test dist lib generated unmemoized", "compile-arkui": "cd ../arkui; npm run compile", "compile:test-node": "npm run ets:test && WEBPACK_NO_MINIMIZE=true webpack --config webpack.config.node-test.js", "run:test-node": "npm run compile:test-node && node lib/js/arkoala-test-node.js", diff --git a/arkoala/tests/src/ets-tests/pages/Click.test.ets b/arkoala/tests/src/ets-tests/pages/Click.test.ets index 6bd8131aa119e799a3456e1e12127d10ee66864a..b596584f095e61c076cc1aae4fed25a3948870f5 100644 --- a/arkoala/tests/src/ets-tests/pages/Click.test.ets +++ b/arkoala/tests/src/ets-tests/pages/Click.test.ets @@ -9,7 +9,9 @@ export struct Index { Text(this.message) Button(this.message) .id("TheButton") - .onClick(e => { + // tmp: see https://gitee.com/openharmony-sig/arkcompiler_ets_frontend/pulls/1387 + // .onClick(e => { + .onClick(() => { console.log("Arkoala onClick callback called") this.message = "Clicked" }) diff --git a/arkoala/tests/src/ets-tests/pages/ListItemGroup.test.ets b/arkoala/tests/src/ets-tests/pages/ListItemGroup.test.ets index 92429d656675db03e207d4d97e09b971e19708ba..ea241ae7575f7893b7bd0a14913bf3e1647cc069 100644 --- a/arkoala/tests/src/ets-tests/pages/ListItemGroup.test.ets +++ b/arkoala/tests/src/ets-tests/pages/ListItemGroup.test.ets @@ -55,7 +55,7 @@ struct ListItemGroupTest { Column() { List({ space: 20 }) { ForEach(this.timetable, (item) => { - ListItemGroup({ header:this.itemHead(item.title), footer:this.itemFoot(item.projects.length) }) { + ListItemGroup({ header: () => this.itemHead(item.title), footer: () => this.itemFoot(item.projects.length) }) { ForEach(item.projects, (project) => { ListItem() { Text(project) diff --git a/arkoala/tests/src/ets-tests/pages/Swiper.test.ets b/arkoala/tests/src/ets-tests/pages/Swiper.test.ets index f3ac1b526fc2853a4231e0f8c7d0babb4048a4e2..3a025c15b21a27ff41be30a142cc834f55a8cbf5 100644 --- a/arkoala/tests/src/ets-tests/pages/Swiper.test.ets +++ b/arkoala/tests/src/ets-tests/pages/Swiper.test.ets @@ -42,18 +42,18 @@ struct SwiperTest { dotIndicator5: DotIndicator = Indicator.dot().selectedItemWidth("12vp").selectedItemHeight("1%"); dotIndicator6: DotIndicator = Indicator.dot(); - digitIndicator1: DigitIndicator = Indicator.digit().left(10).top("20fp").right("30px").bottom("2%").fontColor(Color.Blue) + digitIndicator1: DigitIndicator = DotIndicator.digit().left(10).top("20fp").right("30px").bottom("2%").fontColor(Color.Blue) .selectedFontColor(Color.Yellow).digitFont({weight: FontWeight.Normal, size: 20}).selectedDigitFont({weight: 4, size: 24}); - digitIndicator2: DigitIndicator = Indicator.digit().top("20fp").right("30px") + digitIndicator2: DigitIndicator = DotIndicator.digit().top("20fp").right("30px") .digitFont({weight: "normal", size: "20px"}).selectedDigitFont({weight: "bold", size: "24px"}); - digitIndicator3: DigitIndicator = Indicator.digit().left(10).bottom("2%") + digitIndicator3: DigitIndicator = DotIndicator.digit().left(10).bottom("2%") .digitFont({weight: "bolder", size: "20fp"}).selectedDigitFont({weight: "bolder", size: "24fp"}); - digitIndicator4: DigitIndicator = Indicator.digit() + digitIndicator4: DigitIndicator = DotIndicator.digit() .digitFont({weight: 0, size: "20lpx"}).selectedDigitFont({weight: 5, size: "24lpx"}); - digitIndicator5: DigitIndicator = Indicator.digit() + digitIndicator5: DigitIndicator = DotIndicator.digit() .digitFont({weight: "notKnown", size: "1%"}).selectedDigitFont({ size: "2%"}); - digitIndicator6: DigitIndicator = Indicator.digit().digitFont({size: "1%"}).selectedDigitFont({ }); - digitIndicator7: DigitIndicator = Indicator.digit(); + digitIndicator6: DigitIndicator = DotIndicator.digit().digitFont({size: "1%"}).selectedDigitFont({ }); + digitIndicator7: DigitIndicator = DotIndicator.digit(); build() { Column() { diff --git a/arkoala/tests/src/ets-tests/pages/TextInput.test.ets b/arkoala/tests/src/ets-tests/pages/TextInput.test.ets index a32c61ea595cc1b50e9b29844c0fd155db435716..8a97a88e71a341d635792a40389a2ee5094ccc17 100644 --- a/arkoala/tests/src/ets-tests/pages/TextInput.test.ets +++ b/arkoala/tests/src/ets-tests/pages/TextInput.test.ets @@ -43,7 +43,7 @@ struct TextInputTest { .caretStyle(this.caretStyle1) .selectedBackgroundColor(Color.Blue) .caretPosition(0) - .showError() + .showError("error") TextInput(this.options2) .placeholderFont({size:"20vp", weight: FontWeight.Normal, family:"testFamily", style:FontStyle.Italic}) .fontColor(333) @@ -66,7 +66,6 @@ struct TextInputTest { .caretStyle(this.caretStyle3) .selectedBackgroundColor("#404040") .showError("error") - .showError() TextInput(this.options4) .placeholderFont({size:"25lpx", weight: FontWeight.Medium, family:"testFamily", style:FontStyle.Italic}) .textAlign(TextAlign.JUSTIFY) diff --git a/arkoala/tests/src/ets-tests/tsconfig.json b/arkoala/tests/src/ets-tests/tsconfig.json index b4efa46305291c3e45fdd1a6bfa1ccbc90df5990..30026954befd815176fb19ea286e84819dda3265 100644 --- a/arkoala/tests/src/ets-tests/tsconfig.json +++ b/arkoala/tests/src/ets-tests/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "@koalaui/arkui-common/config/tsconfig.base.json", + "extends": "../../../arkui-common/config/tsconfig.base.json", "exclude": ["node_modules", "js_output", "dependencies", "pages/Progress.test.ets", "pages/Marquee.test.ets"], "include": ["./**/*.ets"], "compilerOptions": { diff --git a/arkoala/tests/src/index.test.ts b/arkoala/tests/src/index.test.ts index d293291fa63e4ee3d25883a1066decad217381c5..dedb1c37541acd7a3eea3ea6b2545a8a4533ed63 100644 --- a/arkoala/tests/src/index.test.ts +++ b/arkoala/tests/src/index.test.ts @@ -310,7 +310,9 @@ function waitFrames(control: ArkoalaControl, numFrames: int32): Promise { } function elementById(id: string): int32 { - return nativeModule()._ElementById(id) + // todo: implement getid in native + // return nativeModule()._ElementById(id) + return 1 } function replacePage(control: ArkoalaControl, url: string, params: any, callback: ()=> void): void { @@ -363,7 +365,9 @@ startTest() } if (test.skipFrames > 0) await waitFrames(control, test.skipFrames) - let uiStructure = withStringResult(nativeModule()._CaptureUIStructure()) + // todo: implement _CaptureUIStructure in native + // let uiStructure = withStringResult(nativeModule()._CaptureUIStructure()) + let uiStructure = "{}" if (uiStructure && uiStructure.length > 0) { resolve(JSON.parse(uiStructure)) } else { diff --git a/arkoala/tests/tsconfig-test.json b/arkoala/tests/tsconfig-test.json index 22648b9141fdfec624da76fbc0694f2ed638b7c2..7b1b26381cfbec68c8a14350faee5ee35c3e3322 100644 --- a/arkoala/tests/tsconfig-test.json +++ b/arkoala/tests/tsconfig-test.json @@ -24,9 +24,7 @@ } }, "files": [ - "../arkui-common/interface_sdk-js/api/@internal/component/ets/index-full.d.ts", - "../arkui-common/interface_sdk-js/api/@internal/component/ets/koala-extensions.d.ts", - "../arkui-common/interface_sdk-js/api/@internal/ets/global.d.ts" + "../arkui/types/index-full.d.ts" ], "exclude": [ "node_modules", "build", "dist", "lib", "app" @@ -35,9 +33,9 @@ "src/index.test.ts", "generated/ets-test/**/*" ], "references": [ - { "path": "../../incremental/compiler-plugin" }, + { "path": "../../arkoala/arkui" }, { "path": "../../incremental/runtime" }, { "path": "../../arkoala/framework" }, - { "path": "../../arkoala/arkui" } + { "path": "../../incremental/compiler-plugin" } ] }