提交 a45ec152 编写于 作者: 华华小仙女 提交者: Gitee

Merge branch 'monthly_20221018' of gitee.com:openharmony/xts_acts into monthly_20221018

Signed-off-by: N华华小仙女 <zhurong18@h-partners.com>
...@@ -21,7 +21,6 @@ group("communication") { ...@@ -21,7 +21,6 @@ group("communication") {
"bluetooth_profile:ActsBluetoothProFileJsTest", "bluetooth_profile:ActsBluetoothProFileJsTest",
"bluetooth_standard:ActsBluetoothJsTest", "bluetooth_standard:ActsBluetoothJsTest",
"dsoftbus/rpc:ActsRpcJsTest", "dsoftbus/rpc:ActsRpcJsTest",
"dsoftbus/rpc_server:ActsRpcJsServer",
"nfc_Controller:ActsNFCJSTest", "nfc_Controller:ActsNFCJSTest",
"wifi_p2p:ActsP2PJSTest", "wifi_p2p:ActsP2PJSTest",
"wifi_standard:ActsWifiJSTest", "wifi_standard:ActsWifiJSTest",
......
...@@ -12,8 +12,7 @@ ...@@ -12,8 +12,7 @@
"kits": [ "kits": [
{ {
"test-file-name": [ "test-file-name": [
"ActsRpcHapTest.hap", "ActsRpcHapTest.hap"
"ActsRpcHapServer.hap"
], ],
"type": "AppInstallKit", "type": "AppInstallKit",
"cleanup-apps": true "cleanup-apps": true
......
{
"description": "Configuration for rpc Servers",
"driver": {
"type": "JSUnitServer",
"test-timeout": "900000",
"package": "ohos.rpc.test.server",
"abilityName": ".MainAbility",
"shell-timeout": "900000"
},
"kits": [
{
"test-file-name": [
"ActsRpcHapServer.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"bundleName": "ohos.rpc.test.server",
"vendor": "rpc",
"version": {
"code": 1000000,
"name": "1.0.0"
},
"apiVersion": {
"compatible": 7,
"target": 8
}
},
"deviceConfig": {},
"module": {
"reqPermissions": [
{
"name": "ohos.permission.DISTRIBUTED_DATASYNC"
},
{
"name": "ohos.permission.GET_DISTRIBUTED_DEVICE_INFO"
},
{
"name": "ohos.permission.GET_BUNDLE_INFO"
}
],
"package": "ohos.rpc.test.server",
"name": ".MyApplication",
"mainAbility": ".MainAbility",
"deviceType": [
"tablet",
"default",
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": false
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"orientation": "unspecified",
"visible": true,
"srcPath": "MainAbility",
"name": ".MainAbility",
"srcLanguage": "js",
"icon": "$media:icon",
"description": "$string:mainability_description",
"formsEnabled": false,
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
},
{
"srcPath": "ServiceAbility",
"name": ".ServiceAbility",
"icon": "$media:icon",
"srcLanguage": "js",
"description": "$string:serviceability_description",
"type": "service",
"visible": true,
"formsEnabled": false
}
],
"js": [
{
"pages": [
"pages/index/index",
"pages/second/second"
],
"name": ".MainAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
\ No newline at end of file
.container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
}
.title {
font-size: 60px;
text-align: center;
width: 100%;
height: 40%;
margin: 10px;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
{
"string": [
{
"name": "entry_MainAbility",
"value": "RpcServer"
},
{
"name": "mainability_description",
"value": "JS_Empty Ability"
},
{
"name": "serviceability_description",
"value": "hap sample empty service"
}
]
}
\ No newline at end of file
...@@ -12,9 +12,7 @@ ...@@ -12,9 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium"
// @ts-nocheck
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "deccjsunit/index"
import colorSpaceManager from '@ohos.graphics.colorSpaceManager'; import colorSpaceManager from '@ohos.graphics.colorSpaceManager';
export default function colorSpaceManagerTest(context, windowStage, abilityStorage) { export default function colorSpaceManagerTest(context, windowStage, abilityStorage) {
...@@ -93,7 +91,7 @@ export default function colorSpaceManagerTest(context, windowStage, abilityStora ...@@ -93,7 +91,7 @@ export default function colorSpaceManagerTest(context, windowStage, abilityStora
done(); done();
} catch (err) { } catch (err) {
console.log('test enum value of ColorSpace Manager not support error ' + JSON.stringify(err)); console.log('test enum value of ColorSpace Manager not support error ' + JSON.stringify(err));
expect(err.code == 18600001).assertTrue(); expect(err.code).assertEqual(18600001);
done(); done();
} }
}) })
......
...@@ -973,6 +973,9 @@ describe('webgl1Test_webgl14', function() { ...@@ -973,6 +973,9 @@ describe('webgl1Test_webgl14', function() {
var x13 = gl2.ANY_SAMPLES_PASSED_CONSERVATIVE; var x13 = gl2.ANY_SAMPLES_PASSED_CONSERVATIVE;
expect(x13).assertEqual(36202); expect(x13).assertEqual(36202);
var x14 = gl2.RGB10_A2;
expect(x14).assertEqual(32857);
var y1 = gl.LUMINANCE_ALPHA; var y1 = gl.LUMINANCE_ALPHA;
expect(y1).assertEqual(6410); expect(y1).assertEqual(6410);
...@@ -994,6 +997,9 @@ describe('webgl1Test_webgl14', function() { ...@@ -994,6 +997,9 @@ describe('webgl1Test_webgl14', function() {
var y7 = gl.CONTEXT_LOST_WEBGL; var y7 = gl.CONTEXT_LOST_WEBGL;
expect(y7).assertEqual(37442); expect(y7).assertEqual(37442);
var y8 = gl.ACTIVE_ATTRIBUTES;
expect(y8).assertEqual(35721);
done(); done();
}); });
}) })
...@@ -2955,6 +2955,15 @@ describe('window_test', function () { ...@@ -2955,6 +2955,15 @@ describe('window_test', function () {
expect(0).assertEqual(window.Orientation.UNSPECIFIED); expect(0).assertEqual(window.Orientation.UNSPECIFIED);
expect(1).assertEqual(window.Orientation.PORTRAIT); expect(1).assertEqual(window.Orientation.PORTRAIT);
expect(2).assertEqual(window.Orientation.LANDSCAPE); expect(2).assertEqual(window.Orientation.LANDSCAPE);
expect(3).assertEqual(window.Orientation.PORTRAIT_INVERTED);
expect(4).assertEqual(window.Orientation.LANDSCAPE_INVERTED);
expect(5).assertEqual(window.Orientation.AUTO_ROTATION);
expect(6).assertEqual(window.Orientation.AUTO_ROTATION_PORTRAIT);
expect(7).assertEqual(window.Orientation.AUTO_ROTATION_LANDSCAPE);
expect(8).assertEqual(window.Orientation.AUTO_ROTATION_RESTRICTED);
expect(9).assertEqual(window.Orientation.AUTO_ROTATION_PORTRAIT_RESTRICTED);
expect(10).assertEqual(window.Orientation.AUTO_ROTATION_LANDSCAPE_RESTRICTED);
expect(11).assertEqual(window.Orientation.LOCKED);
done(); done();
} catch (err) { } catch (err) {
console.info('test enum value of windowStageEventType error ' + JSON.stringify(err)); console.info('test enum value of windowStageEventType error ' + JSON.stringify(err));
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"bundle-name": "com.acts.imeability.test", "bundle-name": "com.acts.imeability.test",
"module-name": "phone", "module-name": "phone",
"shell-timeout": "600000", "shell-timeout": "600000",
"testcase-timeout": 70000 "testcase-timeout": 10000
}, },
"kits": [{ "kits": [{
"test-file-name": [ "test-file-name": [
......
...@@ -29,7 +29,7 @@ export default function imeAbilityTest(abilityContext) { ...@@ -29,7 +29,7 @@ export default function imeAbilityTest(abilityContext) {
* beforeEach: Prerequisites at the test case level, which are executed before each test case is executed. * beforeEach: Prerequisites at the test case level, which are executed before each test case is executed.
*/ */
beforeEach(function () { beforeEach(function () {
console.info('beforeEach: switchInputMethod to kikakeyboard.'); console.info('====>beforeEach: switchInputMethod to kikakeyboard.');
let serviceAbilityProperty = { let serviceAbilityProperty = {
packageName: "com.example.kikakeyboard", packageName: "com.example.kikakeyboard",
methodId: "ServiceExtAbility", methodId: "ServiceExtAbility",
...@@ -39,7 +39,7 @@ export default function imeAbilityTest(abilityContext) { ...@@ -39,7 +39,7 @@ export default function imeAbilityTest(abilityContext) {
} }
inputMethod.switchInputMethod(serviceAbilityProperty).then((data)=>{ inputMethod.switchInputMethod(serviceAbilityProperty).then((data)=>{
console.info('SUB_InputMethod_IMEAbility_0001 switchInputMethod to Kika :' + data); console.info('====>SUB_InputMethod_IMEAbility_0001 switchInputMethod to Kika :' + data);
expect(data == true).assertTrue(); expect(data == true).assertTrue();
}) })
...@@ -49,7 +49,7 @@ export default function imeAbilityTest(abilityContext) { ...@@ -49,7 +49,7 @@ export default function imeAbilityTest(abilityContext) {
* afterEach: Test case-level clearance conditions, which are executed after each test case is executed. * afterEach: Test case-level clearance conditions, which are executed after each test case is executed.
*/ */
afterEach(function () { afterEach(function () {
console.info('afterEach: Test case-level clearance conditions is executed.'); console.info('====>afterEach: Test case-level clearance conditions is executed.');
}); });
/** /**
...@@ -60,7 +60,7 @@ export default function imeAbilityTest(abilityContext) { ...@@ -60,7 +60,7 @@ export default function imeAbilityTest(abilityContext) {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SUB_InputMethod_IMEAbility_0001', 0, async function (done) { it('SUB_InputMethod_IMEAbility_0001', 0, async function (done) {
console.info('----------SUB_InputMethod_IMEAbility_0001 start-------------'); console.info('====>----------SUB_InputMethod_IMEAbility_0001 start-------------');
let imExtAbilityProperty = { let imExtAbilityProperty = {
packageName : "com.acts.imeability.test", packageName : "com.acts.imeability.test",
methodId : "com.acts.imeability.test.ImExtAbility", methodId : "com.acts.imeability.test.ImExtAbility",
...@@ -70,11 +70,11 @@ export default function imeAbilityTest(abilityContext) { ...@@ -70,11 +70,11 @@ export default function imeAbilityTest(abilityContext) {
} }
inputMethod.switchInputMethod(imExtAbilityProperty).then((data)=>{ inputMethod.switchInputMethod(imExtAbilityProperty).then((data)=>{
console.info('SUB_InputMethod_IMEAbility_0004 switchInputMethod to IME :' + data); console.info('====>SUB_InputMethod_IMEAbility_0004 switchInputMethod to IME :' + data);
expect(data == true).assertTrue(); expect(data == true).assertTrue();
}); });
sleep(Date.now(), 3000); sleep(Date.now(), 3000);
console.info('----------SUB_InputMethod_IMEAbility_0001 end-------------'); console.info('====>----------SUB_InputMethod_IMEAbility_0001 end-------------');
done(); done();
}) })
...@@ -87,7 +87,7 @@ export default function imeAbilityTest(abilityContext) { ...@@ -87,7 +87,7 @@ export default function imeAbilityTest(abilityContext) {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SUB_InputMethod_IMEAbility_0002', 0, async function (done) { it('SUB_InputMethod_IMEAbility_0002', 0, async function (done) {
console.info('-----------SUB_InputMethod_IMEAbility_0002 start-------------'); console.info('====>-----------SUB_InputMethod_IMEAbility_0002 start-------------');
let imExtAbilityProperty = { let imExtAbilityProperty = {
packageName : "com.acts.imeability.test", packageName : "com.acts.imeability.test",
...@@ -98,11 +98,11 @@ export default function imeAbilityTest(abilityContext) { ...@@ -98,11 +98,11 @@ export default function imeAbilityTest(abilityContext) {
} }
inputMethod.switchInputMethod(imExtAbilityProperty).then((data)=>{ inputMethod.switchInputMethod(imExtAbilityProperty).then((data)=>{
console.info('SUB_InputMethod_IMEAbility_0004 switchInputMethod to IME :' + data); console.info('====>SUB_InputMethod_IMEAbility_0004 switchInputMethod to IME :' + data);
expect(data == true).assertTrue(); expect(data == true).assertTrue();
}); });
sleep(Date.now(), 2500); sleep(Date.now(), 2500);
console.info('-----------SUB_InputMethod_IMEAbility_0002 end-------------'); console.info('====>-----------SUB_InputMethod_IMEAbility_0002 end-------------');
done(); done();
}) })
}) })
......
...@@ -34,9 +34,9 @@ export default class Utils { ...@@ -34,9 +34,9 @@ export default class Utils {
static getComponentRect(key) { static getComponentRect(key) {
let strJson = getInspectorByKey(key); let strJson = getInspectorByKey(key);
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[getInspectorByKey] current component obj is: " + JSON.stringify(obj)); console.info("====>[getInspectorByKey] current component obj is: " + JSON.stringify(obj));
let rectInfo = JSON.parse('[' + obj.$rect + ']') let rectInfo = JSON.parse('[' + obj.$rect + ']')
console.info("[getInspectorByKey] rectInfo is: " + rectInfo); console.info("====>[getInspectorByKey] rectInfo is: " + rectInfo);
this.rect_left = JSON.parse('[' + rectInfo[0] + ']')[0] this.rect_left = JSON.parse('[' + rectInfo[0] + ']')[0]
this.rect_top = JSON.parse('[' + rectInfo[0] + ']')[1] this.rect_top = JSON.parse('[' + rectInfo[0] + ']')[1]
this.rect_right = JSON.parse('[' + rectInfo[1] + ']')[0] this.rect_right = JSON.parse('[' + rectInfo[1] + ']')[0]
...@@ -47,12 +47,12 @@ export default class Utils { ...@@ -47,12 +47,12 @@ export default class Utils {
} }
static async swipe(downX, downY, upX, upY, steps) { static async swipe(downX, downY, upX, upY, steps) {
console.info('start to swipe') console.info('====>start to swipe')
this.drags(downX, downY, upX, upY, steps, false) this.drags(downX, downY, upX, upY, steps, false)
} }
static async drag(downX, downY, upX, upY, steps) { static async drag(downX, downY, upX, upY, steps) {
console.info('start to drag') console.info('====>start to drag')
this.drags(downX, downY, upX, upY, steps, true) this.drags(downX, downY, upX, upY, steps, true)
} }
...@@ -70,16 +70,16 @@ export default class Utils { ...@@ -70,16 +70,16 @@ export default class Utils {
} }
xStep = (upX - downX) / swipeSteps; xStep = (upX - downX) / swipeSteps;
yStep = (upY - downY) / swipeSteps; yStep = (upY - downY) / swipeSteps;
console.info('move step is: ' + 'xStep: ' + xStep + ' yStep: ' + yStep) console.info('====>move step is: ' + 'xStep: ' + xStep + ' yStep: ' + yStep)
let downPonit: TouchObject = { let downPonit: TouchObject = {
id: 1, id: 1,
x: downX, x: downX,
y: downY, y: downY,
type: TouchType.Down, type: TouchType.Down,
} }
console.info('down touch started: ' + JSON.stringify(downPonit)) console.info('====>down touch started: ' + JSON.stringify(downPonit))
sendTouchEvent(downPonit); sendTouchEvent(downPonit);
console.info('start to move') console.info('====>start to move')
if (drag) { if (drag) {
await this.sleep(500) await this.sleep(500)
} }
...@@ -90,14 +90,14 @@ export default class Utils { ...@@ -90,14 +90,14 @@ export default class Utils {
y: downY + (yStep * i), y: downY + (yStep * i),
type: TouchType.Move type: TouchType.Move
} }
console.info('move touch started: ' + JSON.stringify(movePoint)) console.info('====>move touch started: ' + JSON.stringify(movePoint))
ret = sendTouchEvent(movePoint) ret = sendTouchEvent(movePoint)
if (ret == false) { if (ret == false) {
break; break;
} }
await this.sleep(5) await this.sleep(5)
} }
console.info('start to up') console.info('====>start to up')
if (drag) { if (drag) {
await this.sleep(100) await this.sleep(100)
} }
...@@ -107,7 +107,7 @@ export default class Utils { ...@@ -107,7 +107,7 @@ export default class Utils {
y: upY, y: upY,
type: TouchType.Up, type: TouchType.Up,
} }
console.info('up touch started: ' + JSON.stringify(upPoint)) console.info('====>up touch started: ' + JSON.stringify(upPoint))
sendTouchEvent(upPoint) sendTouchEvent(upPoint)
await this.sleep(500) await this.sleep(500)
} }
......
...@@ -17,12 +17,12 @@ import inputMethod from '@ohos.inputmethod'; ...@@ -17,12 +17,12 @@ import inputMethod from '@ohos.inputmethod';
export default function inputMethodJSUnit() { export default function inputMethodJSUnit() {
describe('appInfoTest_input_2', function () { describe('appInfoTest_input_2', function () {
console.info("************* settings Test start*************"); console.info("====>************* settings Test start*************");
it('inputmethoh_test_001', 0, async function (done) { it('inputmethoh_test_001', 0, async function (done) {
let inputMethodSetting = inputMethod.getInputMethodSetting(); let inputMethodSetting = inputMethod.getInputMethodSetting();
console.info("inputmethoh_test_001 result:" + JSON.stringify(inputMethodSetting)); console.info("====>inputmethoh_test_001 result:" + JSON.stringify(inputMethodSetting));
inputMethodSetting.listInputMethod((arr) => { inputMethodSetting.listInputMethod((arr) => {
console.info("appInfoTest_input_2 listInputMethod result---" + JSON.stringify(arr)); console.info("====>appInfoTest_input_2 listInputMethod result---" + JSON.stringify(arr));
expect(1==1).assertTrue(); expect(1==1).assertTrue();
}); });
done(); done();
...@@ -30,40 +30,40 @@ export default function inputMethodJSUnit() { ...@@ -30,40 +30,40 @@ export default function inputMethodJSUnit() {
it('inputmethoh_test_002', 0, async function (done) { it('inputmethoh_test_002', 0, async function (done) {
let inputMethodSetting = inputMethod.getInputMethodSetting(); let inputMethodSetting = inputMethod.getInputMethodSetting();
console.info("inputmethoh_test_002 result:" + JSON.stringify(inputMethodSetting)); console.info("====>inputmethoh_test_002 result:" + JSON.stringify(inputMethodSetting));
inputMethodSetting.listInputMethod().then(inputMethodProperty => { inputMethodSetting.listInputMethod().then(inputMethodProperty => {
if (inputMethodProperty.length > 0){ if (inputMethodProperty.length > 0){
let obj = inputMethodProperty[0] let obj = inputMethodProperty[0]
console.info("inputmethoh_test_002 listInputMethod obj---" + JSON.stringify(obj)); console.info("====>inputmethoh_test_002 listInputMethod obj---" + JSON.stringify(obj));
expect(obj.packageName != null).assertTrue(); expect(obj.packageName != null).assertTrue();
expect(obj.methodId != null).assertTrue(); expect(obj.methodId != null).assertTrue();
}else{ }else{
console.info("inputmethoh_test_002 listInputMethod is null"); console.info("====>inputmethoh_test_002 listInputMethod is null");
expect().assertFail() expect().assertFail()
} }
}).catch(err => { }).catch(err => {
console.info("inputmethoh_test_002 listInputMethod is err: " + JSON.stringify(err)); console.info("====>inputmethoh_test_002 listInputMethod is err: " + JSON.stringify(err));
}); });
done(); done();
}); });
it('inputmethoh_test_003', 0, async function (done) { it('inputmethoh_test_003', 0, async function (done) {
let inputMethodSetting = inputMethod.getInputMethodSetting(); let inputMethodSetting = inputMethod.getInputMethodSetting();
console.info("inputmethoh_test_003 result:" + JSON.stringify(inputMethodSetting)); console.info("====>inputmethoh_test_003 result:" + JSON.stringify(inputMethodSetting));
inputMethodSetting.displayOptionalInputMethod(() => { inputMethodSetting.displayOptionalInputMethod(() => {
console.info("inputmethoh_test_003 displayOptionalInputMethod---"); console.info("====>inputmethoh_test_003 displayOptionalInputMethod---");
}); });
done(); done();
}); });
it('inputmethoh_test_004', 0, async function (done) { it('inputmethoh_test_004', 0, async function (done) {
let inputMethodSetting = inputMethod.getInputMethodSetting(); let inputMethodSetting = inputMethod.getInputMethodSetting();
console.info("inputmethoh_test_004 result:" + JSON.stringify(inputMethodSetting)); console.info("====>inputmethoh_test_004 result:" + JSON.stringify(inputMethodSetting));
inputMethodSetting.displayOptionalInputMethod().then(() => { inputMethodSetting.displayOptionalInputMethod().then(() => {
console.info("inputmethoh_test_004 displayOptionalInputMethod is called"); console.info("====>inputmethoh_test_004 displayOptionalInputMethod is called");
expect(true).assertTrue() expect(true).assertTrue()
}).catch(err => { }).catch(err => {
console.info("inputmethoh_test_004 displayOptionalInputMethod is err: " + JSON.stringify(err)); console.info("====>inputmethoh_test_004 displayOptionalInputMethod is err: " + JSON.stringify(err));
expect().assertFail() expect().assertFail()
}); });
done(); done();
...@@ -71,24 +71,24 @@ export default function inputMethodJSUnit() { ...@@ -71,24 +71,24 @@ export default function inputMethodJSUnit() {
it('inputmethoh_test_005', 0, async function (done) { it('inputmethoh_test_005', 0, async function (done) {
let inputMethodCtrl = inputMethod.getInputMethodController(); let inputMethodCtrl = inputMethod.getInputMethodController();
console.info("inputmethoh_test_005 result:" + JSON.stringify(inputMethodCtrl)); console.info("====>inputmethoh_test_005 result:" + JSON.stringify(inputMethodCtrl));
inputMethodCtrl.stopInput((res) => { inputMethodCtrl.stopInput((res) => {
console.info("inputmethoh_test_005 stopInput result----" + res); console.info("====>inputmethoh_test_005 stopInput result----" + res);
}); });
done(); done();
}); });
it('inputmethoh_test_006', 0, async function (done) { it('inputmethoh_test_006', 0, async function (done) {
let inputMethodCtrl = inputMethod.getInputMethodController(); let inputMethodCtrl = inputMethod.getInputMethodController();
console.info("inputmethoh_test_006 result:" + JSON.stringify(inputMethodCtrl)); console.info("====>inputmethoh_test_006 result:" + JSON.stringify(inputMethodCtrl));
inputMethodCtrl.stopInput().then(data => { inputMethodCtrl.stopInput().then(() => {
console.info("inputmethoh_test_006 stopInput result----" + data);
expect(data == true).assertTrue();
}).catch(err => {
console.info("inputmethoh_test_006 stopInput is err: " + JSON.stringify(err));
expect().assertFail(); expect().assertFail();
done();
}).catch((err) => {
console.info("====>inputmethoh_test_006 stopInput is err: " + JSON.stringify(err));
expect().assertEqual();
done();
}); });
done();
}); });
/* /*
...@@ -97,11 +97,11 @@ export default function inputMethodJSUnit() { ...@@ -97,11 +97,11 @@ export default function inputMethodJSUnit() {
* @tc.desc: Verify Max_ TYPE_ NUM * @tc.desc: Verify Max_ TYPE_ NUM
*/ */
it('inputmethod_test_MAX_TYPE_NUM_001', 0, async function (done) { it('inputmethod_test_MAX_TYPE_NUM_001', 0, async function (done) {
console.info("************* inputmethod_test_MAX_TYPE_NUM_001 Test start*************"); console.info("====>************* inputmethod_test_MAX_TYPE_NUM_001 Test start*************");
let inputMethodSetting = inputMethod.MAX_TYPE_NUM; let inputMethodSetting = inputMethod.MAX_TYPE_NUM;
console.info("inputmethod_test_001 result:" + inputMethodSetting); console.info("====>inputmethod_test_001 result:" + inputMethodSetting);
expect(inputMethodSetting != null).assertTrue(); expect(inputMethodSetting !== null).assertTrue();
console.info("************* inputmethod_test_MAX_TYPE_NUM_001 Test end*************"); console.info("====>************* inputmethod_test_MAX_TYPE_NUM_001 Test end*************");
done(); done();
}); });
...@@ -112,7 +112,7 @@ export default function inputMethodJSUnit() { ...@@ -112,7 +112,7 @@ export default function inputMethodJSUnit() {
* @tc.level 2 * @tc.level 2
*/ */
it('inputmethod_test_switchInputMethod_001', 0, async function (done) { it('inputmethod_test_switchInputMethod_001', 0, async function (done) {
console.info("************* inputmethod_test_switchInputMethod_001 Test start*************"); console.info("====>************* inputmethod_test_switchInputMethod_001 Test start*************");
let inputMethodProperty = { let inputMethodProperty = {
packageName: "com.example.kikakeyboard", packageName: "com.example.kikakeyboard",
methodId: "ServiceExtAbility", methodId: "ServiceExtAbility",
...@@ -121,13 +121,13 @@ export default function inputMethodJSUnit() { ...@@ -121,13 +121,13 @@ export default function inputMethodJSUnit() {
extra:{} extra:{}
} }
inputMethod.switchInputMethod(inputMethodProperty).then(data => { inputMethod.switchInputMethod(inputMethodProperty).then(data => {
console.info("inputmethod_test_switchInputMethod_001 data:" + data) console.info("====>inputmethod_test_switchInputMethod_001 data:" + data)
expect(data == true).assertTrue(); expect(data == true).assertTrue();
}).catch( err=> { }).catch( err=> {
console.info("inputmethod_test_switchInputMethod_001 err:" + err) console.info("====>inputmethod_test_switchInputMethod_001 err:" + err)
expect().assertFail(); expect().assertFail();
}) })
console.info("************* inputmethod_test_switchInputMethod_001 Test end*************"); console.info("====>************* inputmethod_test_switchInputMethod_001 Test end*************");
done(); done();
}); });
...@@ -138,7 +138,7 @@ export default function inputMethodJSUnit() { ...@@ -138,7 +138,7 @@ export default function inputMethodJSUnit() {
* @tc.level 2 * @tc.level 2
*/ */
it('inputmethod_test_switchInputMethod_002', 0, async function (done) { it('inputmethod_test_switchInputMethod_002', 0, async function (done) {
console.info("************* inputmethod_test_switchInputMethod_002 Test start*************"); console.info("====>************* inputmethod_test_switchInputMethod_002 Test start*************");
let inputMethodProperty = { let inputMethodProperty = {
packageName: "com.example.kikakeyboard", packageName: "com.example.kikakeyboard",
methodId: "ServiceExtAbility", methodId: "ServiceExtAbility",
...@@ -148,13 +148,13 @@ export default function inputMethodJSUnit() { ...@@ -148,13 +148,13 @@ export default function inputMethodJSUnit() {
} }
inputMethod.switchInputMethod(inputMethodProperty, (err, data)=>{ inputMethod.switchInputMethod(inputMethodProperty, (err, data)=>{
if(err){ if(err){
console.info("inputmethod_test_switchInputMethod_002 error:" + err); console.info("====>inputmethod_test_switchInputMethod_002 error:" + err);
expect().assertFail(); expect().assertFail();
} }
console.info("inputmethod_test_switchInputMethod_002 data:" + data) console.info("====>inputmethod_test_switchInputMethod_002 data:" + data)
expect(data == true).assertTrue(); expect(data == true).assertTrue();
}); });
console.info("************* inputmethod_test_switchInputMethod_002 Test end*************"); console.info("====>************* inputmethod_test_switchInputMethod_002 Test end*************");
done(); done();
}); });
...@@ -166,17 +166,16 @@ export default function inputMethodJSUnit() { ...@@ -166,17 +166,16 @@ export default function inputMethodJSUnit() {
*/ */
it('inputmethod_test_showSoftKeyboard_001', 0, async function (done) { it('inputmethod_test_showSoftKeyboard_001', 0, async function (done) {
let inputMethodCtrl = inputMethod.getInputMethodController() let inputMethodCtrl = inputMethod.getInputMethodController()
inputMethodCtrl.showSoftKeyboard((err, data)=>{ try{
if(data == undefined){ inputMethodCtrl.showSoftKeyboard((err)=>{
console.info("showSoftKeyboard callbace success" ); expect(err.code).assertEqual('12800003')
expect(true).assertTrue(); console.info("====>************* inputmethod_test_showSoftKeyboard_001 Test end*************");
}else{ done();
console.info('showSoftKeyboard callbace failed : ' + JSON.stringify(err)) });
expect().assertFail(); }catch(err){
} expect().assertFail()
}); done();
console.info("************* inputmethod_test_showSoftKeyboard_001 Test end*************"); }
done();
}); });
/* /*
...@@ -187,15 +186,15 @@ export default function inputMethodJSUnit() { ...@@ -187,15 +186,15 @@ export default function inputMethodJSUnit() {
*/ */
it('inputmethod_test_showSoftKeyboard_002', 0, async function (done) { it('inputmethod_test_showSoftKeyboard_002', 0, async function (done) {
let inputMethodCtrl = inputMethod.getInputMethodController() let inputMethodCtrl = inputMethod.getInputMethodController()
inputMethodCtrl.showSoftKeyboard().then((data) =>{ inputMethodCtrl.showSoftKeyboard().then(() =>{
console.info("showSoftKeyboard promise success" ); expect().assertFail()
expect(true).assertTrue(); done();
}).catch((err) => { }).catch((err) => {
console.info('showSoftKeyboard promise failed : ' + JSON.stringify(err)) console.info('====>showSoftKeyboard promise failed : ' + JSON.stringify(err))
expect().assertFail(); expect(err.code).assertEqual('12800003')
console.info("====>************* inputmethod_test_showSoftKeyboard_002 Test end*************");
done();
}) })
console.info("************* inputmethod_test_showSoftKeyboard_002 Test end*************");
done();
}); });
/* /*
...@@ -206,17 +205,17 @@ export default function inputMethodJSUnit() { ...@@ -206,17 +205,17 @@ export default function inputMethodJSUnit() {
*/ */
it('inputmethod_test_hideSoftKeyboard_001', 0, async function (done) { it('inputmethod_test_hideSoftKeyboard_001', 0, async function (done) {
let inputMethodCtrl = inputMethod.getInputMethodController() let inputMethodCtrl = inputMethod.getInputMethodController()
inputMethodCtrl.hideSoftKeyboard((err, data)=>{ try{
if(data == undefined){ inputMethodCtrl.hideSoftKeyboard((err)=>{
console.info("hideSoftKeyboard callbace success" ); console.info('====>hideSoftKeyboard callbacek failed : ' + JSON.stringify(err))
expect(true).assertTrue(); expect(err.code).assertEqual('12800003')
}else{ console.info("====>************* inputmethod_test_hideSoftKeyboard_001 Test end*************");
console.info('hideSoftKeyboard callbace failed : ' + JSON.stringify(err)) done();
expect().assertFail(); })
} }catch(err){
}); expect().assertFail();
console.info("************* inputmethod_test_hideSoftKeyboard_001 Test end*************"); done();
done(); }
}); });
/* /*
...@@ -227,15 +226,15 @@ export default function inputMethodJSUnit() { ...@@ -227,15 +226,15 @@ export default function inputMethodJSUnit() {
*/ */
it('inputmethod_test_hideSoftKeyboard_002', 0, async function (done) { it('inputmethod_test_hideSoftKeyboard_002', 0, async function (done) {
let inputMethodCtrl = inputMethod.getInputMethodController() let inputMethodCtrl = inputMethod.getInputMethodController()
inputMethodCtrl.hideSoftKeyboard().then((data) =>{ inputMethodCtrl.hideSoftKeyboard().then(() =>{
console.info("hideSoftKeyboard promise success" );
expect(true).assertTrue();
}).catch((err) => {
console.info('hideSoftKeyboard promise failed : ' + JSON.stringify(err))
expect().assertFail(); expect().assertFail();
done();
}).catch((err) => {
console.info('====>hideSoftKeyboard promise failed : ' + JSON.stringify(err))
expect(err.code).assertEqual('12800003');
console.info("====>************* inputmethod_test_hideSoftKeyboard_002 Test end*************");
done();
}) })
console.info("************* inputmethod_test_hideSoftKeyboard_002 Test end*************");
done();
}); });
/* /*
...@@ -246,12 +245,12 @@ export default function inputMethodJSUnit() { ...@@ -246,12 +245,12 @@ export default function inputMethodJSUnit() {
*/ */
it('inputmethod_test_getCurrentInputMethod_001', 0, async function (done) { it('inputmethod_test_getCurrentInputMethod_001', 0, async function (done) {
let currentIme = inputMethod.getCurrentInputMethod(); let currentIme = inputMethod.getCurrentInputMethod();
console.info("inputmethod_test_getCurrentInputMethod_001 currentIme---" + JSON.stringify(currentIme)); console.info("====>inputmethod_test_getCurrentInputMethod_001 currentIme---" + JSON.stringify(currentIme));
console.info(currentIme.packageName); console.info(currentIme.packageName);
console.info(currentIme.methodId); console.info(currentIme.methodId);
expect(currentIme.packageName != null).assertTrue(); expect(currentIme.packageName !== null).assertTrue();
expect(currentIme.methodId != null).assertTrue(); expect(currentIme.methodId !== null).assertTrue();
console.info("************* inputmethod_test_getCurrentInputMethod_001 Test end*************"); console.info("====>************* inputmethod_test_getCurrentInputMethod_001 Test end*************");
done(); done();
}); });
...@@ -264,13 +263,13 @@ export default function inputMethodJSUnit() { ...@@ -264,13 +263,13 @@ export default function inputMethodJSUnit() {
*/ */
it('inputmethod_test_getInputMethods_001', 0, async function (done) { it('inputmethod_test_getInputMethods_001', 0, async function (done) {
let inputMethodSetting = inputMethod.getInputMethodSetting(); let inputMethodSetting = inputMethod.getInputMethodSetting();
console.info("inputmethod_test_getInputMethods_001 result:" + JSON.stringify(inputMethodSetting)); console.info("====>inputmethod_test_getInputMethods_001 result:" + JSON.stringify(inputMethodSetting));
inputMethodSetting.getInputMethods(true, (err, arr) => { inputMethodSetting.getInputMethods(true, (err, arr) => {
if (err) { if (err) {
console.error("inputmethod_test_getInputMethods_001 failed because: " + JSON.stringify(err)); console.error("inputmethod_test_getInputMethods_001 failed because: " + JSON.stringify(err));
expect().assertFail(); expect().assertFail();
}; };
console.info("inputmethod_test_getInputMethods_001 listInputMethod result---" + JSON.stringify(arr)); console.info("====>inputmethod_test_getInputMethods_001 listInputMethod result---" + JSON.stringify(arr));
expect(arr != null).assertTrue(); expect(arr != null).assertTrue();
}); });
done(); done();
...@@ -285,13 +284,13 @@ export default function inputMethodJSUnit() { ...@@ -285,13 +284,13 @@ export default function inputMethodJSUnit() {
*/ */
it('inputmethod_test_getInputMethods_002', 0, async function (done) { it('inputmethod_test_getInputMethods_002', 0, async function (done) {
let inputMethodSetting = inputMethod.getInputMethodSetting(); let inputMethodSetting = inputMethod.getInputMethodSetting();
console.info("inputmethod_test_getInputMethods_002 result:" + JSON.stringify(inputMethodSetting)); console.info("====>inputmethod_test_getInputMethods_002 result:" + JSON.stringify(inputMethodSetting));
inputMethodSetting.getInputMethods(false, (err, arr) => { inputMethodSetting.getInputMethods(false, (err, arr) => {
if (err) { if (err) {
console.error("inputmethod_test_getInputMethods_002 failed because: " + JSON.stringify(err)); console.error("inputmethod_test_getInputMethods_002 failed because: " + JSON.stringify(err));
expect().assertFail(); expect().assertFail();
}; };
console.info("inputmethod_test_getInputMethods_002 listInputMethod result---" + JSON.stringify(arr)); console.info("====>inputmethod_test_getInputMethods_002 listInputMethod result---" + JSON.stringify(arr));
expect(arr != null).assertTrue(); expect(arr != null).assertTrue();
}); });
done(); done();
......
...@@ -18,7 +18,7 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from " ...@@ -18,7 +18,7 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
export default function requestSystemJSUnit() { export default function requestSystemJSUnit() {
describe('requestSystemJSUnit', function () { describe('requestSystemJSUnit', function () {
console.info('****************start requestSystemTest*****************') console.info('====>****************start requestSystemTest*****************')
/** /**
* @tc.name: ohos.SUB_REQUESTSYSTEM_UPLOAD_API_0001 * @tc.name: ohos.SUB_REQUESTSYSTEM_UPLOAD_API_0001
...@@ -28,7 +28,7 @@ export default function requestSystemJSUnit() { ...@@ -28,7 +28,7 @@ export default function requestSystemJSUnit() {
* @tc.level: Level 1 * @tc.level: Level 1
*/ */
it('SUB_REQUESTSYSTEM_UPLOAD_API_0001', 0, async function (done) { it('SUB_REQUESTSYSTEM_UPLOAD_API_0001', 0, async function (done) {
console.info("-----------------------SUB_REQUESTSYSTEM_UPLOAD_API_0001 start-----------------------"); console.info("====>-----------------------SUB_REQUESTSYSTEM_UPLOAD_API_0001 start-----------------------");
let UploadResponse = { let UploadResponse = {
code: 200, code: 200,
data: '', data: '',
...@@ -52,23 +52,23 @@ export default function requestSystemJSUnit() { ...@@ -52,23 +52,23 @@ export default function requestSystemJSUnit() {
}, },
], ],
success: function(UploadResponse) { success: function(UploadResponse) {
console.info('SUB_REQUESTSYSTEM_UPLOAD_API_0001 upload success, code:' + UploadResponse.code); console.info('====>SUB_REQUESTSYSTEM_UPLOAD_API_0001 upload success, code:' + UploadResponse.code);
}, },
fail: function(data, code) { fail: function(data, code) {
console.info('SUB_REQUESTSYSTEM_UPLOAD_API_0001 upload fail'); console.info('====>SUB_REQUESTSYSTEM_UPLOAD_API_0001 upload fail');
}, },
complete: function (){ complete: function (){
console.info('SUB_REQUESTSYSTEM_UPLOAD_API_0001 upload complete'); console.info('====>SUB_REQUESTSYSTEM_UPLOAD_API_0001 upload complete');
} }
} }
try{ try{
let result = request.upload(UploadRequestOptions); let result = request.upload(UploadRequestOptions);
console.info('SUB_REQUESTSYSTEM_UPLOAD_API_0001 upload err:' + result); console.info('====>SUB_REQUESTSYSTEM_UPLOAD_API_0001 upload err:' + result);
expect(true).assertEqual(true); expect(true).assertEqual(true);
}catch(err){ }catch(err){
console.info('SUB_REQUESTSYSTEM_UPLOAD_API_0001 upload err:' + err); console.info('====>SUB_REQUESTSYSTEM_UPLOAD_API_0001 upload err:' + err);
} }
console.info("-----------------------SUB_REQUESTSYSTEM_UPLOAD_API_0001 end-----------------------"); console.info("====>-----------------------SUB_REQUESTSYSTEM_UPLOAD_API_0001 end-----------------------");
done(); done();
}); });
...@@ -80,7 +80,7 @@ export default function requestSystemJSUnit() { ...@@ -80,7 +80,7 @@ export default function requestSystemJSUnit() {
* @tc.level: Level 1 * @tc.level: Level 1
*/ */
it('SUB_REQUESTSYSTEM_DOWNLOAD_API_0001', 0, async function (done) { it('SUB_REQUESTSYSTEM_DOWNLOAD_API_0001', 0, async function (done) {
console.info("-----------------------SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 start-----------------------"); console.info("====>-----------------------SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 start-----------------------");
let DownloadResponse = { let DownloadResponse = {
token: "Hm_lpvt_1d6c34c1bc067f5746a5fca18d1c24ab" token: "Hm_lpvt_1d6c34c1bc067f5746a5fca18d1c24ab"
} }
...@@ -91,23 +91,23 @@ export default function requestSystemJSUnit() { ...@@ -91,23 +91,23 @@ export default function requestSystemJSUnit() {
header: '', header: '',
description: 'this is requeSystem download response', description: 'this is requeSystem download response',
success: function(DownloadResponse) { success: function(DownloadResponse) {
console.info('SUB_REQUESTSYSTEM_DOWNLOAD_API_0001call success callback success: ' + DownloadResponse.token); console.info('====>SUB_REQUESTSYSTEM_DOWNLOAD_API_0001call success callback success: ' + DownloadResponse.token);
}, },
fail: function(data, code) { fail: function(data, code) {
console.info('SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 handling fail'); console.info('====>SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 handling fail');
}, },
complete: function (){ complete: function (){
console.info('SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 download complete'); console.info('====>SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 download complete');
} }
} }
try{ try{
let result = request.download(DownloadRequestOptions); let result = request.download(DownloadRequestOptions);
console.info('SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 upload err:' + result); console.info('====>SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 upload err:' + result);
expect(result == null).assertEqual(true); expect(result == null).assertEqual(true);
}catch(err){ }catch(err){
console.info('SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 download complete' + err); console.info('====>SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 download complete' + err);
} }
console.info("-----------------------SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 end-----------------------"); console.info("====>-----------------------SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 end-----------------------");
done(); done();
}); });
...@@ -119,27 +119,27 @@ export default function requestSystemJSUnit() { ...@@ -119,27 +119,27 @@ export default function requestSystemJSUnit() {
* @tc.level: Level 1 * @tc.level: Level 1
*/ */
it('SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001', 0, async function (done) { it('SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001', 0, async function (done) {
console.info("-----------------------SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 start-----------------------"); console.info("====>-----------------------SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 start-----------------------");
let OnDownloadCompleteResponse = { let OnDownloadCompleteResponse = {
uri: "http://www.path.com" uri: "http://www.path.com"
} }
let OnDownloadCompleteOptions = { let OnDownloadCompleteOptions = {
token: 'token-index', token: 'token-index',
success: function(OnDownloadCompleteResponse) { success: function(OnDownloadCompleteResponse) {
console.info('SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 download success,uri:' console.info('====>SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 download success,uri:'
+ OnDownloadCompleteResponse.uri); + OnDownloadCompleteResponse.uri);
}, },
fail: function(data, code) { fail: function(data, code) {
console.info('SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 download fail'); console.info('====>SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 download fail');
}, },
complete: function (){ complete: function (){
console.info('SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 download complete'); console.info('====>SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 download complete');
} }
} }
let result = request.onDownloadComplete(OnDownloadCompleteOptions); let result = request.onDownloadComplete(OnDownloadCompleteOptions);
console.info('SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 upload err:' + result); console.info('====>SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 upload err:' + result);
expect(result == null).assertEqual(true); expect(result == null).assertEqual(true);
console.info("-----------------------SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 end-----------------------"); console.info("====>-----------------------SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 end-----------------------");
done(); done();
}); });
}) })
......
...@@ -18,6 +18,7 @@ group("storage") { ...@@ -18,6 +18,7 @@ group("storage") {
deps = [ deps = [
"storagefileioerrorjstest:storagefileioerror_js_test", "storagefileioerrorjstest:storagefileioerror_js_test",
"storagefileiojstest:storagefileio_js_test", "storagefileiojstest:storagefileio_js_test",
"storagefileiov9jstest:storagefileiov9_js_test",
"storagefilejstest:storagefile_js_test", "storagefilejstest:storagefile_js_test",
"storagesecuritylabeljstest:storagesecuritylabel_js_test", "storagesecuritylabeljstest:storagesecuritylabel_js_test",
"storagestatfsjstest:storagestatfs_js_test", "storagestatfsjstest:storagestatfs_js_test",
......
# Copyright (C) 2021 Huawei Device Co., Ltd. # Copyright (C) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
...@@ -10,25 +10,26 @@ ...@@ -10,25 +10,26 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
ohos_hap_assist_suite("ActsRpcJsServer") { ohos_js_hap_suite("storagefileiov9_js_test") {
hap_profile = "./src/main/config.json" hap_profile = "./src/main/config.json"
deps = [ deps = [
":rpc_js_assets", ":storagefileiov9_js_assets",
":rpc_js_resources", ":storagefileiov9_js_resources",
] ]
certificate_profile = "./signature/openharmony_sx.p7b" certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsRpcHapServer" hap_name = "ActsStorageFileIoV9JSTest"
subsystem_name = "communication" subsystem_name = "filemanagement"
part_name = "ipc" part_name = "file_api"
} }
ohos_js_assets("rpc_js_assets") { ohos_js_assets("storagefileiov9_js_assets") {
source_dir = "./src/main/js" js2abc = true
hap_profile = "./src/main/config.json" hap_profile = "./src/main/config.json"
source_dir = "./src/main/js"
} }
ohos_resources("rpc_js_resources") { ohos_resources("storagefileiov9_js_resources") {
sources = [ "./src/main/resources" ] sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json" hap_profile = "./src/main/config.json"
} }
{
"description": "Configuration for storage filefs Tests",
"driver": {
"type": "OHJSUnitTest",
"test-timeout": "600000",
"shell-timeout": "600000",
"bundle-name": "ohos.acts.storage.fileiov9",
"package-name": "ohos.acts.storage.fileiov9"
},
"kits": [
{
"test-file-name": ["ActsStorageFileIoV9JSTest.hap"],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
\ No newline at end of file
{
"app": {
"bundleName": "ohos.acts.storage.fileiov9",
"vendor": "example",
"version": {
"code": 1000000,
"name": "1.0.0"
},
"apiVersion": {
"compatible": 4,
"target": 5
}
},
"deviceConfig": {},
"module": {
"package": "ohos.acts.storage.fileiov9",
"name": ".entry",
"deviceType": [
"default",
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": true
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"orientation": "unspecified",
"formsEnabled": false,
"name": ".MainAbility",
"srcLanguage": "js",
"srcPath": "MainAbility",
"icon": "$media:icon",
"description": "$string:MainAbility_desc",
"label": "$string:MainAbility_label",
"type": "page",
"visible": true,
"launchType": "standard"
},
{
"orientation": "unspecified",
"formsEnabled": false,
"name": ".TestAbility",
"srcLanguage": "js",
"srcPath": "TestAbility",
"icon": "$media:icon",
"description": "$string:TestAbility_desc",
"label": "$string:TestAbility_label",
"type": "page",
"visible": true,
"launchType": "standard"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
},
{
"pages": [
"pages/index/index"
],
"name": ".TestAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
],
"testRunner": {
"name": "OpenHarmonyTestRunner",
"srcPath": "TestRunner"
},
"mainAbility": ".MainAbility",
"srcPath": ""
}
}
\ No newline at end of file
/* /*
* Copyright (c) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
export default { export default {
onCreate() { onCreate() {
console.info("Application onCreate"); console.info('ohos.acts.storage.fileio onCreate');
}, },
onDestroy() { onDestroy() {
console.info("Application onDestroy"); console.info('ohos.acts.storage.fileio onDestroy');
} }
}; };
{
"strings": {
"hello": "Hello",
"world": "Test"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "测试"
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 100px;
}
<div class="container" onswipe="touchMove"> <div class="container">
<text class="title"> <text class="title">
{{ $t('strings.hello') }} {{ title }} {{ $t('strings.hello') }} {{ title }}
</text> </text>
<input class="btn" type="button" value="{{ $t('strings.next') }}" onclick="onclick"></input> </div>
</div>
/* /*
* Copyright (c) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import router from '@system.router' import app from '@system.app'
export default { const injectRef = Object.getPrototypeOf(global) || global
data: { injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
title: 'World'
}, export default {
onclick: function () { data: {
router.replace({ title: ''
uri: "pages/index/index" },
}) onInit() {
} this.title = this.$t('strings.world');
} },
onShow() {
console.info('onShow finish')
},
onReady() {
},
}
<div class="container"> <div class="container">
<text class="title"> <text class="title">
{{ $t('strings.page') }} {{ $t('strings.hello') }} {{ title }}
</text> </text>
<input class="btn" type="button" value="{{ $t('strings.back') }}" onclick="onclick"></input> </div>
</div>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册