Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
5693118f
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看板
未验证
提交
5693118f
编写于
8月 03, 2023
作者:
O
openharmony_ci
提交者:
Gitee
8月 03, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9660 unitest模拟点击修改
Merge pull request !9660 from zhaominjie11/master
上级
70f8d642
fa96890a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
1640 addition
and
1642 deletion
+1640
-1642
ability/dmsfwk/continuationmanagertest/src/main/js/TestAbility/app.js
...wk/continuationmanagertest/src/main/js/TestAbility/app.js
+0
-39
ability/dmsfwk/continuationmanagertest/src/main/js/test/ContinuationManagerJsunit.test.js
...ertest/src/main/js/test/ContinuationManagerJsunit.test.js
+1640
-1603
未找到文件。
ability/dmsfwk/continuationmanagertest/src/main/js/TestAbility/app.js
浏览文件 @
5693118f
...
...
@@ -15,44 +15,8 @@
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
import
{
Hypium
}
from
'
@ohos/hypium
'
import
{
UiDriver
,
BY
}
from
'
@ohos.UiTest
'
import
testsuite
from
'
../test/List.test
'
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
async
function
requestPermission
()
{
try
{
let
context
=
featureAbility
.
getContext
();
await
context
.
requestPermissionsFromUser
([
'
ohos.permission.DISTRIBUTED_DATASYNC
'
],
666
,
(
data
)
=>
{
console
.
info
(
'
TestApplication requestPermission data:
'
+
JSON
.
stringify
(
data
));
});
}
catch
(
err
)
{
console
.
error
(
'
TestApplication permission
'
+
JSON
.
stringify
(
err
));
}
}
async
function
clickPermission
(
driver
)
{
console
.
info
(
"
clickPermission begin
"
);
await
driver
.
delayMs
(
2000
);
var
data_sync_allow
=
await
driver
.
findComponent
(
BY
.
text
(
"
允许
"
))
await
driver
.
delayMs
(
1000
)
var
wait_count
=
0
while
(
data_sync_allow
==
null
||
data_sync_allow
==
undefined
)
{
data_sync_allow
=
await
driver
.
findComponent
(
BY
.
text
(
"
允许
"
))
wait_count
+=
1
await
driver
.
delayMs
(
1000
)
if
(
wait_count
==
15
)
{
break
}
}
if
(
data_sync_allow
==
null
)
{
console
.
info
(
'
应用非首次开启
'
)
}
else
{
await
data_sync_allow
.
click
()
console
.
log
(
'
点击多设备授权框的允许按钮
'
)
}
}
export
default
{
onCreate
()
{
...
...
@@ -61,9 +25,6 @@ export default {
var
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
console
.
info
(
'
start run testcase!!!
'
)
Hypium
.
hypiumTest
(
abilityDelegator
,
abilityDelegatorArguments
,
testsuite
)
var
driver
=
UiDriver
.
create
()
requestPermission
()
clickPermission
(
driver
)
},
onDestroy
()
{
console
.
info
(
"
TestApplication onDestroy
"
);
...
...
ability/dmsfwk/continuationmanagertest/src/main/js/test/ContinuationManagerJsunit.test.js
浏览文件 @
5693118f
...
...
@@ -18,1616 +18,1653 @@ import continuationManager from '@ohos.continuation.continuationManager';
const
TEST_DEVICE_ID
=
"
test_deviceId
"
;
const
TEST_CONNECT_STATUS
=
continuationManager
.
DeviceConnectState
.
CONNECTED
;
let
token
=
-
1
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
{
UiDriver
,
BY
}
from
'
@ohos.UiTest
'
export
default
function
continuationManagerTest
()
{
describe
(
'
continuationManagerTest
'
,
function
()
{
describe
(
'
continuationManagerTest
'
,
function
()
{
beforeAll
(
async
function
(
done
)
{
console
.
info
(
'
beforeAll
'
);
function
sleep
(
ms
)
{
return
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
ms
));
}
await
sleep
(
20000
)
done
();
})
afterAll
(
async
function
(
done
)
{
console
.
info
(
'
afterAll
'
);
done
();
})
beforeEach
(
async
function
(
done
)
{
console
.
info
(
'
beforeEach
'
);
try
{
await
continuationManager
.
registerContinuation
().
then
((
data
)
=>
{
token
=
data
;
console
.
info
(
'
beforeEach registerContinuation success
'
);
done
();
})
.
catch
((
e
)
=>
{
console
.
info
(
"
beforeEach promise error:
"
+
e
);
});
}
catch
(
e
)
{
console
.
info
(
"
beforeEach try error:
"
+
e
);
}
console
.
info
(
'
beforeEach end
'
);
})
afterEach
(
async
function
(
done
)
{
console
.
info
(
'
afterEach
'
);
try
{
await
continuationManager
.
unregisterContinuation
(
token
).
then
((
data
)
=>
{
console
.
info
(
'
afterEach unregisterContinuation success
'
);
done
();
})
.
catch
((
e
)
=>
{
console
.
info
(
"
afterEach promise error:
"
+
e
);
});
}
catch
(
e
)
{
console
.
info
(
"
afterEach try error:
"
+
e
);
}
console
.
info
(
'
afterEach end
'
);
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0100
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 001
*/
it
(
'
testRegister001
'
,
0
,
async
function
(
done
)
{
try
{
console
.
info
(
"
testRegister001Begin
"
);
continuationManager
.
register
(
function
(
err
,
data
)
{
expect
(
err
.
code
==
0
).
assertTrue
();
done
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegister001
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0200
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 002
*/
it
(
'
testRegister002
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[],
targetBundle
:
""
,
description
:
""
,
filter
:
""
,
continuationMode
:
null
,
authInfo
:
{}
};
continuationManager
.
register
(
continuationExtraParams
,
function
(
err
,
data
){
console
.
info
(
"
testRegister002
"
+
err
.
message
);
expect
(
err
.
message
==
"
Invalidate params.
"
).
assertTrue
();
done
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegister002
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0300
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 003
*/
it
(
'
testRegister003
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
targetBundle
:
"
ohos.example.test
"
,
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
10
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
register
(
continuationExtraParams
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
29360216
).
assertTrue
();
console
.
info
(
"
testRegister003
"
+
err
);
done
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegister003
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0400
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 004
*/
it
(
'
testRegister004
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
targetBundle
:
"
ohos.example.test
"
,
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_MULTIPLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
register
(
continuationExtraParams
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
0
).
assertTrue
();
done
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegister004
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0500
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 005
*/
it
(
'
testRegister005
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
targetBundle
:
"
ohos.example.test
"
,
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_SINGLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
register
(
continuationExtraParams
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
0
).
assertTrue
();
done
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegister005
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0600
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 006
*/
it
(
'
testRegister006
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
targetBundle
:
"
ohos.example.test
"
,
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_SINGLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
register
(
continuationExtraParams
).
then
((
data
)
=>
{
expect
(
data
!=
-
1
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
29360210
).
assertTrue
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegister006
"
+
e
);
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0700
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 007
*/
it
(
'
testRegister007
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_MULTIPLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
register
(
continuationExtraParams
).
then
((
data
)
=>
{
expect
(
data
!=
-
1
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
29360210
).
assertTrue
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegister007
"
+
e
);
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0800
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 008
*/
it
(
'
testRegister008
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[],
description
:
""
,
filter
:
""
,
continuationMode
:
null
,
authInfo
:
{}
};
continuationManager
.
register
(
continuationExtraParams
).
then
((
data
)
=>
{
expect
(
data
!=
-
1
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
29360210
).
assertTrue
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegister008
"
+
e
);
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0900
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 009
*/
it
(
'
testRegister009
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
10
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
register
(
continuationExtraParams
).
then
((
data
)
=>
{
expect
(
data
!=
-
1
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
29360210
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testRegister009
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_1000
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 010
*/
it
(
'
testRegister010
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
register
().
then
((
data
)
=>
{
expect
(
data
!=
-
1
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
29360210
).
assertTrue
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegister010
"
+
e
);
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0100
* @tc.name [JS-API9]ContinuationManager.registerContinuation().
* @tc.desc Test Js Api ContinuationManager.registerContinuation() testcase 001
*/
it
(
'
testRegisterContinuation001
'
,
0
,
async
function
(
done
)
{
try
{
console
.
info
(
"
testRegisterContinuation001Begin
"
);
continuationManager
.
registerContinuation
(
function
(
err
,
data
)
{
expect
(
err
.
code
==
0
).
assertTrue
();
done
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegisterContinuation001
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0200
* @tc.name [JS-API9]ContinuationManager.registerContinuation().
* @tc.desc Test Js Api ContinuationManager.registerContinuation() testcase 002
*/
it
(
'
testRegisterContinuation002
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[],
targetBundle
:
""
,
description
:
""
,
filter
:
""
,
continuationMode
:
null
,
authInfo
:
{}
};
continuationManager
.
registerContinuation
(
continuationExtraParams
,
function
(
err
,
data
){
console
.
info
(
"
testRegisterContinuation002
"
+
err
.
message
);
expect
(
err
.
code
==
401
).
assertTrue
();
done
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegisterContinuation002
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0300
* @tc.name [JS-API9]ContinuationManager.registerContinuation().
* @tc.desc Test Js Api ContinuationManager.registerContinuation() testcase 003
*/
it
(
'
testRegisterContinuation003
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
targetBundle
:
"
ohos.example.test
"
,
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
10
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
registerContinuation
(
continuationExtraParams
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
401
).
assertTrue
();
console
.
info
(
"
testRegisterContinuation003
"
+
err
);
done
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegisterContinuation003
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0400
* @tc.name [JS-API9]ContinuationManager.registerContinuation().
* @tc.desc Test Js Api ContinuationManager.registerContinuation() testcase 004
*/
it
(
'
testRegisterContinuation004
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
targetBundle
:
"
ohos.example.test
"
,
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_MULTIPLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
registerContinuation
(
continuationExtraParams
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
0
).
assertTrue
();
done
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegisterContinuation004
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0500
* @tc.name [JS-API9]ContinuationManager.registerContinuation().
* @tc.desc Test Js Api ContinuationManager.registerContinuation() testcase 005
*/
it
(
'
testRegisterContinuation005
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
targetBundle
:
"
ohos.example.test
"
,
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_SINGLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
registerContinuation
(
continuationExtraParams
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
0
).
assertTrue
();
done
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegisterContinuation005
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0600
* @tc.name [JS-API9]ContinuationManager.registerContinuation().
* @tc.desc Test Js Api ContinuationManager.registerContinuation() testcase 006
*/
it
(
'
testRegisterContinuation006
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
targetBundle
:
"
ohos.example.test
"
,
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_SINGLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
registerContinuation
(
continuationExtraParams
).
then
((
data
)
=>
{
expect
(
data
!=
-
1
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
16600002
).
assertTrue
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegisterContinuation006
"
+
e
);
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0700
* @tc.name [JS-API9]ContinuationManager.registerContinuation().
* @tc.desc Test Js Api ContinuationManager.registerContinuation() testcase 007
*/
it
(
'
testRegisterContinuation007
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_MULTIPLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
registerContinuation
(
continuationExtraParams
).
then
((
data
)
=>
{
expect
(
data
!=
-
1
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
16600002
).
assertTrue
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegisterContinuation007
"
+
e
);
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0800
* @tc.name [JS-API9]ContinuationManager.registerContinuation().
* @tc.desc Test Js Api ContinuationManager.registerContinuation() testcase 008
*/
it
(
'
testRegisterContinuation008
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[],
description
:
""
,
filter
:
""
,
continuationMode
:
null
,
authInfo
:
{}
};
continuationManager
.
registerContinuation
(
continuationExtraParams
).
then
((
data
)
=>
{
expect
(
data
!=
-
1
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
401
).
assertTrue
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegisterContinuation008
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
}
done
();
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0900
* @tc.name [JS-API9]ContinuationManager.registerContinuation().
* @tc.desc Test Js Api ContinuationManager.registerContinuation() testcase 009
*/
it
(
'
testRegisterContinuation009
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
10
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
registerContinuation
(
continuationExtraParams
).
then
((
data
)
=>
{
expect
(
data
!=
-
1
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
16600002
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testRegisterContinuation009
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_1000
* @tc.name [JS-API9]ContinuationManager.registerContinuation().
* @tc.desc Test Js Api ContinuationManager.registerContinuation() testcase 010
*/
it
(
'
testRegisterContinuation010
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
registerContinuation
().
then
((
data
)
=>
{
expect
(
data
!=
-
1
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
16600002
).
assertTrue
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegisterContinuation010
"
+
e
);
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0100
* @tc.name [JS-API8]ContinuationManager.unregister().
* @tc.desc Test Js Api ContinuationManager.unregister() testcase 001
*/
it
(
'
testUnregister001
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregister
(
token
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
0
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregister001
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0200
* @tc.name [JS-API8]ContinuationManager.unregister().
* @tc.desc Test Js Api ContinuationManager.unregister() testcase 002
*/
it
(
'
testUnregister002
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregister
(
null
,
function
(
err
,
data
)
{
console
.
info
(
"
testUnregister002
"
+
data
);
expect
(
err
.
message
==
"
Invalidate params.
"
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregister002
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0300
* @tc.name [JS-API8]ContinuationManager.unregister().
* @tc.desc Test Js Api ContinuationManager.unregister() testcase 003
*/
it
(
'
testUnregister003
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregister
(
300
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
29360208
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregister003
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0400
* @tc.name [JS-API8]ContinuationManager.unregister().
* @tc.desc Test Js Api ContinuationManager.unregister() testcase 004
*/
it
(
'
testUnregister004
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregister
(
300
,
function
(
data
)
{
expect
(
data
.
code
==
29360208
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregister004
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0500
* @tc.name [JS-API8]ContinuationManager.unregister().
* @tc.desc Test Js Api ContinuationManager.unregister() testcase 005
*/
it
(
'
testUnregister005
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregister
(
token
,
function
(
data
)
{
console
.
info
(
"
testUnregister005
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
code
==
0
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregister005
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0600
* @tc.name [JS-API8]ContinuationManager.unregister().
* @tc.desc Test Js Api ContinuationManager.unregister() testcase 006
*/
it
(
'
testUnregister006
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregister
(
token
).
then
((
data
)
=>
{
console
.
info
(
"
testUnregister006
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
code
==
0
).
assertTrue
();
}).
catch
((
err
)
=>
{
async
function
requestPermission
()
{
try
{
let
context
=
featureAbility
.
getContext
();
await
context
.
requestPermissionsFromUser
([
'
ohos.permission.DISTRIBUTED_DATASYNC
'
],
666
,
(
data
)
=>
{
console
.
info
(
'
TestApplication requestPermission data:
'
+
JSON
.
stringify
(
data
));
});
}
catch
(
err
)
{
console
.
error
(
'
TestApplication permission
'
+
JSON
.
stringify
(
err
));
}
}
async
function
driveFn
()
{
try
{
let
driver
=
await
UiDriver
.
create
();
console
.
info
(
`come in driveFn`
);
console
.
info
(
`driver is
${
JSON
.
stringify
(
driver
)}
`
);
sleep
(
2000
);
let
button
=
await
driver
.
findComponent
(
BY
.
text
(
'
允许
'
));
console
.
info
(
`button is
${
JSON
.
stringify
(
button
)}
`
);
sleep
(
5000
);
await
button
.
click
();
}
catch
(
err
)
{
console
.
info
(
'
err is
'
+
err
);
return
;
}
}
beforeAll
(
async
function
(
done
)
{
console
.
info
(
'
beforeAll
'
);
await
requestPermission
();
sleep
(
5000
);
await
driveFn
();
sleep
(
5000
);
done
();
})
afterAll
(
async
function
(
done
)
{
console
.
info
(
'
afterAll
'
);
done
();
})
beforeEach
(
async
function
(
done
)
{
console
.
info
(
'
beforeEach
'
);
try
{
await
continuationManager
.
registerContinuation
().
then
((
data
)
=>
{
token
=
data
;
console
.
info
(
'
beforeEach registerContinuation success
'
);
done
();
})
.
catch
((
e
)
=>
{
console
.
info
(
"
beforeEach promise error:
"
+
e
);
});
}
catch
(
e
)
{
console
.
info
(
"
beforeEach try error:
"
+
e
);
}
console
.
info
(
'
beforeEach end
'
);
})
afterEach
(
async
function
(
done
)
{
console
.
info
(
'
afterEach
'
);
try
{
await
continuationManager
.
unregisterContinuation
(
token
).
then
((
data
)
=>
{
console
.
info
(
'
afterEach unregisterContinuation success
'
);
done
();
})
.
catch
((
e
)
=>
{
console
.
info
(
"
afterEach promise error:
"
+
e
);
});
}
catch
(
e
)
{
console
.
info
(
"
afterEach try error:
"
+
e
);
}
console
.
info
(
'
afterEach end
'
);
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0100
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 001
*/
it
(
'
testRegister001
'
,
0
,
async
function
(
done
)
{
try
{
console
.
info
(
"
testRegister001Begin
"
);
continuationManager
.
register
(
function
(
err
,
data
)
{
expect
(
err
.
code
==
0
).
assertTrue
();
done
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegister001
"
+
e
);
expect
(
null
).
assertFail
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregister006
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0100
* @tc.name [JS-API9]ContinuationManager.unregisterContinuation().
* @tc.desc Test Js Api ContinuationManager.unregisterContinuation() testcase 001
*/
it
(
'
testUnregisterContinuation001
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregisterContinuation
(
token
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
0
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregisterContinuation001
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0200
* @tc.name [JS-API9]ContinuationManager.unregisterContinuation().
* @tc.desc Test Js Api ContinuationManager.unregisterContinuation() testcase 002
*/
it
(
'
testUnregisterContinuation002
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregisterContinuation
(
"
invalid token
"
,
function
(
err
,
data
)
{
console
.
info
(
"
testUnregisterContinuation002
"
+
data
);
expect
(
err
.
code
==
401
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregisterContinuation002
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0300
* @tc.name [JS-API9]ContinuationManager.unregisterContinuation().
* @tc.desc Test Js Api ContinuationManager.unregisterContinuation() testcase 003
*/
it
(
'
testUnregisterContinuation003
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregisterContinuation
(
300
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
16600002
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregisterContinuation003
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0400
* @tc.name [JS-API9]ContinuationManager.unregisterContinuation().
* @tc.desc Test Js Api ContinuationManager.unregisterContinuation() testcase 004
*/
it
(
'
testUnregisterContinuation004
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregisterContinuation
(
300
,
function
(
data
)
{
expect
(
data
.
code
==
16600002
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregisterContinuation004
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0500
* @tc.name [JS-API9]ContinuationManager.unregisterContinuation().
* @tc.desc Test Js Api ContinuationManager.unregisterContinuation() testcase 005
*/
it
(
'
testUnregisterContinuation005
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregisterContinuation
(
token
,
function
(
data
)
{
console
.
info
(
"
testUnregisterContinuation005
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
code
==
0
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregisterContinuation005
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTERCONTINUATION_0600
* @tc.name [JS-API8]ContinuationManager.unregisterContinuation().
* @tc.desc Test Js Api ContinuationManager.unregisterContinuation() testcase 006
*/
it
(
'
testUnregisterContinuation006
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregisterContinuation
(
token
).
then
((
data
)
=>
{
console
.
info
(
"
testUnregisterContinuation006
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
code
==
0
).
assertTrue
();
}).
catch
((
err
)
=>
{
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0200
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 002
*/
it
(
'
testRegister002
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[],
targetBundle
:
""
,
description
:
""
,
filter
:
""
,
continuationMode
:
null
,
authInfo
:
{}
};
continuationManager
.
register
(
continuationExtraParams
,
function
(
err
,
data
){
console
.
info
(
"
testRegister002
"
+
err
.
message
);
expect
(
err
.
message
==
"
Invalidate params.
"
).
assertTrue
();
done
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegister002
"
+
e
);
expect
(
null
).
assertFail
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregisterContinuation006
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_ON_0100
* @tc.name [JS-API8]ContinuationManager.on().
* @tc.desc Test Js Api ContinuationManager.on() testcase 001
*/
it
(
'
testOn001
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
on
(
"
deviceConnect
"
,
function
(
data
)
{
expect
(
data
!=
null
).
assertFail
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testOn001
"
+
e
);
expect
(
e
.
toString
().
includes
(
"
must be 3
"
)).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_ON_0200
* @tc.name [JS-API8]ContinuationManager.on().
* @tc.desc Test Js Api ContinuationManager.on() testcase 002
*/
it
(
'
testOn002
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
on
(
"
deviceDisconnect
"
,
function
(
data
)
{
expect
(
data
!=
null
).
assertFail
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testOn002
"
+
e
);
expect
(
e
.
toString
().
includes
(
"
must be 3
"
)).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_ON_0300
* @tc.name [JS-API9]ContinuationManager.on().
* @tc.desc Test Js Api ContinuationManager.on() testcase 003
*/
it
(
'
testOn003
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
on
(
"
deviceSelected
"
,
"
invalid token
"
,
function
(
data
)
{
expect
(
data
==
undefined
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
info
(
"
testOn003
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_ON_0400
* @tc.name [JS-API9]ContinuationManager.on().
* @tc.desc Test Js Api ContinuationManager.on() testcase 004
*/
it
(
'
testOn004
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
on
(
"
deviceUnselected
"
,
"
invalid token
"
,
function
(
data
)
{
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testOn004
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_OFF_0100
* @tc.name [JS-API8]ContinuationManager.off().
* @tc.desc Test Js Api ContinuationManager.off() testcase 001
*/
it
(
'
testOff001
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
off
(
"
deviceConnect
"
,
function
(
data
)
{
expect
(
data
!=
null
).
assertFail
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testOff001
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_OFF_0200
* @tc.name [JS-API8]ContinuationManager.off().
* @tc.desc Test Js Api ContinuationManager.off() testcase 002
*/
it
(
'
testOff002
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
off
(
"
deviceDisconnect
"
,
function
(
data
)
{
expect
(
data
!=
null
).
assertFail
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testOff002
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_OFF_0300
* @tc.name [JS-API9]ContinuationManager.off().
* @tc.desc Test Js Api ContinuationManager.off() testcase 003
*/
it
(
'
testOff003
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
off
(
"
deviceSelected
"
,
"
invalid token
"
);
done
();
}
catch
(
e
)
{
console
.
info
(
"
testOff003
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_OFF_0400
* @tc.name [JS-API9]ContinuationManager.off().
* @tc.desc Test Js Api ContinuationManager.off() testcase 004
*/
it
(
'
testOff004
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
off
(
"
deviceUnselected
"
,
"
invalid token
"
);
done
();
}
catch
(
e
)
{
console
.
info
(
"
testOff004
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0100
* @tc.name [JS-API8]ContinuationManager.startDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startDeviceManager() testcase 001
*/
it
(
'
testStartDeviceManager001
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
startDeviceManager
(
token
,
function
(
err
,
data
)
{
expect
(
err
.
code
!=
0
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartDeviceManager001
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0200
* @tc.name [JS-API8]ContinuationManager.startDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startDeviceManager() testcase 002
*/
it
(
'
testStartDeviceManager002
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
startDeviceManager
(
null
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
-
1
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartDeviceManager002
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0300
* @tc.name [JS-API8]ContinuationManager.startDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startDeviceManager() testcase 003
*/
it
(
'
testStartDeviceManager003
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_MULTIPLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
startDeviceManager
(
null
,
continuationExtraParams
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
-
1
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartDeviceManager003
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0400
* @tc.name [JS-API8]ContinuationManager.startDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startDeviceManager() testcase 004
*/
it
(
'
testStartDeviceManager004
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_MULTIPLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
startDeviceManager
(
52
,
continuationExtraParams
,
function
(
err
,
data
)
{
console
.
info
(
"
testStartDeviceManager004
"
+
err
.
code
);
expect
(
err
.
code
==
29360208
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartDeviceManager004
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0500
* @tc.name [JS-API8]ContinuationManager.startDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startDeviceManager() testcase 005
*/
it
(
'
testStartDeviceManager005
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
30
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
startDeviceManager
(
token
,
continuationExtraParams
,
function
(
err
,
data
)
{
console
.
info
(
"
testStartDeviceManager005
"
+
err
.
code
);
expect
(
err
.
code
==
29360216
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartDeviceManager005
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0600
* @tc.name [JS-API8]ContinuationManager.startDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startDeviceManager() testcase 006
*/
it
(
'
testStartDeviceManager006
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
};
continuationManager
.
startDeviceManager
(
token
,
continuationExtraParams
,
function
(
err
,
data
)
{
console
.
info
(
"
testStartDeviceManager006
"
+
err
.
code
);
expect
(
err
.
code
!=
0
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartDeviceManager006
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0700
* @tc.name [JS-API8]ContinuationManager.startDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startDeviceManager() testcase 007
*/
it
(
'
testStartDeviceManager007
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_MUTIPLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
startDeviceManager
(
token
,
continuationExtraParams
,
function
(
err
,
data
)
{
expect
(
err
.
code
!=
0
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartDeviceManager007
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0800
* @tc.name [JS-API8]ContinuationManager.startDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startDeviceManager() testcase 008
*/
it
(
'
testStartDeviceManager008
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_SINGLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
startDeviceManager
(
token
,
continuationExtraParams
).
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
29360210
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartDeviceManager008
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0900
* @tc.name [JS-API8]ContinuationManager.startDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startDeviceManager() testcase 009
*/
it
(
'
testStartDeviceManager009
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
startDeviceManager
(
token
).
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
29360210
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartDeviceManager009
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0100
* @tc.name [JS-API9]ContinuationManager.startContinuationDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startContinuationDeviceManager() testcase 001
*/
it
(
'
testStartContinuationDeviceManager001
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
startContinuationDeviceManager
(
token
,
function
(
err
,
data
)
{
expect
(
err
.
code
!=
0
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartContinuationDeviceManager001
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0200
* @tc.name [JS-API9]ContinuationManager.startContinuationDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startContinuationDeviceManager() testcase 002
*/
it
(
'
testStartContinuationDeviceManager002
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
startContinuationDeviceManager
(
"
invalid token
"
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
401
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartContinuationDeviceManager002
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0300
* @tc.name [JS-API9]ContinuationManager.startContinuationDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startContinuationDeviceManager() testcase 003
*/
it
(
'
testStartContinuationDeviceManager003
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_MULTIPLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
startContinuationDeviceManager
(
"
invalid token
"
,
continuationExtraParams
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
401
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartContinuationDeviceManager003
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0400
* @tc.name [JS-API9]ContinuationManager.startContinuationDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startContinuationDeviceManager() testcase 004
*/
it
(
'
testStartContinuationDeviceManager004
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_MULTIPLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
startContinuationDeviceManager
(
52
,
continuationExtraParams
,
function
(
err
,
data
)
{
console
.
info
(
"
testStartContinuationDeviceManager004
"
+
err
.
code
);
expect
(
err
.
code
==
16600002
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartContinuationDeviceManager004
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0500
* @tc.name [JS-API9]ContinuationManager.startContinuationDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startContinuationDeviceManager() testcase 005
*/
it
(
'
testStartContinuationDeviceManager005
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
30
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
startContinuationDeviceManager
(
token
,
continuationExtraParams
,
function
(
err
,
data
)
{
console
.
info
(
"
testStartContinuationDeviceManager005
"
+
err
.
code
);
expect
(
err
.
code
==
401
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartContinuationDeviceManager005
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0600
* @tc.name [JS-API9]ContinuationManager.startContinuationDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startContinuationDeviceManager() testcase 006
*/
it
(
'
testStartContinuationDeviceManager006
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
};
continuationManager
.
startContinuationDeviceManager
(
token
,
continuationExtraParams
,
function
(
err
,
data
)
{
console
.
info
(
"
testStartContinuationDeviceManager006
"
+
err
.
code
);
expect
(
err
.
code
!=
0
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartContinuationDeviceManager006
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0700
* @tc.name [JS-API9]ContinuationManager.startContinuationDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startContinuationDeviceManager() testcase 007
*/
it
(
'
testStartContinuationDeviceManager007
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_MUTIPLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
startContinuationDeviceManager
(
token
,
continuationExtraParams
,
function
(
err
,
data
)
{
expect
(
err
.
code
!=
0
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartContinuationDeviceManager007
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0800
* @tc.name [JS-API9]ContinuationManager.startContinuationDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startContinuationDeviceManager() testcase 008
*/
it
(
'
testStartContinuationDeviceManager008
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_SINGLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
startContinuationDeviceManager
(
token
,
continuationExtraParams
).
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
16600002
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartContinuationDeviceManager008
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0900
* @tc.name [JS-API9]ContinuationManager.startContinuationDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startContinuationDeviceManager() testcase 009
*/
it
(
'
testStartContinuationDeviceManager009
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
startContinuationDeviceManager
(
token
).
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
16600002
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartContinuationDeviceManager009
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0100
* @tc.name [JS-API8]ContinuationManager.updateConnectStatus().
* @tc.desc Test Js Api ContinuationManager.updateConnectStatus() testcase 001
*/
it
(
'
testUpdateConnectStatus001
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
updateConnectStatus
(
token
,
TEST_DEVICE_ID
,
TEST_CONNECT_STATUS
,
function
(
err
,
data
)
{
expect
(
err
.
code
!=
0
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateConnectStatus001
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0200
* @tc.name [JS-API8]ContinuationManager.updateConnectStatus().
* @tc.desc Test Js Api ContinuationManager.updateConnectStatus() testcase 002
*/
it
(
'
testUpdateConnectStatus002
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
updateConnectStatus
(
null
,
TEST_DEVICE_ID
,
TEST_CONNECT_STATUS
,
function
(
err
,
data
)
{
console
.
info
(
"
testUpdateConnectStatus002
"
+
err
.
code
);
expect
(
err
.
code
==
-
1
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateConnectStatus002
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0300
* @tc.name [JS-API8]ContinuationManager.updateConnectStatus().
* @tc.desc Test Js Api ContinuationManager.updateConnectStatus() testcase 003
*/
it
(
'
testUpdateConnectStatus003
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
updateConnectStatus
(
token
,
TEST_DEVICE_ID
,
-
2
,
function
(
err
,
data
)
{
console
.
info
(
"
testUpdateConnectStatus003
"
+
err
.
code
);
expect
(
err
.
code
==
29360215
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateConnectStatus003
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0400
* @tc.name [JS-API8]ContinuationManager.updateConnectStatus().
* @tc.desc Test Js Api ContinuationManager.updateConnectStatus() testcase 004
*/
it
(
'
testUpdateConnectStatus004
'
,
0
,
async
function
(
done
)
{
try
{
console
.
info
(
'
testUpdateConnectStatus004 begin
'
);
continuationManager
.
updateConnectStatus
(
token
,
TEST_DEVICE_ID
,
continuationManager
.
DeviceConnectState
.
IDLE
).
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
29360210
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateConnectStatus004
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0500
* @tc.name [JS-API8]ContinuationManager.updateConnectStatus().
* @tc.desc Test Js Api ContinuationManager.updateConnectStatus() testcase 005
*/
it
(
'
testUpdateConnectStatus005
'
,
0
,
async
function
(
done
)
{
try
{
console
.
info
(
'
testUpdateConnectStatus005 begin
'
);
continuationManager
.
updateConnectStatus
(
token
,
TEST_DEVICE_ID
,
continuationManager
.
DeviceConnectState
.
CONNECTING
).
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
29360210
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateConnectStatus005
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0600
* @tc.name [JS-API8]ContinuationManager.updateConnectStatus().
* @tc.desc Test Js Api ContinuationManager.updateConnectStatus() testcase 006
*/
it
(
'
testUpdateConnectStatus006
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
updateConnectStatus
(
token
,
TEST_DEVICE_ID
,
continuationManager
.
DeviceConnectState
.
DISCONNECTING
).
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
29360210
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateConnectStatus006
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0100
* @tc.name [JS-API9]ContinuationManager.updateContinuationState().
* @tc.desc Test Js Api ContinuationManager.updateContinuationState() testcase 001
*/
it
(
'
testUpdateContinuationState001
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
updateContinuationState
(
token
,
TEST_DEVICE_ID
,
TEST_CONNECT_STATUS
,
function
(
err
,
data
)
{
expect
(
err
.
code
!=
0
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateContinuationState001
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0200
* @tc.name [JS-API9]ContinuationManager.updateContinuationState().
* @tc.desc Test Js Api ContinuationManager.updateContinuationState() testcase 002
*/
it
(
'
testUpdateContinuationState002
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
updateContinuationState
(
"
invalid token
"
,
TEST_DEVICE_ID
,
TEST_CONNECT_STATUS
,
function
(
err
,
data
)
{
console
.
info
(
"
testUpdateContinuationState002
"
+
err
.
code
);
expect
(
err
.
code
==
401
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateContinuationState002
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0300
* @tc.name [JS-API9]ContinuationManager.updateContinuationState().
* @tc.desc Test Js Api ContinuationManager.updateContinuationState() testcase 003
*/
it
(
'
testUpdateContinuationState003
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
updateContinuationState
(
token
,
TEST_DEVICE_ID
,
-
2
,
function
(
err
,
data
)
{
console
.
info
(
"
testUpdateContinuationState003
"
+
err
.
code
);
expect
(
err
.
code
==
401
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateContinuationState003
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0400
* @tc.name [JS-API9]ContinuationManager.updateContinuationState().
* @tc.desc Test Js Api ContinuationManager.updateContinuationState() testcase 004
*/
it
(
'
testUpdateContinuationState004
'
,
0
,
async
function
(
done
)
{
try
{
console
.
info
(
'
testUpdateContinuationState004 begin
'
);
continuationManager
.
updateContinuationState
(
token
,
TEST_DEVICE_ID
,
continuationManager
.
DeviceConnectState
.
IDLE
).
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
16600002
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateContinuationState004
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0500
* @tc.name [JS-API9]ContinuationManager.updateContinuationState().
* @tc.desc Test Js Api ContinuationManager.updateContinuationState() testcase 005
*/
it
(
'
testUpdateContinuationState005
'
,
0
,
async
function
(
done
)
{
try
{
console
.
info
(
'
testUpdateContinuationState005 begin
'
);
continuationManager
.
updateContinuationState
(
token
,
TEST_DEVICE_ID
,
continuationManager
.
DeviceConnectState
.
CONNECTING
).
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
16600002
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateContinuationState005
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0600
* @tc.name [JS-API9]ContinuationManager.updateContinuationState().
* @tc.desc Test Js Api ContinuationManager.updateContinuationState() testcase 006
*/
it
(
'
testUpdateContinuationState006
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
updateContinuationState
(
token
,
TEST_DEVICE_ID
,
continuationManager
.
DeviceConnectState
.
DISCONNECTING
).
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
16600002
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateContinuationState006
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0300
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 003
*/
it
(
'
testRegister003
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
targetBundle
:
"
ohos.example.test
"
,
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
10
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
register
(
continuationExtraParams
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
29360216
).
assertTrue
();
console
.
info
(
"
testRegister003
"
+
err
);
done
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegister003
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0400
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 004
*/
it
(
'
testRegister004
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
targetBundle
:
"
ohos.example.test
"
,
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_MULTIPLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
register
(
continuationExtraParams
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
0
).
assertTrue
();
done
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegister004
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0500
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 005
*/
it
(
'
testRegister005
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
targetBundle
:
"
ohos.example.test
"
,
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_SINGLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
register
(
continuationExtraParams
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
0
).
assertTrue
();
done
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegister005
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0600
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 006
*/
it
(
'
testRegister006
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
targetBundle
:
"
ohos.example.test
"
,
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_SINGLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
register
(
continuationExtraParams
).
then
((
data
)
=>
{
expect
(
data
!=
-
1
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
29360210
).
assertTrue
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegister006
"
+
e
);
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0700
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 007
*/
it
(
'
testRegister007
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_MULTIPLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
register
(
continuationExtraParams
).
then
((
data
)
=>
{
expect
(
data
!=
-
1
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
29360210
).
assertTrue
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegister007
"
+
e
);
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0800
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 008
*/
it
(
'
testRegister008
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[],
description
:
""
,
filter
:
""
,
continuationMode
:
null
,
authInfo
:
{}
};
continuationManager
.
register
(
continuationExtraParams
).
then
((
data
)
=>
{
expect
(
data
!=
-
1
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
29360210
).
assertTrue
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegister008
"
+
e
);
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0900
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 009
*/
it
(
'
testRegister009
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
10
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
register
(
continuationExtraParams
).
then
((
data
)
=>
{
expect
(
data
!=
-
1
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
29360210
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testRegister009
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_1000
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 010
*/
it
(
'
testRegister010
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
register
().
then
((
data
)
=>
{
expect
(
data
!=
-
1
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
29360210
).
assertTrue
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegister010
"
+
e
);
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0100
* @tc.name [JS-API9]ContinuationManager.registerContinuation().
* @tc.desc Test Js Api ContinuationManager.registerContinuation() testcase 001
*/
it
(
'
testRegisterContinuation001
'
,
0
,
async
function
(
done
)
{
try
{
console
.
info
(
"
testRegisterContinuation001Begin
"
);
continuationManager
.
registerContinuation
(
function
(
err
,
data
)
{
expect
(
err
.
code
==
0
).
assertTrue
();
done
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegisterContinuation001
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0200
* @tc.name [JS-API9]ContinuationManager.registerContinuation().
* @tc.desc Test Js Api ContinuationManager.registerContinuation() testcase 002
*/
it
(
'
testRegisterContinuation002
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[],
targetBundle
:
""
,
description
:
""
,
filter
:
""
,
continuationMode
:
null
,
authInfo
:
{}
};
continuationManager
.
registerContinuation
(
continuationExtraParams
,
function
(
err
,
data
){
console
.
info
(
"
testRegisterContinuation002
"
+
err
.
message
);
expect
(
err
.
code
==
401
).
assertTrue
();
done
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegisterContinuation002
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0300
* @tc.name [JS-API9]ContinuationManager.registerContinuation().
* @tc.desc Test Js Api ContinuationManager.registerContinuation() testcase 003
*/
it
(
'
testRegisterContinuation003
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
targetBundle
:
"
ohos.example.test
"
,
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
10
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
registerContinuation
(
continuationExtraParams
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
401
).
assertTrue
();
console
.
info
(
"
testRegisterContinuation003
"
+
err
);
done
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegisterContinuation003
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0400
* @tc.name [JS-API9]ContinuationManager.registerContinuation().
* @tc.desc Test Js Api ContinuationManager.registerContinuation() testcase 004
*/
it
(
'
testRegisterContinuation004
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
targetBundle
:
"
ohos.example.test
"
,
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_MULTIPLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
registerContinuation
(
continuationExtraParams
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
0
).
assertTrue
();
done
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegisterContinuation004
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0500
* @tc.name [JS-API9]ContinuationManager.registerContinuation().
* @tc.desc Test Js Api ContinuationManager.registerContinuation() testcase 005
*/
it
(
'
testRegisterContinuation005
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
targetBundle
:
"
ohos.example.test
"
,
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_SINGLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
registerContinuation
(
continuationExtraParams
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
0
).
assertTrue
();
done
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegisterContinuation005
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0600
* @tc.name [JS-API9]ContinuationManager.registerContinuation().
* @tc.desc Test Js Api ContinuationManager.registerContinuation() testcase 006
*/
it
(
'
testRegisterContinuation006
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
targetBundle
:
"
ohos.example.test
"
,
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_SINGLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
registerContinuation
(
continuationExtraParams
).
then
((
data
)
=>
{
expect
(
data
!=
-
1
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
16600002
).
assertTrue
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegisterContinuation006
"
+
e
);
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0700
* @tc.name [JS-API9]ContinuationManager.registerContinuation().
* @tc.desc Test Js Api ContinuationManager.registerContinuation() testcase 007
*/
it
(
'
testRegisterContinuation007
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_MULTIPLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
registerContinuation
(
continuationExtraParams
).
then
((
data
)
=>
{
expect
(
data
!=
-
1
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
16600002
).
assertTrue
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegisterContinuation007
"
+
e
);
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0800
* @tc.name [JS-API9]ContinuationManager.registerContinuation().
* @tc.desc Test Js Api ContinuationManager.registerContinuation() testcase 008
*/
it
(
'
testRegisterContinuation008
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[],
description
:
""
,
filter
:
""
,
continuationMode
:
null
,
authInfo
:
{}
};
continuationManager
.
registerContinuation
(
continuationExtraParams
).
then
((
data
)
=>
{
expect
(
data
!=
-
1
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
401
).
assertTrue
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegisterContinuation008
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
}
done
();
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0900
* @tc.name [JS-API9]ContinuationManager.registerContinuation().
* @tc.desc Test Js Api ContinuationManager.registerContinuation() testcase 009
*/
it
(
'
testRegisterContinuation009
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
10
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
registerContinuation
(
continuationExtraParams
).
then
((
data
)
=>
{
expect
(
data
!=
-
1
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
16600002
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testRegisterContinuation009
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_1000
* @tc.name [JS-API9]ContinuationManager.registerContinuation().
* @tc.desc Test Js Api ContinuationManager.registerContinuation() testcase 010
*/
it
(
'
testRegisterContinuation010
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
registerContinuation
().
then
((
data
)
=>
{
expect
(
data
!=
-
1
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
16600002
).
assertTrue
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegisterContinuation010
"
+
e
);
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0100
* @tc.name [JS-API8]ContinuationManager.unregister().
* @tc.desc Test Js Api ContinuationManager.unregister() testcase 001
*/
it
(
'
testUnregister001
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregister
(
token
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
0
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregister001
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0200
* @tc.name [JS-API8]ContinuationManager.unregister().
* @tc.desc Test Js Api ContinuationManager.unregister() testcase 002
*/
it
(
'
testUnregister002
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregister
(
null
,
function
(
err
,
data
)
{
console
.
info
(
"
testUnregister002
"
+
data
);
expect
(
err
.
message
==
"
Invalidate params.
"
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregister002
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0300
* @tc.name [JS-API8]ContinuationManager.unregister().
* @tc.desc Test Js Api ContinuationManager.unregister() testcase 003
*/
it
(
'
testUnregister003
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregister
(
300
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
29360208
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregister003
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0400
* @tc.name [JS-API8]ContinuationManager.unregister().
* @tc.desc Test Js Api ContinuationManager.unregister() testcase 004
*/
it
(
'
testUnregister004
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregister
(
300
,
function
(
data
)
{
expect
(
data
.
code
==
29360208
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregister004
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0500
* @tc.name [JS-API8]ContinuationManager.unregister().
* @tc.desc Test Js Api ContinuationManager.unregister() testcase 005
*/
it
(
'
testUnregister005
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregister
(
token
,
function
(
data
)
{
console
.
info
(
"
testUnregister005
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
code
==
0
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregister005
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0600
* @tc.name [JS-API8]ContinuationManager.unregister().
* @tc.desc Test Js Api ContinuationManager.unregister() testcase 006
*/
it
(
'
testUnregister006
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregister
(
token
).
then
((
data
)
=>
{
console
.
info
(
"
testUnregister006
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
code
==
0
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
null
).
assertFail
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregister006
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0100
* @tc.name [JS-API9]ContinuationManager.unregisterContinuation().
* @tc.desc Test Js Api ContinuationManager.unregisterContinuation() testcase 001
*/
it
(
'
testUnregisterContinuation001
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregisterContinuation
(
token
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
0
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregisterContinuation001
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0200
* @tc.name [JS-API9]ContinuationManager.unregisterContinuation().
* @tc.desc Test Js Api ContinuationManager.unregisterContinuation() testcase 002
*/
it
(
'
testUnregisterContinuation002
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregisterContinuation
(
"
invalid token
"
,
function
(
err
,
data
)
{
console
.
info
(
"
testUnregisterContinuation002
"
+
data
);
expect
(
err
.
code
==
401
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregisterContinuation002
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0300
* @tc.name [JS-API9]ContinuationManager.unregisterContinuation().
* @tc.desc Test Js Api ContinuationManager.unregisterContinuation() testcase 003
*/
it
(
'
testUnregisterContinuation003
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregisterContinuation
(
300
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
16600002
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregisterContinuation003
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0400
* @tc.name [JS-API9]ContinuationManager.unregisterContinuation().
* @tc.desc Test Js Api ContinuationManager.unregisterContinuation() testcase 004
*/
it
(
'
testUnregisterContinuation004
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregisterContinuation
(
300
,
function
(
data
)
{
expect
(
data
.
code
==
16600002
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregisterContinuation004
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0500
* @tc.name [JS-API9]ContinuationManager.unregisterContinuation().
* @tc.desc Test Js Api ContinuationManager.unregisterContinuation() testcase 005
*/
it
(
'
testUnregisterContinuation005
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregisterContinuation
(
token
,
function
(
data
)
{
console
.
info
(
"
testUnregisterContinuation005
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
code
==
0
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregisterContinuation005
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTERCONTINUATION_0600
* @tc.name [JS-API8]ContinuationManager.unregisterContinuation().
* @tc.desc Test Js Api ContinuationManager.unregisterContinuation() testcase 006
*/
it
(
'
testUnregisterContinuation006
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregisterContinuation
(
token
).
then
((
data
)
=>
{
console
.
info
(
"
testUnregisterContinuation006
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
code
==
0
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
null
).
assertFail
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregisterContinuation006
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_ON_0100
* @tc.name [JS-API8]ContinuationManager.on().
* @tc.desc Test Js Api ContinuationManager.on() testcase 001
*/
it
(
'
testOn001
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
on
(
"
deviceConnect
"
,
function
(
data
)
{
expect
(
data
!=
null
).
assertFail
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testOn001
"
+
e
);
expect
(
e
.
toString
().
includes
(
"
must be 3
"
)).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_ON_0200
* @tc.name [JS-API8]ContinuationManager.on().
* @tc.desc Test Js Api ContinuationManager.on() testcase 002
*/
it
(
'
testOn002
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
on
(
"
deviceDisconnect
"
,
function
(
data
)
{
expect
(
data
!=
null
).
assertFail
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testOn002
"
+
e
);
expect
(
e
.
toString
().
includes
(
"
must be 3
"
)).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_ON_0300
* @tc.name [JS-API9]ContinuationManager.on().
* @tc.desc Test Js Api ContinuationManager.on() testcase 003
*/
it
(
'
testOn003
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
on
(
"
deviceSelected
"
,
"
invalid token
"
,
function
(
data
)
{
expect
(
data
==
undefined
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
info
(
"
testOn003
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_ON_0400
* @tc.name [JS-API9]ContinuationManager.on().
* @tc.desc Test Js Api ContinuationManager.on() testcase 004
*/
it
(
'
testOn004
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
on
(
"
deviceUnselected
"
,
"
invalid token
"
,
function
(
data
)
{
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testOn004
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_OFF_0100
* @tc.name [JS-API8]ContinuationManager.off().
* @tc.desc Test Js Api ContinuationManager.off() testcase 001
*/
it
(
'
testOff001
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
off
(
"
deviceConnect
"
,
function
(
data
)
{
expect
(
data
!=
null
).
assertFail
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testOff001
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_OFF_0200
* @tc.name [JS-API8]ContinuationManager.off().
* @tc.desc Test Js Api ContinuationManager.off() testcase 002
*/
it
(
'
testOff002
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
off
(
"
deviceDisconnect
"
,
function
(
data
)
{
expect
(
data
!=
null
).
assertFail
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testOff002
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_OFF_0300
* @tc.name [JS-API9]ContinuationManager.off().
* @tc.desc Test Js Api ContinuationManager.off() testcase 003
*/
it
(
'
testOff003
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
off
(
"
deviceSelected
"
,
"
invalid token
"
);
done
();
}
catch
(
e
)
{
console
.
info
(
"
testOff003
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_OFF_0400
* @tc.name [JS-API9]ContinuationManager.off().
* @tc.desc Test Js Api ContinuationManager.off() testcase 004
*/
it
(
'
testOff004
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
off
(
"
deviceUnselected
"
,
"
invalid token
"
);
done
();
}
catch
(
e
)
{
console
.
info
(
"
testOff004
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0100
* @tc.name [JS-API8]ContinuationManager.startDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startDeviceManager() testcase 001
*/
it
(
'
testStartDeviceManager001
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
startDeviceManager
(
token
,
function
(
err
,
data
)
{
expect
(
err
.
code
!=
0
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartDeviceManager001
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0200
* @tc.name [JS-API8]ContinuationManager.startDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startDeviceManager() testcase 002
*/
it
(
'
testStartDeviceManager002
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
startDeviceManager
(
null
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
-
1
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartDeviceManager002
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0300
* @tc.name [JS-API8]ContinuationManager.startDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startDeviceManager() testcase 003
*/
it
(
'
testStartDeviceManager003
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_MULTIPLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
startDeviceManager
(
null
,
continuationExtraParams
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
-
1
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartDeviceManager003
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0400
* @tc.name [JS-API8]ContinuationManager.startDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startDeviceManager() testcase 004
*/
it
(
'
testStartDeviceManager004
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_MULTIPLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
startDeviceManager
(
52
,
continuationExtraParams
,
function
(
err
,
data
)
{
console
.
info
(
"
testStartDeviceManager004
"
+
err
.
code
);
expect
(
err
.
code
==
29360208
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartDeviceManager004
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0500
* @tc.name [JS-API8]ContinuationManager.startDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startDeviceManager() testcase 005
*/
it
(
'
testStartDeviceManager005
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
30
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
startDeviceManager
(
token
,
continuationExtraParams
,
function
(
err
,
data
)
{
console
.
info
(
"
testStartDeviceManager005
"
+
err
.
code
);
expect
(
err
.
code
==
29360216
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartDeviceManager005
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0600
* @tc.name [JS-API8]ContinuationManager.startDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startDeviceManager() testcase 006
*/
it
(
'
testStartDeviceManager006
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
};
continuationManager
.
startDeviceManager
(
token
,
continuationExtraParams
,
function
(
err
,
data
)
{
console
.
info
(
"
testStartDeviceManager006
"
+
err
.
code
);
expect
(
err
.
code
!=
0
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartDeviceManager006
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0700
* @tc.name [JS-API8]ContinuationManager.startDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startDeviceManager() testcase 007
*/
it
(
'
testStartDeviceManager007
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_MUTIPLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
startDeviceManager
(
token
,
continuationExtraParams
,
function
(
err
,
data
)
{
expect
(
err
.
code
!=
0
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartDeviceManager007
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0800
* @tc.name [JS-API8]ContinuationManager.startDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startDeviceManager() testcase 008
*/
it
(
'
testStartDeviceManager008
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_SINGLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
startDeviceManager
(
token
,
continuationExtraParams
).
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
29360210
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartDeviceManager008
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0900
* @tc.name [JS-API8]ContinuationManager.startDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startDeviceManager() testcase 009
*/
it
(
'
testStartDeviceManager009
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
startDeviceManager
(
token
).
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
29360210
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartDeviceManager009
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0100
* @tc.name [JS-API9]ContinuationManager.startContinuationDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startContinuationDeviceManager() testcase 001
*/
it
(
'
testStartContinuationDeviceManager001
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
startContinuationDeviceManager
(
token
,
function
(
err
,
data
)
{
expect
(
err
.
code
!=
0
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartContinuationDeviceManager001
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0200
* @tc.name [JS-API9]ContinuationManager.startContinuationDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startContinuationDeviceManager() testcase 002
*/
it
(
'
testStartContinuationDeviceManager002
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
startContinuationDeviceManager
(
"
invalid token
"
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
401
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartContinuationDeviceManager002
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0300
* @tc.name [JS-API9]ContinuationManager.startContinuationDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startContinuationDeviceManager() testcase 003
*/
it
(
'
testStartContinuationDeviceManager003
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_MULTIPLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
startContinuationDeviceManager
(
"
invalid token
"
,
continuationExtraParams
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
401
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartContinuationDeviceManager003
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0400
* @tc.name [JS-API9]ContinuationManager.startContinuationDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startContinuationDeviceManager() testcase 004
*/
it
(
'
testStartContinuationDeviceManager004
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_MULTIPLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
startContinuationDeviceManager
(
52
,
continuationExtraParams
,
function
(
err
,
data
)
{
console
.
info
(
"
testStartContinuationDeviceManager004
"
+
err
.
code
);
expect
(
err
.
code
==
16600002
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartContinuationDeviceManager004
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0500
* @tc.name [JS-API9]ContinuationManager.startContinuationDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startContinuationDeviceManager() testcase 005
*/
it
(
'
testStartContinuationDeviceManager005
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
30
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
startContinuationDeviceManager
(
token
,
continuationExtraParams
,
function
(
err
,
data
)
{
console
.
info
(
"
testStartContinuationDeviceManager005
"
+
err
.
code
);
expect
(
err
.
code
==
401
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartContinuationDeviceManager005
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0600
* @tc.name [JS-API9]ContinuationManager.startContinuationDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startContinuationDeviceManager() testcase 006
*/
it
(
'
testStartContinuationDeviceManager006
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
};
continuationManager
.
startContinuationDeviceManager
(
token
,
continuationExtraParams
,
function
(
err
,
data
)
{
console
.
info
(
"
testStartContinuationDeviceManager006
"
+
err
.
code
);
expect
(
err
.
code
!=
0
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartContinuationDeviceManager006
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0700
* @tc.name [JS-API9]ContinuationManager.startContinuationDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startContinuationDeviceManager() testcase 007
*/
it
(
'
testStartContinuationDeviceManager007
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_MUTIPLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
startContinuationDeviceManager
(
token
,
continuationExtraParams
,
function
(
err
,
data
)
{
expect
(
err
.
code
!=
0
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartContinuationDeviceManager007
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0800
* @tc.name [JS-API9]ContinuationManager.startContinuationDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startContinuationDeviceManager() testcase 008
*/
it
(
'
testStartContinuationDeviceManager008
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_SINGLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
startContinuationDeviceManager
(
token
,
continuationExtraParams
).
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
16600002
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartContinuationDeviceManager008
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0900
* @tc.name [JS-API9]ContinuationManager.startContinuationDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startContinuationDeviceManager() testcase 009
*/
it
(
'
testStartContinuationDeviceManager009
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
startContinuationDeviceManager
(
token
).
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
16600002
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartContinuationDeviceManager009
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0100
* @tc.name [JS-API8]ContinuationManager.updateConnectStatus().
* @tc.desc Test Js Api ContinuationManager.updateConnectStatus() testcase 001
*/
it
(
'
testUpdateConnectStatus001
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
updateConnectStatus
(
token
,
TEST_DEVICE_ID
,
TEST_CONNECT_STATUS
,
function
(
err
,
data
)
{
expect
(
err
.
code
!=
0
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateConnectStatus001
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0200
* @tc.name [JS-API8]ContinuationManager.updateConnectStatus().
* @tc.desc Test Js Api ContinuationManager.updateConnectStatus() testcase 002
*/
it
(
'
testUpdateConnectStatus002
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
updateConnectStatus
(
null
,
TEST_DEVICE_ID
,
TEST_CONNECT_STATUS
,
function
(
err
,
data
)
{
console
.
info
(
"
testUpdateConnectStatus002
"
+
err
.
code
);
expect
(
err
.
code
==
-
1
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateConnectStatus002
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0300
* @tc.name [JS-API8]ContinuationManager.updateConnectStatus().
* @tc.desc Test Js Api ContinuationManager.updateConnectStatus() testcase 003
*/
it
(
'
testUpdateConnectStatus003
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
updateConnectStatus
(
token
,
TEST_DEVICE_ID
,
-
2
,
function
(
err
,
data
)
{
console
.
info
(
"
testUpdateConnectStatus003
"
+
err
.
code
);
expect
(
err
.
code
==
29360215
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateConnectStatus003
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0400
* @tc.name [JS-API8]ContinuationManager.updateConnectStatus().
* @tc.desc Test Js Api ContinuationManager.updateConnectStatus() testcase 004
*/
it
(
'
testUpdateConnectStatus004
'
,
0
,
async
function
(
done
)
{
try
{
console
.
info
(
'
testUpdateConnectStatus004 begin
'
);
continuationManager
.
updateConnectStatus
(
token
,
TEST_DEVICE_ID
,
continuationManager
.
DeviceConnectState
.
IDLE
).
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
29360210
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateConnectStatus004
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0500
* @tc.name [JS-API8]ContinuationManager.updateConnectStatus().
* @tc.desc Test Js Api ContinuationManager.updateConnectStatus() testcase 005
*/
it
(
'
testUpdateConnectStatus005
'
,
0
,
async
function
(
done
)
{
try
{
console
.
info
(
'
testUpdateConnectStatus005 begin
'
);
continuationManager
.
updateConnectStatus
(
token
,
TEST_DEVICE_ID
,
continuationManager
.
DeviceConnectState
.
CONNECTING
).
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
29360210
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateConnectStatus005
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0600
* @tc.name [JS-API8]ContinuationManager.updateConnectStatus().
* @tc.desc Test Js Api ContinuationManager.updateConnectStatus() testcase 006
*/
it
(
'
testUpdateConnectStatus006
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
updateConnectStatus
(
token
,
TEST_DEVICE_ID
,
continuationManager
.
DeviceConnectState
.
DISCONNECTING
).
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
29360210
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateConnectStatus006
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0100
* @tc.name [JS-API9]ContinuationManager.updateContinuationState().
* @tc.desc Test Js Api ContinuationManager.updateContinuationState() testcase 001
*/
it
(
'
testUpdateContinuationState001
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
updateContinuationState
(
token
,
TEST_DEVICE_ID
,
TEST_CONNECT_STATUS
,
function
(
err
,
data
)
{
expect
(
err
.
code
!=
0
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateContinuationState001
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0200
* @tc.name [JS-API9]ContinuationManager.updateContinuationState().
* @tc.desc Test Js Api ContinuationManager.updateContinuationState() testcase 002
*/
it
(
'
testUpdateContinuationState002
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
updateContinuationState
(
"
invalid token
"
,
TEST_DEVICE_ID
,
TEST_CONNECT_STATUS
,
function
(
err
,
data
)
{
console
.
info
(
"
testUpdateContinuationState002
"
+
err
.
code
);
expect
(
err
.
code
==
401
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateContinuationState002
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0300
* @tc.name [JS-API9]ContinuationManager.updateContinuationState().
* @tc.desc Test Js Api ContinuationManager.updateContinuationState() testcase 003
*/
it
(
'
testUpdateContinuationState003
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
updateContinuationState
(
token
,
TEST_DEVICE_ID
,
-
2
,
function
(
err
,
data
)
{
console
.
info
(
"
testUpdateContinuationState003
"
+
err
.
code
);
expect
(
err
.
code
==
401
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateContinuationState003
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0400
* @tc.name [JS-API9]ContinuationManager.updateContinuationState().
* @tc.desc Test Js Api ContinuationManager.updateContinuationState() testcase 004
*/
it
(
'
testUpdateContinuationState004
'
,
0
,
async
function
(
done
)
{
try
{
console
.
info
(
'
testUpdateContinuationState004 begin
'
);
continuationManager
.
updateContinuationState
(
token
,
TEST_DEVICE_ID
,
continuationManager
.
DeviceConnectState
.
IDLE
).
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
16600002
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateContinuationState004
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0500
* @tc.name [JS-API9]ContinuationManager.updateContinuationState().
* @tc.desc Test Js Api ContinuationManager.updateContinuationState() testcase 005
*/
it
(
'
testUpdateContinuationState005
'
,
0
,
async
function
(
done
)
{
try
{
console
.
info
(
'
testUpdateContinuationState005 begin
'
);
continuationManager
.
updateContinuationState
(
token
,
TEST_DEVICE_ID
,
continuationManager
.
DeviceConnectState
.
CONNECTING
).
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
16600002
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateContinuationState005
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0600
* @tc.name [JS-API9]ContinuationManager.updateContinuationState().
* @tc.desc Test Js Api ContinuationManager.updateContinuationState() testcase 006
*/
it
(
'
testUpdateContinuationState006
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
updateContinuationState
(
token
,
TEST_DEVICE_ID
,
continuationManager
.
DeviceConnectState
.
DISCONNECTING
).
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
16600002
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateContinuationState006
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
})
})}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录