Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
efc190c7
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看板
提交
efc190c7
编写于
8月 09, 2022
作者:
Z
zhangxingxia
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add statistics xts
Signed-off-by:
N
zhangxingxia
<
zhangxingxia1@huawei.com
>
上级
7c917232
变更
20
隐藏空白更改
内联
并排
Showing
20 changed file
with
635 addition
and
0 deletion
+635
-0
storage/BUILD.gn
storage/BUILD.gn
+1
-0
storage/storagestatisticsjstest/AppScope/app.json
storage/storagestatisticsjstest/AppScope/app.json
+20
-0
storage/storagestatisticsjstest/AppScope/resources/base/element/string.json
...tisticsjstest/AppScope/resources/base/element/string.json
+8
-0
storage/storagestatisticsjstest/AppScope/resources/base/media/app_icon.png
...atisticsjstest/AppScope/resources/base/media/app_icon.png
+0
-0
storage/storagestatisticsjstest/BUILD.gn
storage/storagestatisticsjstest/BUILD.gn
+41
-0
storage/storagestatisticsjstest/Test.json
storage/storagestatisticsjstest/Test.json
+20
-0
storage/storagestatisticsjstest/entry/src/main/ets/Application/AbilityStage.ts
...ticsjstest/entry/src/main/ets/Application/AbilityStage.ts
+22
-0
storage/storagestatisticsjstest/entry/src/main/ets/MainAbility/MainAbility.ts
...sticsjstest/entry/src/main/ets/MainAbility/MainAbility.ts
+51
-0
storage/storagestatisticsjstest/entry/src/main/ets/MainAbility/pages/index.ets
...ticsjstest/entry/src/main/ets/MainAbility/pages/index.ets
+41
-0
storage/storagestatisticsjstest/entry/src/main/ets/TestAbility/TestAbility.ts
...sticsjstest/entry/src/main/ets/TestAbility/TestAbility.ts
+50
-0
storage/storagestatisticsjstest/entry/src/main/ets/TestAbility/pages/index.ets
...ticsjstest/entry/src/main/ets/TestAbility/pages/index.ets
+48
-0
storage/storagestatisticsjstest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...st/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+78
-0
storage/storagestatisticsjstest/entry/src/main/ets/test/Common.ets
...toragestatisticsjstest/entry/src/main/ets/test/Common.ets
+31
-0
storage/storagestatisticsjstest/entry/src/main/ets/test/List.test.ets
...agestatisticsjstest/entry/src/main/ets/test/List.test.ets
+23
-0
storage/storagestatisticsjstest/entry/src/main/ets/test/StorageStatistics.test.ets
...jstest/entry/src/main/ets/test/StorageStatistics.test.ets
+131
-0
storage/storagestatisticsjstest/entry/src/main/module.json
storage/storagestatisticsjstest/entry/src/main/module.json
+49
-0
storage/storagestatisticsjstest/entry/src/main/resources/base/element/string.json
...sjstest/entry/src/main/resources/base/element/string.json
+16
-0
storage/storagestatisticsjstest/entry/src/main/resources/base/media/icon.png
...isticsjstest/entry/src/main/resources/base/media/icon.png
+0
-0
storage/storagestatisticsjstest/entry/src/main/resources/base/profile/main_pages.json
...est/entry/src/main/resources/base/profile/main_pages.json
+5
-0
storage/storagestatisticsjstest/signature/openharmony_sx.p7b
storage/storagestatisticsjstest/signature/openharmony_sx.p7b
+0
-0
未找到文件。
storage/BUILD.gn
浏览文件 @
efc190c7
...
...
@@ -21,6 +21,7 @@ group("storage") {
"storagefilejstest:storagefile_js_test",
"storagesecuritylabeljstest:storagesecuritylabel_js_test",
"storagestatfsjstest:storagestatfs_js_test",
"storagestatisticsjstest:storagestatistics_js_test",
]
}
}
storage/storagestatisticsjstest/AppScope/app.json
0 → 100644
浏览文件 @
efc190c7
{
"app"
:
{
"bundleName"
:
"com.example.statistics"
,
"vendor"
:
"example"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"icon"
:
"$media:app_icon"
,
"label"
:
"$string:app_name"
,
"debug"
:
false
,
"distributedNotificationEnabled"
:
true
,
"keepAlive"
:
true
,
"singleUser"
:
true
,
"minAPIVersion"
:
9
,
"targetAPIVersion"
:
9
,
"car"
:
{
"apiCompatibleVersion"
:
9
,
"singleUser"
:
false
}
}
}
storage/storagestatisticsjstest/AppScope/resources/base/element/string.json
0 → 100644
浏览文件 @
efc190c7
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"fileAccess"
}
]
}
storage/storagestatisticsjstest/AppScope/resources/base/media/app_icon.png
0 → 100644
浏览文件 @
efc190c7
6.6 KB
storage/storagestatisticsjstest/BUILD.gn
0 → 100644
浏览文件 @
efc190c7
# 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("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("storagestatistics_js_test") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":storagestatistics_js_assets",
":storagestatistics_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsStorageStatisticsJsTest"
}
ohos_app_scope("storagestatistics_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("storagestatistics_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("storagestatistics_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":storagestatistics_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
storage/storagestatisticsjstest/Test.json
0 → 100644
浏览文件 @
efc190c7
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"180000"
,
"bundle-name"
:
"com.example.statistics"
,
"module-name"
:
"entry"
,
"shell-timeout"
:
"600000"
,
"testcase-timeout"
:
70000
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsStorageStatisticsJsTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
\ No newline at end of file
storage/storagestatisticsjstest/entry/src/main/ets/Application/AbilityStage.ts
0 → 100644
浏览文件 @
efc190c7
/*
* 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
AbilityStage
from
"
@ohos.application.AbilityStage
"
export
default
class
MyAbilityStage
extends
AbilityStage
{
onCreate
()
{
console
.
log
(
"
[Demo] MyAbilityStage onCreate
"
)
}
}
\ No newline at end of file
storage/storagestatisticsjstest/entry/src/main/ets/MainAbility/MainAbility.ts
0 → 100644
浏览文件 @
efc190c7
/*
* 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
Ability
from
'
@ohos.application.Ability
'
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
// Ability is creating, initialize resources for this ability
console
.
log
(
"
[Demo] MainAbility onCreate
"
);
globalThis
.
abilityWant
=
want
;
}
onDestroy
()
{
// Ability is destroying, release resources for this ability
console
.
log
(
"
[Demo] MainAbility onDestroy
"
)
}
onWindowStageCreate
(
windowStage
)
{
// Main window is created, set main page for this ability
console
.
log
(
"
[Demo] MainAbility onWindowStageCreate
"
)
globalThis
.
abilityContext
=
this
.
context
;
windowStage
.
setUIContent
(
this
.
context
,
"
MainAbility/pages/index
"
,
null
)
}
onWindowStageDestroy
()
{
// Main window is destroyed, release UI related resources
console
.
log
(
"
[Demo] MainAbility onWindowStageDestroy
"
)
}
onForeground
()
{
// Ability has brought to foreground
console
.
log
(
"
[Demo] MainAbility onForeground
"
)
}
onBackground
()
{
// Ability has back to background
console
.
log
(
"
[Demo] MainAbility onBackground
"
)
}
};
storage/storagestatisticsjstest/entry/src/main/ets/MainAbility/pages/index.ets
0 → 100644
浏览文件 @
efc190c7
/*
* 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../../test/List.test'
//InstrumentLog, ReportExtend
@Entry
@Component
struct Index {
aboutToAppear(){
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite);
}
build() {
Flex({ direction:FlexDirection.Column, alignItems:ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('你好,测试...')
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
storage/storagestatisticsjstest/entry/src/main/ets/TestAbility/TestAbility.ts
0 → 100644
浏览文件 @
efc190c7
/*
* 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
Ability
from
'
@ohos.application.Ability
'
export
default
class
TestAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
console
.
log
(
'
TestAbility onCreate
'
)
}
onDestroy
()
{
console
.
log
(
'
TestAbility onDestroy
'
)
}
onWindowStageCreate
(
windowStage
)
{
console
.
log
(
'
TestAbility onWindowStageCreate
'
)
windowStage
.
loadContent
(
"
TestAbility/pages/index
"
,
(
err
,
data
)
=>
{
if
(
err
.
code
)
{
console
.
error
(
'
Failed to load the content. Cause:
'
+
JSON
.
stringify
(
err
));
return
;
}
console
.
info
(
'
Succeeded in loading the content. Data:
'
+
JSON
.
stringify
(
data
))
});
globalThis
.
abilityContext
=
this
.
context
;
}
onWindowStageDestroy
()
{
console
.
log
(
'
TestAbility onWindowStageDestroy
'
)
}
onForeground
()
{
console
.
log
(
'
TestAbility onForeground
'
)
}
onBackground
()
{
console
.
log
(
'
TestAbility onBackground
'
)
}
};
\ No newline at end of file
storage/storagestatisticsjstest/entry/src/main/ets/TestAbility/pages/index.ets
0 → 100644
浏览文件 @
efc190c7
/*
* 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 router from '@ohos.router';
@Entry
@Component
struct Index {
aboutToAppear() {
console.info('TestAbility index aboutToAppear')
}
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(()=>{
})
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
storage/storagestatisticsjstest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
0 → 100644
浏览文件 @
efc190c7
/*
* 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
TestRunner
from
'
@ohos.application.testRunner
'
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
var
abilityDelegator
=
undefined
var
abilityDelegatorArguments
=
undefined
function
translateParamsToString
(
parameters
)
{
const
keySet
=
new
Set
([
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s it
'
,
'
-s level
'
,
'
-s testType
'
,
'
-s size
'
,
'
-s timeout
'
,
'
-s dryRun
'
])
let
targetParams
=
''
;
for
(
const
key
in
parameters
)
{
if
(
keySet
.
has
(
key
))
{
targetParams
=
`
${
targetParams
}
${
key
}
${
parameters
[
key
]}
`
}
}
return
targetParams
.
trim
()
}
async
function
onAbilityCreateCallback
()
{
console
.
log
(
"
onAbilityCreateCallback
"
);
}
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
console
.
info
(
"
addAbilityMonitorCallback :
"
+
JSON
.
stringify
(
err
))
}
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
constructor
()
{
}
onPrepare
()
{
console
.
info
(
"
OpenHarmonyTestRunner OnPrepare
"
)
}
async
onRun
()
{
console
.
log
(
'
OpenHarmonyTestRunner onRun run
'
)
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
testAbilityName
=
abilityDelegatorArguments
.
bundleName
+
'
.MainAbility
'
let
lMonitor
=
{
abilityName
:
testAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
)
var
cmd
=
'
aa start -d 0 -a com.example.statistics.MainAbility
'
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
)
var
debug
=
abilityDelegatorArguments
.
parameters
[
"
-D
"
]
if
(
debug
==
'
true
'
)
{
cmd
+=
'
-D
'
}
console
.
info
(
'
cmd :
'
+
cmd
)
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
:
any
,
d
:
any
)
=>
{
console
.
info
(
'
executeShellCommand : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
stdResult
);
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
exitCode
);
})
console
.
info
(
'
OpenHarmonyTestRunner onRun end
'
)
}
};
\ No newline at end of file
storage/storagestatisticsjstest/entry/src/main/ets/test/Common.ets
0 → 100644
浏览文件 @
efc190c7
/*
* 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.
*/
function isIntNum(val) {
return typeof val === "number" && val % 1 === 0;
}
function isNegativeNum(val) {
return val < 0;
}
function isInclude(error, message) {
return error.toString().indexOf(message) != -1;
}
export {
isIntNum,
isNegativeNum,
isInclude
};
storage/storagestatisticsjstest/entry/src/main/ets/test/List.test.ets
0 → 100644
浏览文件 @
efc190c7
// @ts-nocheck
/*
* 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 storageStatisticsTest from './StorageStatistics.test.ets'
export default function testsuite() {
storageStatisticsTest()
}
storage/storagestatisticsjstest/entry/src/main/ets/test/StorageStatistics.test.ets
0 → 100644
浏览文件 @
efc190c7
/*
* 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.
*/
// @ts-nocheck
import storageStatistics from "@ohos.storageStatistics";
import { describe, it, expect } from "@ohos/hypium"
import {isIntNum, isNegativeNum, isInclude} from "./Common";
export default function storageStatisticsTest() {
describe("storageStatisticsTest", function () {
/**
* @tc.number SUB_DF_STORAGE_STATISTICS_GET_CURRENT_BUNDLE_STATS_0000
* @tc.name storage_statistics_test_get_current_bundle_stats_async_000
* @tc.desc Test getCurrentBundleStats() interfaces, returned in promise mode.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it("storage_statistics_test_get_current_bundle_stats_async_000", 0, async function (done) {
try {
let bundleStat = await storageStatistics.getCurrentBundleStats();
expect(bundleStat != null).assertTrue();
expect(isIntNum(bundleStat.appSize) && !isNegativeNum(bundleStat.appSize)).assertTrue();
expect(isIntNum(bundleStat.cacheSize) && !isNegativeNum(bundleStat.cacheSize)).assertTrue();
expect(isIntNum(bundleStat.dataSize) && !isNegativeNum(bundleStat.dataSize)).assertTrue();
done();
} catch (e) {
console.log("storage_statistics_test_get_current_bundle_stats_async_000 has failed for " + e);
expect(null).assertFail();
done();
}
});
/**
* @tc.number SUB_DF_STORAGE_STATISTICS_GET_CURRENT_BUNDLE_STATS_0010
* @tc.name storage_statistics_test_get_current_bundle_stats_async_001
* @tc.desc Test getCurrentBundleStats() interfaces , returned in callback mode.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it("storage_statistics_test_get_current_bundle_stats_async_001", 0, async function (done) {
try {
storageStatistics.getCurrentBundleStats((error, bundleStat) => {
expect(bundleStat != null).assertTrue();
expect(isIntNum(bundleStat.appSize) && !isNegativeNum(bundleStat.appSize)).assertTrue();
expect(isIntNum(bundleStat.cacheSize) && !isNegativeNum(bundleStat.cacheSize)).assertTrue();
expect(isIntNum(bundleStat.dataSize) && !isNegativeNum(bundleStat.dataSize)).assertTrue();
done();
});
} catch (e) {
console.log("storage_statistics_test_get_current_bundle_stats_async_001 has failed for " + e);
expect(null).assertFail();
done();
}
});
/**
* @tc.number SUB_DF_STORAGE_STATISTICS_GET_CURRENT_BUNDLE_STATS_0020
* @tc.name storage_statistics_test_get_current_bundle_stats_async_002
* @tc.desc Test getCurrentBundleStats() interfaces, the parameter packagename is errors, returning error results.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it("storage_statistics_test_get_current_bundle_stats_async_002", 0, async function (done) {
try {
await storageStatistics.getCurrentBundleStats("1");
done();
} catch (error) {
console.log("storage_statistics_test_get_current_bundle_stats_async_002 has failed for " + error);
expect(isInclude(error, "The callback shall be a function")).assertTrue();
done();
}
});
/**
* @tc.number SUB_DF_STORAGE_STATISTICS_GET_CURRENT_BUNDLE_STATS_0030
* @tc.name storage_statistics_test_get_current_bundle_stats_async_003
* @tc.desc Test getCurrentBundleStats() interfaces, When the parameter type is wrong, returns the correct result.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it("storage_statistics_test_get_current_bundle_stats_async_003", 0, async function (done) {
try {
await storageStatistics.getCurrentBundleStats(1);
done();
} catch (error) {
console.log("storage_statistics_test_get_current_bundle_stats_async_003 has failed for " + error);
expect(isInclude(error, "The callback shall be a function")).assertTrue();
done();
}
});
/**
* @tc.number SUB_DF_STORAGE_STATISTICS_GET_CURRENT_BUNDLE_STATS_0040
* @tc.name storage_statistics_test_get_current_bundle_stats_async_004
* @tc.desc Test getCurrentBundleStats() interfaces, When there are no parameters, returning error results.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it("storage_statistics_test_get_current_bundle_stats_async_004", 0, async function (done) {
try {
await storageStatistics.getCurrentBundleStats(true);
done();
} catch (error) {
console.log("storage_statistics_test_get_current_bundle_stats_async_004 has failed for " + error);
expect(isInclude(error, "The callback shall be a function")).assertTrue();
done();
}
})
});
}
\ No newline at end of file
storage/storagestatisticsjstest/entry/src/main/module.json
0 → 100644
浏览文件 @
efc190c7
{
"module"
:
{
"package"
:
"com.example.statistics"
,
"name"
:
"entry"
,
"mainAbility"
:
"com.example.statistics.MainAbility"
,
"type"
:
"entry"
,
"srcEntrance"
:
"./ets/Application/AbilityStage.ts"
,
"description"
:
"$string:entry_desc"
,
"mainElement"
:
"MainAbility"
,
"deviceTypes"
:
[
"phone"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"pages"
:
"$profile:main_pages"
,
"uiSyntax"
:
"ets"
,
"abilities"
:
[
{
"name"
:
"com.example.statistics.MainAbility"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:MainAbility_desc"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:MainAbility_label"
,
"visible"
:
true
,
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
]
}
],
"requestPermissions"
:
[
{
"name"
:
"ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
},
{
"name"
:
"ohos.permission.REVOKE_SENSITIVE_PERMISSIONS"
},
{
"name"
:
"ohos.permission.READ_MEDIA"
}
]
}
}
\ No newline at end of file
storage/storagestatisticsjstest/entry/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
efc190c7
{
"string"
:
[
{
"name"
:
"entry_desc"
,
"value"
:
"description"
},
{
"name"
:
"MainAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"MainAbility_label"
,
"value"
:
"ActsStorageStatisticsJsTest"
}
]
}
\ No newline at end of file
storage/storagestatisticsjstest/entry/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
efc190c7
6.6 KB
storage/storagestatisticsjstest/entry/src/main/resources/base/profile/main_pages.json
0 → 100644
浏览文件 @
efc190c7
{
"src"
:
[
"MainAbility/pages/index"
]
}
storage/storagestatisticsjstest/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
efc190c7
文件已添加
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录