Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
5294f464
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看板
提交
5294f464
编写于
3月 18, 2022
作者:
Z
zeng_xingdong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add running log for failure, fix code checking, remove all unness return
Signed-off-by:
N
zeng_xingdong
<
zengxingdong@huawei.com
>
上级
6ae092cf
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
80 addition
and
40 deletion
+80
-40
distributedhardware/devicemanagerjstest/src/main/js/default/test/Device_Manager.test.js
...gerjstest/src/main/js/default/test/Device_Manager.test.js
+80
-40
未找到文件。
distributedhardware/devicemanagerjstest/src/main/js/default/test/Device_Manager.test.js
浏览文件 @
5294f464
...
...
@@ -28,13 +28,14 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_createDeviceManager_0100----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.devicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
expect
(
data
).
assertUndefined
();
})
;
expect
(
data
!=
null
).
assertTrue
()
})
console
.
log
(
"
----------stop running deviceManagerTest_createDeviceManager_0100----------
"
);
done
();
})
})
/*
* @tc.number deviceManagerTest_createDeviceManager_0200
...
...
@@ -46,9 +47,10 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_createDeviceManager_0200----------
"
);
deviceManager
.
createDeviceManager
(
''
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
expect
(
data
).
assertNull
();
expect
(
data
==
null
).
assertTrue
()
});
console
.
log
(
"
----------stop running deviceManagerTest_createDeviceManager_0200----------
"
);
done
();
...
...
@@ -64,9 +66,10 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_createDeviceManager_0300----------
"
);
deviceManager
.
createDeviceManager
(
'
comohosdevicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
expect
(
data
).
assertNull
();
expect
(
data
==
null
).
assertTrue
()
});
console
.
log
(
"
----------stop running deviceManagerTest_createDeviceManager_0300----------
"
);
done
();
...
...
@@ -82,10 +85,11 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_createDeviceManager_0400----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.123
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
expect
(
data
).
assertNull
();
});
expect
(
data
==
null
).
assertTrue
()
});
console
.
log
(
"
----------stop running deviceManagerTest_createDeviceManager_0400----------
"
);
done
();
})
...
...
@@ -100,10 +104,11 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_createDeviceManager_0500----------
"
);
deviceManager
.
createDeviceManager
(
'
com#ohos%devicemangagerdemo&*
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
expect
(
data
).
assertNull
();
});
expect
(
data
==
null
).
assertTrue
()
});
console
.
log
(
"
----------stop running deviceManagerTest_createDeviceManager_0500----------
"
);
done
();
})
...
...
@@ -118,6 +123,7 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_startDeviceDiscovery_0100----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.devicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
...
...
@@ -131,7 +137,7 @@ describe('deviceManagerTest', function() {
"
capability
"
:
0
};
var
start
=
data
.
startDeviceDiscovery
(
info
);
expect
(
start
).
assertUndefined
();
expect
(
start
!=
null
).
assertTrue
();
});
console
.
log
(
"
----------stop running deviceManagerTest_startDeviceDiscovery_0100----------
"
);
done
();
...
...
@@ -147,6 +153,7 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_startDeviceDiscovery_0100----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.devicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
...
...
@@ -160,7 +167,7 @@ describe('deviceManagerTest', function() {
"
capability
"
:
SUBSCRIBE_CAPABILITY_OSD
};
var
start
=
data
.
startDeviceDiscovery
(
info
);
expect
(
start
).
assertUndefined
();
expect
(
start
!=
null
).
assertTrue
();
});
console
.
log
(
"
----------stop running deviceManagerTest_startDeviceDiscovery_0100----------
"
);
done
();
...
...
@@ -176,6 +183,7 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_startDeviceDiscovery_0100----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.devicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
...
...
@@ -189,7 +197,7 @@ describe('deviceManagerTest', function() {
"
capability
"
:
SUBSCRIBE_CAPABILITY_DDMP
};
var
start
=
data
.
startDeviceDiscovery
(
info
);
expect
(
start
).
assertUndefined
();
expect
(
start
!=
null
).
assertTrue
();
});
console
.
log
(
"
----------stop running deviceManagerTest_startDeviceDiscovery_0100----------
"
);
done
();
...
...
@@ -205,10 +213,11 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_release_0100----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.devicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
var
re
=
data
.
release
();
expect
(
re
).
assertUndefined
();
expect
(
re
!=
null
).
assertTrue
();
});
console
.
log
(
"
----------stop running deviceManagerTest_release_0100----------
"
);
done
();
...
...
@@ -224,10 +233,11 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_getTrustedDeviceListSync_0100----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.devicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
var
array
=
data
.
getTrustedDeviceListSync
();
expect
(
array
).
assertUndefined
();
expect
(
array
==
null
).
assertTrue
();
});
console
.
log
(
"
----------stop running deviceManagerTest_getTrustedDeviceListSync_0100----------
"
);
done
();
...
...
@@ -243,11 +253,12 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_stopDeviceDiscovery_0100----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.devicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
var
subscribeId
=
2115
;
var
start
=
data
.
stopDeviceDiscovery
(
subscribeId
);
expect
(
start
).
assertUndefined
();
expect
(
start
!=
null
).
assertTrue
();
});
console
.
log
(
"
----------stop running deviceManagerTest_stopDeviceDiscovery_0100----------
"
);
done
();
...
...
@@ -263,6 +274,7 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_getLocalDeviceInfoSync_0100----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.devicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
setTimeout
(
function
(){
...
...
@@ -288,6 +300,7 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_deviceManagerTest_getLocalDeviceInfo1_0100----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.devicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
setTimeout
(
function
(){
...
...
@@ -299,6 +312,7 @@ describe('deviceManagerTest', function() {
var
deviceInfo
=
dmClass
.
getLocalDeviceInfo
((
err
,
data
)
=>
{
if
(
err
)
{
expect
().
assertFail
();
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
}
});
expect
(
deviceInfo
==
undefined
).
assertTrue
();
...
...
@@ -317,6 +331,7 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_getLocalDeviceInfo(promise)_0100----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.devicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
setTimeout
(
function
(){
...
...
@@ -326,9 +341,7 @@ describe('deviceManagerTest', function() {
});
async
function
getLocalDeviceInfo2
(){
var
deviceInfo
=
dmClass
.
getLocalDeviceInfo
().
then
(
data
=>
{
// console.log('data is :' + data)
})
// console.log('promise is : ' + JSON.stringify(deviceInfo))
expect
(
deviceInfo
!=
null
).
assertTrue
();
}
console
.
log
(
"
----------stop running deviceManagerTest_getLocalDeviceInfo(promise)_0100----------
"
);
...
...
@@ -345,6 +358,7 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_authenticateDevice_0100----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.devicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
let
deviceInfo
=
{
...
...
@@ -368,9 +382,10 @@ describe('deviceManagerTest', function() {
data
.
authenticateDevice
(
deviceInfo
,
authParam
,
(
err
,
data
)
=>
{
if
(
err
)
{
expect
().
assertFail
();
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
}
var
token
=
data
.
pinToken
;
expect
(
token
).
assertNotNull
();
expect
(
token
!=
null
).
assertTrue
();
});
});
console
.
log
(
"
----------stop running deviceManagerTest_authenticateDevice_0100----------
"
);
...
...
@@ -387,6 +402,7 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_authenticateDevice_0100----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.devicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
let
deviceInfo
=
{
...
...
@@ -409,10 +425,11 @@ describe('deviceManagerTest', function() {
}
data
.
authenticateDevice
(
deviceInfo
,
authParam
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] authenticateDevice error
"
);
expect
().
assertFail
();
}
var
token
=
data
.
pinToken
;
expect
(
token
).
assertNotNull
();
expect
(
token
!=
null
).
assertTrue
();
});
});
console
.
log
(
"
----------stop running deviceManagerTest_authenticateDevice_0100----------
"
);
...
...
@@ -429,6 +446,7 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_authenticateDevice_0100----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.devicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
let
deviceInfo
=
{
...
...
@@ -451,10 +469,11 @@ describe('deviceManagerTest', function() {
}
data
.
authenticateDevice
(
deviceInfo
,
authParam
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] authenticateDevice error
"
);
expect
().
assertFail
();
}
var
token
=
data
.
pinToken
;
expect
(
token
).
assertNotNull
();
expect
(
token
!=
null
).
assertTrue
();
});
});
console
.
log
(
"
----------stop running deviceManagerTest_authenticateDevice_0100----------
"
);
...
...
@@ -471,6 +490,7 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_authenticateDevice_0100----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.devicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
let
deviceInfo
=
{
...
...
@@ -493,10 +513,11 @@ describe('deviceManagerTest', function() {
}
data
.
authenticateDevice
(
deviceInfo
,
authParam
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] authenticateDevice error
"
);
expect
().
assertFail
();
}
var
token
=
data
.
pinToken
;
expect
(
token
).
assertNotNull
();
expect
(
token
!=
null
).
assertTrue
();
});
});
console
.
log
(
"
----------stop running deviceManagerTest_authenticateDevice_0100----------
"
);
...
...
@@ -513,6 +534,7 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_authenticateDevice_0100----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.devicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
let
deviceInfo
=
{
...
...
@@ -535,10 +557,11 @@ describe('deviceManagerTest', function() {
}
data
.
authenticateDevice
(
deviceInfo
,
authParam
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] authenticateDevice error
"
);
expect
().
assertFail
();
}
var
token
=
data
.
pinToken
;
expect
(
token
).
assertNotNull
();
expect
(
token
!=
null
).
assertTrue
();
});
});
console
.
log
(
"
----------stop running deviceManagerTest_authenticateDevice_0100----------
"
);
...
...
@@ -555,6 +578,7 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_authenticateDevice_0100----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.devicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
let
deviceInfo
=
{
...
...
@@ -577,10 +601,11 @@ describe('deviceManagerTest', function() {
}
data
.
authenticateDevice
(
deviceInfo
,
authParam
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] authenticateDevice error
"
);
expect
().
assertFail
();
}
var
token
=
data
.
pinToken
;
expect
(
token
).
assertNotNull
();
expect
(
token
!=
null
).
assertTrue
();
});
});
console
.
log
(
"
----------stop running deviceManagerTest_authenticateDevice_0100----------
"
);
...
...
@@ -597,6 +622,7 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_authenticateDevice_0100----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.devicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
let
authInfo
=
{
...
...
@@ -610,7 +636,7 @@ describe('deviceManagerTest', function() {
if
(
err
)
{
expect
().
assertFail
();
}
expect
(
data
).
assertUndefined
();
expect
(
data
==
undefined
).
assertTrue
();
});
});
console
.
log
(
"
----------stop running deviceManagerTest_authenticateDevice_0100----------
"
);
...
...
@@ -627,6 +653,7 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_unAuthenticateDevice_0100----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.devicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
setTimeout
(
function
(){
...
...
@@ -655,6 +682,7 @@ describe('deviceManagerTest', function() {
}
var
result
=
dmClass
.
unAuthenticateDevice
(
deviceInfo
,
authParam
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] unAuthenticateDevice error
"
);
expect
().
assertFail
();
}
});
...
...
@@ -674,10 +702,11 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_getAuthenticationParam_0100----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.devicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
var
authparam
=
data
.
getAuthenticationParam
();
expect
(
authparam
).
assertNotNull
();
expect
(
authparam
!=
null
).
assertTrue
();
});
console
.
log
(
"
----------stop running deviceManagerTest_getAuthenticationParam_0100----------
"
);
done
();
...
...
@@ -693,12 +722,13 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_on-deviceStateChange_0100----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.devicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
var
fa
=
data
.
on
(
'
deviceStateChange
'
,
(
deviceStateChangeAction
,
deviceInfo
)
=>
{
expect
(
true
).
assertEqual
(
deviceStateChangeAction
.
ONLINE
==
0
);
expect
(
deviceStateChangeAction
.
ONLINE
==
0
).
assertTrue
(
);
});
expect
(
fa
).
assertUndefined
();
expect
(
fa
!=
null
).
assertTrue
();
});
console
.
log
(
"
----------stop running deviceManagerTest_on-deviceStateChange_0100----------
"
);
done
();
...
...
@@ -714,12 +744,13 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_on-deviceStateChange_0100----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.devicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
var
fa
=
data
.
on
(
'
deviceStateChange
'
,
(
deviceStateChangeAction
,
deviceInfo
)
=>
{
expect
(
true
).
assertEqual
(
deviceStateChangeAction
.
OFFLINE
==
0
);
expect
(
deviceStateChangeAction
.
OFFLINE
==
0
).
assertTrue
(
);
});
expect
(
fa
).
assertUndefined
();
expect
(
fa
!=
null
).
assertNotNull
();
});
console
.
log
(
"
----------stop running deviceManagerTest_on-deviceStateChange_0100----------
"
);
done
();
...
...
@@ -735,12 +766,13 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_on-deviceStateChange_0100----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.devicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
var
fa
=
data
.
on
(
'
deviceStateChange
'
,
(
deviceStateChangeAction
,
deviceInfo
)
=>
{
expect
(
true
).
assertEqual
(
deviceStateChangeAction
.
READY
==
0
);
expect
(
deviceStateChangeAction
.
READY
==
0
).
assertTrue
(
);
});
expect
(
fa
).
assertUndefined
();
expect
(
fa
!=
null
).
assertTrue
();
});
console
.
log
(
"
----------stop running deviceManagerTest_on-deviceStateChange_0100----------
"
);
done
();
...
...
@@ -756,12 +788,13 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_on-deviceStateChange_0100----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.devicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
var
fa
=
data
.
on
(
'
deviceStateChange
'
,
(
deviceStateChangeAction
,
deviceInfo
)
=>
{
expect
(
true
).
assertEqual
(
deviceStateChangeAction
.
CHANGE
==
0
);
expect
(
deviceStateChangeAction
.
CHANGE
==
0
).
assertTrue
(
);
});
expect
(
fa
).
assertUndefined
();
expect
(
fa
!=
null
).
assertTrue
();
});
console
.
log
(
"
----------stop running deviceManagerTest_on-deviceStateChange_0100----------
"
);
done
();
...
...
@@ -777,10 +810,11 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_off-deviceStateChange_0100----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.devicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
var
fa
=
data
.
off
(
'
deviceStateChange
'
,
()
=>
{});
expect
(
fa
).
assertUndefined
();
expect
(
fa
!=
null
).
assertTrue
();
});
console
.
log
(
"
----------stop running deviceManagerTest_off-deviceStateChange_0100----------
"
);
done
();
...
...
@@ -796,10 +830,11 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_on-deviceFound_0100----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.devicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
var
fa
=
data
.
on
(
'
deviceFound
'
,
()
=>
{});
expect
(
fa
).
assertUndefined
();
expect
(
fa
!=
null
).
assertTrue
();
});
console
.
log
(
"
----------stop running deviceManagerTest_on-deviceFound_0100----------
"
);
done
();
...
...
@@ -815,10 +850,11 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_off-deviceFound_0100----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.devicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
var
fa
=
data
.
off
(
'
deviceFound
'
,
()
=>
{});
expect
(
fa
).
assertUndefined
();
expect
(
fa
!=
null
).
assertTrue
();
});
console
.
log
(
"
----------stop running deviceManagerTest_off-deviceFound_0100----------
"
);
done
();
...
...
@@ -834,10 +870,11 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_on-discoverFail_0100----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.devicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
var
fa
=
data
.
on
(
'
discoverFail
'
,
()
=>
{});
expect
(
fa
).
assertUndefined
();
expect
(
fa
!=
null
).
assertTrue
();
});
console
.
log
(
"
----------stop running deviceManagerTest_on-discoverFail_0100----------
"
);
done
();
...
...
@@ -853,10 +890,11 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_off-discoverFail_0100----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.devicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
var
fa
=
data
.
off
(
'
discoverFail
'
,
()
=>
{});
expect
(
fa
).
assertUndefined
();
expect
(
fa
!=
null
).
assertTrue
();
});
console
.
log
(
"
----------stop running deviceManagerTest_off-discoverFail_0100----------
"
);
done
();
...
...
@@ -872,10 +910,11 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_on-serviceDie_0100----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.devicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
var
fa
=
data
.
on
(
'
serviceDie
'
,
()
=>
{});
expect
(
fa
).
assertUndefined
();
expect
(
fa
!=
null
).
assertTrue
();
});
console
.
log
(
"
----------start running deviceManagerTest_on-serviceDie_0100----------
"
);
done
();
...
...
@@ -891,10 +930,11 @@ describe('deviceManagerTest', function() {
console
.
log
(
"
----------start running deviceManagerTest_off-serviceDie_0100----------
"
);
deviceManager
.
createDeviceManager
(
'
com.ohos.devicemangagerdemo
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
"
[deviceManagerTest] createDeviceManager error
"
);
expect
().
assertFail
();
}
var
fa
=
data
.
off
(
'
serviceDie
'
,
()
=>
{});
expect
(
fa
).
assertUndefined
();
expect
(
fa
!=
null
).
assertTrue
();
});
console
.
log
(
"
----------stop running deviceManagerTest_off-serviceDie_0100----------
"
);
done
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录