Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
4681ccfb
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
4681ccfb
编写于
9月 01, 2023
作者:
O
openharmony_ci
提交者:
Gitee
9月 01, 2023
浏览文件
操作
浏览文件
下载
差异文件
!10001 【杂散】【输入法框架】【时间时区】新增input和time同步几口用例,优化beforall函数
Merge pull request !10001 from 张育帅/master
上级
b8fd5b8d
47ca63f9
变更
17
展开全部
显示空白变更内容
内联
并排
Showing
17 changed file
with
2017 addition
and
24 deletion
+2017
-24
inputmethod/InputMethodEngine/entry/src/main/ets/InputMethodAbility/InputStageService.ts
...ntry/src/main/ets/InputMethodAbility/InputStageService.ts
+0
-1
inputmethod/InputMethodEngine/entry/src/main/ets/InputMethodAbility/KeyboardDelegate.ts
...entry/src/main/ets/InputMethodAbility/KeyboardDelegate.ts
+577
-0
inputmethod/InputMethodEngine/entry/src/main/ets/InputMethodEngine/KeyboardController.ts
...ntry/src/main/ets/InputMethodEngine/KeyboardController.ts
+1
-1
inputmethod/InputMethodEngine/entry/src/main/ets/InputMethodEngineKey/InputKeyService.ts
...ntry/src/main/ets/InputMethodEngineKey/InputKeyService.ts
+0
-1
inputmethod/InputMethodEngine/entry/src/main/ets/pages/index/index.ets
...nputMethodEngine/entry/src/main/ets/pages/index/index.ets
+10
-2
inputmethod/InputMethodEngine/entry/src/main/ets/test/inputMethodAbility.test.ets
...ngine/entry/src/main/ets/test/inputMethodAbility.test.ets
+1102
-1
inputmethod/InputMethodEngine/entry/src/main/ets/test/inputMethodEngine.test.ets
...Engine/entry/src/main/ets/test/inputMethodEngine.test.ets
+2
-2
inputmethod/InputMethodEngine/entry/src/main/ets/test/inputMethodEngineKey.test.ets
...ine/entry/src/main/ets/test/inputMethodEngineKey.test.ets
+2
-2
inputmethod/InputMethodTest_Stage/entry/src/main/ets/test/imeAbilityTest.test.ets
...est_Stage/entry/src/main/ets/test/imeAbilityTest.test.ets
+5
-2
inputmethod/InputMethodTest_ets/entry/src/main/ets/MainAbility/pages/index.ets
...odTest_ets/entry/src/main/ets/MainAbility/pages/index.ets
+10
-1
inputmethod/InputMethodTest_ets/entry/src/main/ets/test/inputMethodNormalJSUnit.test.ets
.../entry/src/main/ets/test/inputMethodNormalJSUnit.test.ets
+2
-1
inputmethod/InputMethodWindManage/entry/src/main/ets/InputMethodWindManage/InputMethodWindService.ts
.../main/ets/InputMethodWindManage/InputMethodWindService.ts
+0
-1
inputmethod/InputMethodWindManage/entry/src/main/ets/pages/index/index.ets
...MethodWindManage/entry/src/main/ets/pages/index/index.ets
+10
-1
inputmethod/InputMethodWindManage/entry/src/main/ets/test/InputMethodWindManage.test.ets
...ge/entry/src/main/ets/test/InputMethodWindManage.test.ets
+1
-1
request/newRequestAuthorityTest/entry/src/main/ets/test/requestUpload001.test.ets
...ityTest/entry/src/main/ets/test/requestUpload001.test.ets
+7
-7
time/dateTimeTest/entry/src/main/ets/test/List.test.ets
time/dateTimeTest/entry/src/main/ets/test/List.test.ets
+2
-0
time/dateTimeTest/entry/src/main/ets/test/systemDateTimeSync.test.ets
...eTest/entry/src/main/ets/test/systemDateTimeSync.test.ets
+286
-0
未找到文件。
inputmethod/InputMethodEngine/entry/src/main/ets/InputMethodAbility/InputStageService.ts
浏览文件 @
4681ccfb
...
...
@@ -25,6 +25,5 @@ export default class InputDemoService extends InputMethodExtensionAbility {
onDestroy
()
{
console
.
log
(
"
onDestroy inputStageService**
"
);
this
.
keyboardDelegate
.
onDestroy
();
}
}
\ No newline at end of file
inputmethod/InputMethodEngine/entry/src/main/ets/InputMethodAbility/KeyboardDelegate.ts
浏览文件 @
4681ccfb
此差异已折叠。
点击以展开。
inputmethod/InputMethodEngine/entry/src/main/ets/InputMethodEngine/KeyboardController.ts
浏览文件 @
4681ccfb
...
...
@@ -925,7 +925,7 @@ export class KeyboardController {
}
commoneventmanager
.
publish
(
"
inputMethodEngine_test_074
"
,
commonEventPublishData
,
this
.
publishCallback
);
clearTimeout
(
t
);
},
5
00
);
},
7
00
);
}
private
inputMethodEngine_test_076
():
void
{
...
...
inputmethod/InputMethodEngine/entry/src/main/ets/InputMethodEngineKey/InputKeyService.ts
浏览文件 @
4681ccfb
...
...
@@ -27,6 +27,5 @@ export default class InputKeyService extends InputMethodExtensionAbility {
onDestroy
()
{
console
.
log
(
"
onDestroy InputKeyService**
"
);
this
.
context
.
destroy
();
}
}
\ No newline at end of file
inputmethod/InputMethodEngine/entry/src/main/ets/pages/index/index.ets
浏览文件 @
4681ccfb
...
...
@@ -24,8 +24,15 @@ struct Index {
@State inputValue: string = 'inputMethodEngine1inputMethodEngine2inputMethodEngine3inputMethodEngine' +
'inputMethodEngine4inputMethodEngine5inputMethodEngine6inputMethodEngine7inputMethodEngine8inputMethodEn' +
'gine9inputMethodEngine10inputMethodEngine11inputMethodEngine12inputMethodEngine13inputMethodEngine14inputMet' +
'hodEngine15inputMethodEngine16inputMethodEngine17inputMethodEngine18inputMethodEngine19inputMethodEngine20inputMethodEngine21';
'hodEngine15inputMethodEngine16inputMethodEngine17inputMethodEngine18inputMethodEngine19inputMethodEngine20input' +
'MethodEngine21inputMethodEngine22inputMethodEngine23inputMethodEngine24inputMethodEngine25inputMethodEngine26inp' +
'utMethodEngine27inputMethodEngine28inputMethodEngine29inputMethodEngine30inputMethodEngine31inputMethodEngine32i' +
'nputMethodEngine33inputMethodEngine34inputMethodEngine35inputMethodEngine36inputMethodEngine37inputMethodEngine3' +
'8inputMethodEngine39inputMethodEngine40inputMethodEngine41inputMethodEngine42inputMethodEngine43inputMethodEngine' +
'44inputMethodEngine45inputMethodEngine46inputMethodEngine47inputMethodEngine48inputMethodEngine49inputMethodEngi' +
'ne50inputMethodEngine51inputMethodEngine52inputMethodEngine53inputMethodEngine54inputMethodEngine55inputMethodEngi' +
'ne5inputMethodEngine57inputMethodEngine58inputMethodEngine59inputMethodEngine60inputMethodEngine61inputMethodEn' +
'gine62inputMethodEngine63inputMethodEngine64inputMethodEngine65inputMethodEngine66';
build() {
Row() {
Column() {
...
...
@@ -34,6 +41,7 @@ struct Index {
.fontWeight(FontWeight.Bold)
.defaultFocus(true)
TextArea({ text: this.inputValue })
.height('80%')
.onChange((value: string) => {
this.inputValue = value;
})
...
...
inputmethod/InputMethodEngine/entry/src/main/ets/test/inputMethodAbility.test.ets
浏览文件 @
4681ccfb
此差异已折叠。
点击以展开。
inputmethod/InputMethodEngine/entry/src/main/ets/test/inputMethodEngine.test.ets
浏览文件 @
4681ccfb
...
...
@@ -79,8 +79,8 @@ export default function inputMethodEngineJSUnit() {
})
let
dis
=
display
.
getDefaultDisplaySync
();
let
w
=
dis
.
width
/
2
;
let
h
=
dis
.
height
/
2
;
let
w
=
dis
.
width
*
0.5
;
let
h
=
Math
.
round
(
dis
.
height
*
0.4
)
;
let
getFocusCmd
=
`uinput -T -c ${w} ${h}`
;
let
abilityDelegator
;
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
...
...
inputmethod/InputMethodEngine/entry/src/main/ets/test/inputMethodEngineKey.test.ets
浏览文件 @
4681ccfb
...
...
@@ -79,8 +79,8 @@ export default function inputMethodEngineKeyJSUnit() {
})
let
dis
=
display
.
getDefaultDisplaySync
();
let
w
=
dis
.
width
/
2
;
let
h
=
dis
.
height
/
2
;
let
w
=
dis
.
width
*
0.5
;
let
h
=
Math
.
round
(
dis
.
height
*
0.4
)
;
let
getFocusCmd
=
`uinput -T -c ${w} ${h}`
let
abilityDelegator
;
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
...
...
inputmethod/InputMethodTest_Stage/entry/src/main/ets/test/imeAbilityTest.test.ets
浏览文件 @
4681ccfb
...
...
@@ -28,25 +28,28 @@ export default function imeAbilityTest(abilityContext) {
/**
* beforeEach: Prerequisites at the test case level, which are executed before each test case is executed.
*/
beforeAll(function () {
beforeAll(function (
done
) {
let inputM = inputMethod.getCurrentInputMethod()
console.info("====>beforeAll: switchInputMethod to: " + JSON.stringify(inputM));
prop.packageName = inputM.packageName;
prop.methodId = inputM.methodId;
prop.name = inputM.packageName;
prop.id = inputM.methodId;
done();
});
/**
* afterEach: Test case-level clearance conditions, which are executed after each test case is executed.
*/
afterAll(async function () {
afterAll(async function (
done
) {
console.info('====>afterAll: switchInputMethod to origionInput.' + JSON.stringify(prop));
await inputMethod.switchInputMethod(prop).then((data)=>{
console.info('====>afterAll switchInputMethod to origionInput :' + data);
expect(data == true).assertTrue();
done();
}).catch(err =>{
console.info('====>afterAll switchInputMethod to origionInput error: ' + err);
done();
})
});
...
...
inputmethod/InputMethodTest_ets/entry/src/main/ets/MainAbility/pages/index.ets
浏览文件 @
4681ccfb
...
...
@@ -24,7 +24,15 @@ struct Index {
@State inputValue: string = 'inputMethodEngine1inputMethodEngine2inputMethodEngine3inputMethodEngine' +
'inputMethodEngine4inputMethodEngine5inputMethodEngine6inputMethodEngine7inputMethodEngine8inputMethodEn' +
'gine9inputMethodEngine10inputMethodEngine11inputMethodEngine12inputMethodEngine13inputMethodEngine14inputMet' +
'hodEngine15inputMethodEngine16inputMethodEngine17inputMethodEngine18inputMethodEngine19inputMethodEngine20inputMethodEngine21';
'hodEngine15inputMethodEngine16inputMethodEngine17inputMethodEngine18inputMethodEngine19inputMethodEngine20input' +
'MethodEngine21inputMethodEngine22inputMethodEngine23inputMethodEngine24inputMethodEngine25inputMethodEngine26inp' +
'utMethodEngine27inputMethodEngine28inputMethodEngine29inputMethodEngine30inputMethodEngine31inputMethodEngine32i' +
'nputMethodEngine33inputMethodEngine34inputMethodEngine35inputMethodEngine36inputMethodEngine37inputMethodEngine3' +
'8inputMethodEngine39inputMethodEngine40inputMethodEngine41inputMethodEngine42inputMethodEngine43inputMethodEngine' +
'44inputMethodEngine45inputMethodEngine46inputMethodEngine47inputMethodEngine48inputMethodEngine49inputMethodEngi' +
'ne50inputMethodEngine51inputMethodEngine52inputMethodEngine53inputMethodEngine54inputMethodEngine55inputMethodEngi' +
'ne5inputMethodEngine57inputMethodEngine58inputMethodEngine59inputMethodEngine60inputMethodEngine61inputMethodEn' +
'gine62inputMethodEngine63inputMethodEngine64inputMethodEngine65inputMethodEngine66';
build() {
Row() {
...
...
@@ -34,6 +42,7 @@ struct Index {
.fontWeight(FontWeight.Bold)
.defaultFocus(true)
TextArea({ text: this.inputValue })
.height('80%')
.onChange((value: string) => {
this.inputValue = value;
})
...
...
inputmethod/InputMethodTest_ets/entry/src/main/ets/test/inputMethodNormalJSUnit.test.ets
浏览文件 @
4681ccfb
...
...
@@ -26,9 +26,10 @@ export default function inputMethodNormalJSUnit() {
let getFocusCmd = '';
let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
display_info = display.getDefaultDisplaySync();
getFocusCmd = `uinput -T -c ${display_info.width*0.5} ${
display_info.height*0.5
}`;
getFocusCmd = `uinput -T -c ${display_info.width*0.5} ${
Math.round(display_info.height*0.4)
}`;
console.debug('====>runCmd info:' + getFocusCmd);
await abilityDelegator.executeShellCommand(getFocusCmd);
done();
})
/*
...
...
inputmethod/InputMethodWindManage/entry/src/main/ets/InputMethodWindManage/InputMethodWindService.ts
浏览文件 @
4681ccfb
...
...
@@ -26,6 +26,5 @@ export default class inputMethodWindService extends InputMethodExtensionAbility
onDestroy
()
{
console
.
log
(
"
onDestroy inputMethodEngine**
"
);
this
.
context
.
destroy
();
}
}
\ No newline at end of file
inputmethod/InputMethodWindManage/entry/src/main/ets/pages/index/index.ets
浏览文件 @
4681ccfb
...
...
@@ -24,7 +24,15 @@ struct Index {
@State inputValue: string = 'inputMethodEngine1inputMethodEngine2inputMethodEngine3inputMethodEngine' +
'inputMethodEngine4inputMethodEngine5inputMethodEngine6inputMethodEngine7inputMethodEngine8inputMethodEn' +
'gine9inputMethodEngine10inputMethodEngine11inputMethodEngine12inputMethodEngine13inputMethodEngine14inputMet' +
'hodEngine15inputMethodEngine16inputMethodEngine17inputMethodEngine18inputMethodEngine19inputMethodEngine20inputMethodEngine21';
'hodEngine15inputMethodEngine16inputMethodEngine17inputMethodEngine18inputMethodEngine19inputMethodEngine20input' +
'MethodEngine21inputMethodEngine22inputMethodEngine23inputMethodEngine24inputMethodEngine25inputMethodEngine26inp' +
'utMethodEngine27inputMethodEngine28inputMethodEngine29inputMethodEngine30inputMethodEngine31inputMethodEngine32i' +
'nputMethodEngine33inputMethodEngine34inputMethodEngine35inputMethodEngine36inputMethodEngine37inputMethodEngine3' +
'8inputMethodEngine39inputMethodEngine40inputMethodEngine41inputMethodEngine42inputMethodEngine43inputMethodEngine' +
'44inputMethodEngine45inputMethodEngine46inputMethodEngine47inputMethodEngine48inputMethodEngine49inputMethodEngi' +
'ne50inputMethodEngine51inputMethodEngine52inputMethodEngine53inputMethodEngine54inputMethodEngine55inputMethodEngi' +
'ne5inputMethodEngine57inputMethodEngine58inputMethodEngine59inputMethodEngine60inputMethodEngine61inputMethodEn' +
'gine62inputMethodEngine63inputMethodEngine64inputMethodEngine65inputMethodEngine66';
build() {
Row() {
...
...
@@ -34,6 +42,7 @@ struct Index {
.fontWeight(FontWeight.Bold)
.defaultFocus(true)
TextArea({ text: this.inputValue })
.height('80%')
.onChange((value: string) => {
this.inputValue = value;
})
...
...
inputmethod/InputMethodWindManage/entry/src/main/ets/test/InputMethodWindManage.test.ets
浏览文件 @
4681ccfb
...
...
@@ -40,7 +40,7 @@ export default function inputMethodWindManageAbility() {
beforeAll
(
async
(
done
)
=>
{
display_info
=
display
.
getDefaultDisplaySync
()
getFocusCmd
=
`uinput -T -c ${display_info.width*0.5} ${
display_info.height*0.5
}`
getFocusCmd
=
`uinput -T -c ${display_info.width*0.5} ${
Math.round(display_info.height*0.4)
}`
let
inputM
=
inputMethod
.
getCurrentInputMethod
()
console
.
info
(
"====>beforeAll: switchInputMethod to: "
+
JSON
.
stringify
(
inputM
));
inputServer
.
packageName
=
inputM
.
packageName
;
...
...
request/newRequestAuthorityTest/entry/src/main/ets/test/requestUpload001.test.ets
浏览文件 @
4681ccfb
...
...
@@ -768,7 +768,7 @@ export default function requestUploadOnetJSUnitTest() {
* @tc.level : Level 2
*/
it('SUB_Misc_REQUEST_Off_Upload_Completed_0010', 0, async function (done) {
console.info("====>-----------------------SUB_Misc_REQUEST_Off_Upload_Completed_00
4
0 is starting-----------------------");
console.info("====>-----------------------SUB_Misc_REQUEST_Off_Upload_Completed_00
1
0 is starting-----------------------");
let config_ = config
config_.mode = request.agent.Mode.FOREGROUND;
try {
...
...
@@ -776,11 +776,11 @@ export default function requestUploadOnetJSUnitTest() {
request.agent.create(globalThis.abilityContext, config_, async (err, task) => {
let on_offCompletedCallback = (pro) => {
flag = false;
console.info("====>SUB_Misc_REQUEST_Off_Upload_Completed_00
4
0 on_offCompletedCallback flag: " + flag);
console.info("====>SUB_Misc_REQUEST_Off_Upload_Completed_00
1
0 on_offCompletedCallback flag: " + flag);
}
try {
if(err){
console.info("====>SUB_Misc_REQUEST_Off_Upload_Completed_00
4
0 create err: " + JSON.stringify(err));
console.info("====>SUB_Misc_REQUEST_Off_Upload_Completed_00
1
0 create err: " + JSON.stringify(err));
expect().assertFail();
}
task.on('completed', on_offCompletedCallback);
...
...
@@ -789,22 +789,22 @@ export default function requestUploadOnetJSUnitTest() {
await task.start();
let t = setTimeout(async () => {
try {
console.info("====>SUB_Misc_REQUEST_Off_Upload_Completed_00
4
0 offCompleted success flag: " + flag);
console.info("====>SUB_Misc_REQUEST_Off_Upload_Completed_00
1
0 offCompleted success flag: " + flag);
clearTimeout(t);
expect(flag).assertTrue();
} catch (err) {
console.info("====>SUB_Misc_REQUEST_Off_Upload_Completed_00
4
0 offCompleted fail err: " + JSON.stringify(err));
console.info("====>SUB_Misc_REQUEST_Off_Upload_Completed_00
1
0 offCompleted fail err: " + JSON.stringify(err));
}
done();
}, 100)
} catch (err) {
console.info("====>SUB_Misc_REQUEST_Off_Upload_Completed_00
4
0 catch err: " + JSON.stringify(err));
console.info("====>SUB_Misc_REQUEST_Off_Upload_Completed_00
1
0 catch err: " + JSON.stringify(err));
await sleep(10);
done();
}
});
} catch (err) {
console.info("====>SUB_Misc_REQUEST_Off_Upload_Completed_00
4
0 create catch err: " + JSON.stringify(err));
console.info("====>SUB_Misc_REQUEST_Off_Upload_Completed_00
1
0 create catch err: " + JSON.stringify(err));
await sleep(10);
done();
}
...
...
time/dateTimeTest/entry/src/main/ets/test/List.test.ets
浏览文件 @
4681ccfb
...
...
@@ -13,7 +13,9 @@
* limitations under the License.
*/
import systemDateTimeJsunit from './systemDateTimeJsunit.test';
import systemDateTimeSync from './systemDateTimeSync.test';
export default function testsuite() {
systemDateTimeJsunit();
systemDateTimeSync();
}
\ No newline at end of file
time/dateTimeTest/entry/src/main/ets/test/systemDateTimeSync.test.ets
0 → 100644
浏览文件 @
4681ccfb
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import systemDateTime from "@ohos.systemDateTime";
export default function systemDateTimeSyncJsunit() {
describe('systemDateSyncTimeTest', function () {
console.info('====>---------------systemDateTimeTest start-----------------------');
/**
* @tc.number SUB_systemDateTime_getTime_sync_0010
* @tc.name Test systemTimeDate.getCurrentTime
* @tc.desc Obtains the number of milliseconds that have elapsed since the Unix epoch.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it("SUB_systemDateTime_getTime_sync_0010", 0, async function (done) {
console.info("====>----------SUB_systemDateTime_getTime_sync_0010 start----------------");
let currentTime = systemDateTime.getTime(true);
console.info("====>SUB_systemDateTime_getTime_sync_0010 currentTime: " + JSON.stringify(currentTime));
expect(typeof(currentTime) === 'number').assertEqual(true);
done();
console.info("====>----------SUB_systemDateTime_getTime_sync_0010 end-----------------");
});
/**
* @tc.number SUB_systemDateTime_getTime_sync_0020
* @tc.name Test systemTimeDate.getCurrentTime
* @tc.desc Obtains the number of milliseconds that have elapsed since the Unix epoch.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it("SUB_systemDateTime_getTime_sync_0020", 0, async function (done) {
console.info("====>----------SUB_systemDateTime_getTime_sync_0020 start----------------");
let currentTime = systemDateTime.getTime(false);
console.info("====>SUB_systemDateTime_getTime_sync_0020 currentTime: " + JSON.stringify(currentTime));
expect(typeof(currentTime) === 'number').assertEqual(true);
done();
console.info("====>----------SUB_systemDateTime_getTime_sync_0020 end-----------------");
});
/**
* @tc.number SUB_systemDateTime_getTime_sync_0030
* @tc.name Test systemTimeDate.getCurrentTime
* @tc.desc Obtains the number of milliseconds that have elapsed since the Unix epoch.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it("SUB_systemDateTime_getTime_sync_0030", 0, async function (done) {
console.info("====>----------SUB_systemDateTime_getTime_sync_0030 start----------------");
let currentTime = systemDateTime.getTime();
console.info("====>SUB_systemDateTime_getTime_sync_0030 currentTime: " + JSON.stringify(currentTime));
expect(typeof(currentTime) === 'number').assertEqual(true);
done();
console.info("====>----------SUB_systemDateTime_getTime_sync_0030 end-----------------");
});
/**
* @tc.number SUB_systemDateTime_getTime_sync_0040
* @tc.name Test systemTimeDate.getCurrentTime
* @tc.desc Obtains the number of milliseconds that have elapsed since the Unix epoch.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it("SUB_systemDateTime_getTime_sync_0040", 0, async function (done) {
console.info("====>-----SUB_systemDateTime_getTime_sync_0040 start----------------");
try {
console.info("====>SUB_systemDateTime_getTime_sync_0040 into parameters");
// @ts-ignore
systemDateTime.getTime(123);
console.info("====>SUB_systemDateTime_getTime_sync_0040 getTime Success");
} catch (err) {
console.info("====>SUB_systemDateTime_getTime_sync_0040 Invalid parameters: " + JSON.stringify(err));
expect().assertFail();
}
done();
console.info("====>-----SUB_systemDateTime_getTime_sync_0040 end------------");
});
/**
* @tc.number SUB_systemDateTime_getUptime_sync_0050
* @tc.name Test systemTimeDate.getCurrentTime
* @tc.desc Obtains the number of milliseconds elapsed since the system was booted, not including deep sleep time.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it("SUB_systemDateTime_getUptime_sync_0050", 0, async function (done) {
console.info("====>----------SUB_systemDateTime_getUptime_sync_0050 start----------------");
let realActiveTime = systemDateTime.getUptime(systemDateTime.TimeType.ACTIVE, true);
console.info("====>SUB_systemDateTime_getUptime_sync_0050 currentTime: " + JSON.stringify(realActiveTime));
expect(typeof(realActiveTime) === 'number').assertEqual(true);
done();
console.info("====>----------SUB_systemDateTime_getUptime_sync_0050 end-----------------");
});
/**
* @tc.number SUB_systemDateTime_getUptime_sync_0060
* @tc.name Test systemTimeDate.getCurrentTime
* @tc.desc Obtains the number of milliseconds elapsed since the system was booted, not including deep sleep time.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it("SUB_systemDateTime_getUptime_sync_0060", 0, async function (done) {
console.info("====>----------SUB_systemDateTime_getUptime_sync_0060 start----------------");
let realActiveTime = systemDateTime.getUptime(systemDateTime.TimeType.ACTIVE, false);
console.info("====>SUB_systemDateTime_getUptime_sync_0060 currentTime: " + JSON.stringify(realActiveTime));
expect(typeof(realActiveTime) === 'number').assertEqual(true);
done();
console.info("====>----------SUB_systemDateTime_getUptime_sync_0060 end-----------------");
});
/**
* @tc.number SUB_systemDateTime_getUptime_sync_0070
* @tc.name Test systemTimeDate.getCurrentTime
* @tc.desc Obtains the number of milliseconds elapsed since the system was booted, not including deep sleep time.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it("SUB_systemDateTime_getUptime_sync_0070", 0, async function (done) {
console.info("====>----------SUB_systemDateTime_getUptime_sync_0070 start----------------");
let realActiveTime = systemDateTime.getUptime(systemDateTime.TimeType.ACTIVE);
console.info("====>SUB_systemDateTime_getUptime_sync_0070 currentTime: " + JSON.stringify(realActiveTime));
expect(typeof(realActiveTime) === 'number').assertEqual(true);
done();
console.info("====>----------SUB_systemDateTime_getUptime_sync_0070 end-----------------");
});
/**
* @tc.number SUB_systemDateTime_getUptime_sync_0080
* @tc.name Test systemTimeDate.getCurrentTime
* @tc.desc Obtains the number of milliseconds elapsed since the system was booted, not including deep sleep time.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it("SUB_systemDateTime_getUptime_sync_0080", 0, async function (done) {
console.info("====>-----SUB_systemDateTime_getUptime_sync_0080 start----------------");
try {
console.info("====>SUB_systemDateTime_getUptime_sync_0080 into parameters");
// @ts-ignore
systemDateTime.getUptime("123");
expect().assertFail();
} catch (err) {
console.info("====>SUB_systemDateTime_getUptime_sync_0080 Invalid parameters: " + JSON.stringify(err));
expect(err.code).assertEqual(401);
}
done();
console.info("====>-----SUB_systemDateTime_getUptime_sync_0080 end------------");
});
/**
* @tc.number SUB_systemDateTime_getUptime_sync_0090
* @tc.name Test systemTimeDate.getCurrentTime
* @tc.desc Obtains the number of milliseconds elapsed since the system was booted, including deep sleep time.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it("SUB_systemDateTime_getUptime_sync_0090", 0, async function (done) {
console.info("====>----------SUB_systemDateTime_getUptime_sync_0090 start----------------");
let realTime = systemDateTime.getUptime(systemDateTime.TimeType.STARTUP, true);
console.info("====>SUB_systemDateTime_getUptime_sync_0090 currentTime: " + JSON.stringify(realTime));
expect(typeof(realTime) === 'number').assertEqual(true);
done();
console.info("====>----------SUB_systemDateTime_getUptime_sync_0090 end-----------------");
});
/**
* @tc.number SUB_systemDateTime_getUptime_sync_0100
* @tc.name Test systemTimeDate.getCurrentTime
* @tc.desc Obtains the number of milliseconds elapsed since the system was booted, not including deep sleep time.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it("SUB_systemDateTime_getUptime_sync_0100", 0, async function (done) {
console.info("====>----------SUB_systemDateTime_getUptime_sync_0100 start----------------");
let realTime = systemDateTime.getUptime(systemDateTime.TimeType.STARTUP, false);
console.info("====>SUB_systemDateTime_getUptime_sync_0100 currentTime: " + JSON.stringify(realTime));
expect(typeof(realTime) === 'number').assertEqual(true);
done();
console.info("====>----------SUB_systemDateTime_getUptime_sync_0100 end-----------------");
});
/**
* @tc.number SUB_systemDateTime_getUptime_sync_0110
* @tc.name Test systemTimeDate.getCurrentTime
* @tc.desc Obtains the number of milliseconds elapsed since the system was booted, not including deep sleep time.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it("SUB_systemDateTime_getUptime_sync_0110", 0, async function (done) {
console.info("====>----------SUB_systemDateTime_getUptime_sync_0110 start----------------");
let realTime = systemDateTime.getUptime(systemDateTime.TimeType.STARTUP);
console.info("====>SUB_systemDateTime_getUptime_sync_0110 currentTime: " + JSON.stringify(realTime));
expect(typeof(realTime) === 'number').assertEqual(true);
done();
console.info("====>----------SUB_systemDateTime_getUptime_sync_0110 end-----------------");
});
/**
* @tc.number SUB_systemDateTime_getUptime_sync_0120
* @tc.name Test systemTimeDate.getCurrentTime
* @tc.desc Obtains the number of milliseconds elapsed since the system was booted, including deep sleep time.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it("SUB_systemDateTime_getUptime_sync_0120", 0, async function (done) {
console.info("====>-----SUB_systemDateTime_getUptime_sync_0120 start----------------");
try {
console.info("====>SUB_systemDateTime_getUptime_sync_0120 into parameters");
// @ts-ignore
systemDateTime.getUptime(systemDateTime.TimeType.STARTUP, "123");
console.info("====>SUB_systemDateTime_getUptime_sync_0120 getUptime Success");
} catch (err) {
console.info("====>SUB_systemDateTime_getUptime_sync_0120 Invalid parameters: " + JSON.stringify(err));
expect().assertFail();
}
done();
console.info("====>-----SUB_systemDateTime_getUptime_sync_0120 end------------");
});
/**
* @tc.number SUB_systemDateTime_getTimezoneSync_sync_0130
* @tc.name Test systemTime.SUB_systemDateTime_getTimezone_sync_0130 true value
* @tc.desc Test systemTimeDate_setTimezone API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_systemDateTime_getTimezoneSync_sync_0130', 0, async function (done) {
console.info("====>----------SUB_systemDateTime_getTimezoneSync_sync_0130 start----------------");
let timeZone = systemDateTime.getTimezoneSync();
console.info("====>SUB_systemDateTime_getTimezoneSync_sync_0130 currentTime: " + JSON.stringify(timeZone));
expect(typeof(timeZone) === 'string').assertEqual(true);
done();
console.info("====>----------SUB_systemDateTime_getTimezoneSync_sync_0130 end-----------------");
});
/**
* @tc.number SUB_systemDateTime_getTimezoneSync_sync_0140
* @tc.name Test systemTimeDate.setTimezone true value
* @tc.desc Test systemTimeDate_setTimezone API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_systemDateTime_getTimezoneSync_sync_0140', 0, async function (done) {
console.info("====>-----SUB_systemDateTime_getTimezoneSync_sync_0140 start----------------");
try {
console.info("====>SUB_systemDateTime_getTimezoneSync_sync_0140 into parameters");
// @ts-ignore
systemDateTime.getTimezoneSync("123");
console.info("====>SUB_systemDateTime_getTimezoneSync_sync_0140 getTimezoneSync Success");
} catch (err) {
console.info("====>SUB_systemDateTime_getTimezoneSync_sync_0140 Invalid parameters: " + JSON.stringify(err));
expect().assertFail();
}
done();
console.info("====>-----SUB_systemDateTime_getTimezoneSync_sync_0140 end------------");
});
});
};
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录