Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
36602cd2
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
36602cd2
编写于
10月 20, 2022
作者:
O
openharmony_ci
提交者:
Gitee
10月 20, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5968 新增电话接口xts覆盖
Merge pull request !5968 from 李昊/master
上级
873e2486
45e21909
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
640 addition
and
4 deletion
+640
-4
telephony/telephonyjstest/netmanager_base/dns/src/main/js/test/NetworkManagerDNS.test.js
...nager_base/dns/src/main/js/test/NetworkManagerDNS.test.js
+1
-1
telephony/telephonyjstest/netmanager_base/jshttp/src/main/js/test/Http2Test.js
...test/netmanager_base/jshttp/src/main/js/test/Http2Test.js
+115
-0
telephony/telephonyjstest/netmanager_base/jshttp/src/main/js/test/HttpCacheTest.js
.../netmanager_base/jshttp/src/main/js/test/HttpCacheTest.js
+148
-0
telephony/telephonyjstest/netmanager_base/jshttp/src/main/js/test/List.test.js
...test/netmanager_base/jshttp/src/main/js/test/List.test.js
+4
-0
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/test/List.test.ets
...t/netmanager_socket/entry/src/main/ets/test/List.test.ets
+2
-0
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/test/NetworkManagerSocket.test.ets
...ket/entry/src/main/ets/test/NetworkManagerSocket.test.ets
+367
-0
telephony/telephonyjstest/sms_mms/BUILD.gn
telephony/telephonyjstest/sms_mms/BUILD.gn
+1
-1
telephony/telephonyjstest/sms_mms/sms_mms_error/BUILD.gn
telephony/telephonyjstest/sms_mms/sms_mms_error/BUILD.gn
+2
-2
未找到文件。
telephony/telephonyjstest/netmanager_base/dns/src/main/js/test/NetworkManagerDNS.test.js
浏览文件 @
36602cd2
...
...
@@ -161,7 +161,7 @@ export default function Telephony_NETMANAGER_TestDNSTest() {
it
(
'
Telephony_NETMANAGER_TestDNS_Test0900
'
,
0
,
function
(
done
){
let
netHandle
=
netConnection
.
getDefaultNetSync
();
console
.
info
(
"
Telephony_NETMANAGER_TestDNS_Test0900
"
+
JSON
.
stringify
(
netHandle
));
expect
(
netHandle
.
netId
).
assertEqual
(
100
);
expect
(
netHandle
.
netId
>=
100
).
assertTrue
(
);
done
();
});
});
...
...
telephony/telephonyjstest/netmanager_base/jshttp/src/main/js/test/Http2Test.js
0 → 100644
浏览文件 @
36602cd2
/**
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
net_Http
from
'
@ohos.net.http
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
export
default
function
Http2Test
()
{
describe
(
'
Http2Test
'
,
function
()
{
/**
* @tc.number Telephony_NETSTACK_Http2TestBasicGet_0100
* @tc.name set usingCache to true
* @tc.desc usingCache test
*/
it
(
'
Telephony_NETSTACK_Http2TestBasicGet_0100
'
,
0
,
async
function
(
done
)
{
let
http
=
net_Http
.
createHttp
()
http
.
request
(
"
https://www.zhihu.com
"
,
{
usingProtocol
:
net_Http
.
HttpProtocol
.
HTTP1_1
}).
then
(
function
(
data
)
{
console
.
info
(
"
Telephony_NETSTACK_Http2TestBasicGet_0100
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
responseCode
===
net_Http
.
ResponseCode
.
OK
).
assertTrue
();
done
();
})
});
/**
* @tc.number Telephony_NETSTACK_Http2TestBasicGet_0200
* @tc.name set usingCache to true
* @tc.desc usingCache test
*/
it
(
'
Telephony_NETSTACK_Http2TestBasicGet_0200
'
,
0
,
async
function
(
done
)
{
let
http
=
net_Http
.
createHttp
()
http
.
request
(
"
https://www.zhihu.com
"
,
{
usingProtocol
:
net_Http
.
HttpProtocol
.
HTTP2
}).
then
(
function
(
data
)
{
console
.
info
(
"
Telephony_NETSTACK_Http2TestBasicGet_0200
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
responseCode
===
net_Http
.
ResponseCode
.
OK
).
assertTrue
();
done
();
})
});
/**
* @tc.number Telephony_NETSTACK_Http2TestBasicGet_0300
* @tc.name set usingCache to true
* @tc.desc usingCache test
*/
it
(
'
Telephony_NETSTACK_Http2TestBasicGet_0300
'
,
0
,
async
function
(
done
)
{
let
http
=
net_Http
.
createHttp
()
http
.
request
(
"
https://www.zhihu.com
"
).
then
(
function
(
data
)
{
console
.
info
(
"
Telephony_NETSTACK_Http2TestBasicGet_0300
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
responseCode
===
net_Http
.
ResponseCode
.
OK
).
assertTrue
();
done
();
})
});
/**
* @tc.number Telephony_NETSTACK_Http2TestBasicGet_0400
* @tc.name set usingCache to true
* @tc.desc usingCache test
*/
it
(
'
Telephony_NETSTACK_Http2TestBasicGet_0400
'
,
0
,
async
function
(
done
)
{
expect
(
net_Http
.
HttpProtocol
.
HTTP1_1
).
assertEqual
(
0
);
expect
(
net_Http
.
HttpProtocol
.
HTTP2
).
assertEqual
(
1
);
done
();
});
/**
* @tc.number Telephony_NETSTACK_Http2TestBasicGet_0500
* @tc.name set usingCache to true
* @tc.desc usingCache test
*/
it
(
'
Telephony_NETSTACK_Http2TestBasicGet_0500
'
,
0
,
async
function
(
done
)
{
expect
(
net_Http
.
HttpDataType
.
STRING
).
assertEqual
(
0
);
expect
(
net_Http
.
HttpDataType
.
OBJECT
).
assertEqual
(
1
);
expect
(
net_Http
.
HttpDataType
.
ARRAY_BUFFER
).
assertEqual
(
2
);
done
();
});
it
(
'
Telephony_http_HttpTestPriority_0100
'
,
0
,
async
function
(
done
){
let
CaseName
=
'
Telephony_http_HttpTestPriority_0100
'
;
try
{
let
httpRequestOptions
=
{
method
:
net_http
.
RequestMethod
.
GET
,
extraData
:
null
,
header
:
"
content-type': 'application/json
"
,
readTimeout
:
6000
,
connectTimeout
:
6000
,
priority
:
100
}
var
httpRequest
=
net_http
.
createHttp
();
httpRequest
.
request
(
"
https://httpbin/anything
"
,
httpRequestOptions
,
(
err
,
data
)
=>
{
console
.
info
(
CaseName
+
Json
.
stringify
(
err
)
+
"
data
"
+
Json
.
stringify
(
data
));
expect
(
data
.
responseCode
===
net_http
.
ResponseCode
.
Ok
).
assertTrue
();
done
();
});
}
catch
(
err
){
console
.
info
(
CaseName
+
"
err=
"
+
err
)
done
();
return
;
}
})
});
}
\ No newline at end of file
telephony/telephonyjstest/netmanager_base/jshttp/src/main/js/test/HttpCacheTest.js
0 → 100644
浏览文件 @
36602cd2
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
net_http
from
'
@ohos.net.http
'
;
import
{
describe
,
expect
,
it
}
from
'
@ohos/hypium
'
export
default
function
HttpCacheTest
()
{
describe
(
'
HttpCacheTest
'
,
function
()
{
/**
* @tc.number Telephony_NetStack_HttpTestBasicGet_0100
* @tc.name set usingCache to true
* @tc.desc usingCache test
*/
it
(
'
Telephony_NetStack_HttpTestBasicGet_0100
'
,
0
,
async
function
(
done
){
let
CaseName
=
'
Telephony_NetStack_HttpTestBasicGet_0100
'
;
let
http
=
net_http
.
createHttp
();
http
.
request
(
'
https://httpbin.org/anything
'
,
{
usingCache
:
true
}).
then
(
function
(
data
){
console
.
info
(
CaseName
+
JSON
.
stringify
(
data
));
expect
(
data
.
responseCode
===
net_http
.
ResponseCode
.
OK
).
assertTrue
();
done
();
return
;
});
});
/**
* @tc.number Telephony_NetStack_HttpTestBasicGet_0200
* @tc.name set usingCache to false
* @tc.desc usingCache test
*/
it
(
'
Telephony_NetStack_HttpTestBasicGet_0200
'
,
0
,
async
function
(
done
){
let
CaseName
=
'
Telephony_NetStack_HttpTestBasicGet_0200
'
;
let
http
=
net_http
.
createHttp
();
http
.
request
(
'
https://httpbin.org/anything
'
,
{
usingCache
:
false
}).
then
(
function
(
data
){
console
.
info
(
CaseName
+
JSON
.
stringify
(
data
));
expect
(
data
.
responseCode
===
net_http
.
ResponseCode
.
OK
).
assertTrue
();
done
();
return
;
});
});
/**
* @tc.number Telephony_NetStack_HttpTestCacheFlush_0100
* @tc.name use callback form test cache.flush
* @tc.desc cache flush test
*/
it
(
'
Telephony_NetStack_HttpTestCacheFlush_0100
'
,
0
,
async
function
(
done
){
let
CaseName
=
'
Telephony_NetStack_HttpTestCacheFlush_0100
'
;
let
http
=
net_http
.
createHttp
();
let
cache
=
net_http
.
createHttpResponseCache
(
10
*
1024
*
1024
);
http
.
request
(
'
https://httpbin.org/anything
'
,{
usingCache
:
true
}).
then
(
function
(){
cache
.
flush
().
then
(
function
(
data
){
console
.
info
(
CaseName
+
JSON
.
stringify
(
data
));
expect
(
data
===
undefined
).
assertTrue
();
done
();
return
;
})
});
});
/**
* @tc.number Telephony_NetStack_HttpTestCacheFlush_0200
* @tc.name use promise form test cache.flush
* @tc.desc cache flush test
*/
it
(
'
Telephony_NetStack_HttpTestCacheFlush_0200
'
,
0
,
async
function
(
done
){
let
CaseName
=
'
Telephony_NetStack_HttpTestCacheFlush_0200
'
;
let
http
=
net_http
.
createHttp
();
let
cache
=
net_http
.
createHttpResponseCache
(
10
*
1024
*
1024
);
http
.
request
(
'
https://httpbin.org/anything
'
,{
usingCache
:
true
}).
then
(
function
(){
cache
.
flush
(
function
(
data
){
console
.
info
(
CaseName
+
JSON
.
stringify
(
data
));
expect
(
data
===
undefined
).
assertTrue
();
done
();
return
;
})
});
});
/**
* @tc.number Telephony_NetStack_HttpTestCacheDelete_0100
* @tc.name use callback form test cache.delete
* @tc.desc cache flush test
*/
it
(
'
Telephony_NetStack_HttpTestCacheDelete_0100
'
,
0
,
async
function
(
done
){
let
CaseName
=
'
Telephony_NetStack_HttpTestCacheDelete_0100
'
;
let
http
=
net_http
.
createHttp
();
let
cache
=
net_http
.
createHttpResponseCache
(
10
*
1024
*
1024
);
http
.
request
(
'
https://httpbin.org/anything
'
,{
usingCache
:
true
}).
then
(
function
(){
cache
.
delete
().
then
(
function
(
data
){
console
.
info
(
CaseName
+
JSON
.
stringify
(
data
));
expect
(
data
===
undefined
).
assertTrue
();
done
();
return
;
})
});
});
/**
* @tc.number Telephony_NetStack_HttpTestCacheDelete_0200
* @tc.name use callback form test cache.delete
* @tc.desc cache flush test
*/
it
(
'
Telephony_NetStack_HttpTestCacheDelete_0200
'
,
0
,
async
function
(
done
){
let
CaseName
=
'
Telephony_NetStack_HttpTestCacheDelete_0200
'
;
let
http
=
net_http
.
createHttp
();
let
cache
=
net_http
.
createHttpResponseCache
(
10
*
1024
*
1024
);
http
.
request
(
'
https://httpbin.org/anything
'
,{
usingCache
:
true
}).
then
(
function
(){
cache
.
delete
(
function
(
data
){
console
.
info
(
CaseName
+
JSON
.
stringify
(
data
));
expect
(
data
===
undefined
).
assertTrue
();
done
();
return
;
})
});
});
});
};
\ No newline at end of file
telephony/telephonyjstest/netmanager_base/jshttp/src/main/js/test/List.test.js
浏览文件 @
36602cd2
...
...
@@ -13,7 +13,11 @@
* limitations under the License.
*/
import
Telephony_NETSTACK_HTTPTest
from
'
./NetworkManagerHttp.test.js
'
import
Http2Test
from
'
./Http2Test.js
'
import
HttpCacheTest
from
'
./HttpCacheTest.js
'
export
default
function
testsuite
()
{
Telephony_NETSTACK_HTTPTest
()
Http2Test
()
HttpCacheTest
()
}
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/test/List.test.ets
浏览文件 @
36602cd2
...
...
@@ -18,6 +18,7 @@ import connectionJsunit from './ConnectionJsunit.test.ets';
import socketJsunit from './SocketJsunit.test.ets';
import webSocketJsunit from './WebSocketJsunit.test.ets';
import connectionSecondJsUnit from './ConnectionSecondJsUnit.test.ets';
import networkManagerSocketTest from './NetworkManagerSocket.test'
export default function testsuite() {
//other
...
...
@@ -25,4 +26,5 @@ export default function testsuite() {
webSocketJsunit();
connectionJsunit();
connectionSecondJsUnit();
networkManagerSocketTest();
}
\ No newline at end of file
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/test/NetworkManagerSocket.test.ets
0 → 100644
浏览文件 @
36602cd2
// @ts-nocheck
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License')
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, it, expect, beforeAll, afterAll, afterEach, beforeEach } from 'hypium/index';
import socket from "@ohos.net.socket";
let sendData = "hello!";
let instance = undefined;
let options = {
ALPNProtocols: ["spdy/1", "http/1.1"],
address: {
address: "192.168.31.96",
port: 5555,
family: 1
},
secureOptions: {
key: "key",
cert: "cert",
ca: ["ca"],
passwd: "123456",
protocols: [socket.Protocol.TLSv12, socket.Protocol.TLSv13],
useRemoteCipherPrefer: true,
signatureAlgorithms: "rsa_pss_rsae_sha256:ECDSA+SHA256",
cipherSuites: "AES256-SHA256"
},
}
export default function networkManagerSocketTest() {
describe("Telephony_NetworkManager_SocketTest", function () {
beforeAll(async function () {
console.log('Telephony_NetworkManager_ActsNetworkManagerSocketTest beforeAll start')
console.log('Telephony_NetworkManager_ActsNetworkManagerSocketTest beforeAll end')
})
afterAll(async function () {
console.log('Telephony_NetworkManager_ActsNetworkManagerSocketTest afterAll start')
console.log('Telephony_NetworkManager_ActsNetworkManagerSocketTest afterAll end')
})
/**
* @tc.number Telephony_NetworkManager_constructTLSSocketInstance_0100
* @tc.name Test create TLSSocket object
* @tc.desc Function test
*/
it('Telephony_NetworkManager_constructTLSSocketInstance_0100', 0, async function (done) {
instance = socket.constructTLSSocketInstance()
if (instance != "") {
expect(instance).assertInstanceOf('Object');
done();
} else {
expect().assertFail();
done();
}
})
/**
* @tc.number Telephony_NetworkManager_connect_Async_0100
* @tc.name Test connect() interface
* @tc.desc Function test
*/
it('Telephony_NetworkManager_connect_Async_0100', 0, async function (done) {
instance = socket.constructTLSSocketInstance()
instance.connect(options, (err) => {
expect(options.ALPNProtocols != undefined).assertEqual(true);
expect(options.address != undefined).assertEqual(true);
expect(options.secureOptions != undefined).assertEqual(true);
expect(options.secureOptions.key != undefined).assertEqual(true);
expect(options.secureOptions.cert != undefined).assertEqual(true);
expect(options.secureOptions.ca != undefined).assertEqual(true);
expect(options.secureOptions.passwd != undefined).assertEqual(true);
expect(options.secureOptions.protocols != undefined).assertEqual(true);
expect(options.secureOptions.protocols[0] == "TLSv1.2").assertEqual(true);
expect(options.secureOptions.protocols[1] == "TLSv1.3").assertEqual(true);
expect(options.secureOptions.useRemoteCipherPrefer != undefined).assertEqual(true);
expect(options.secureOptions.signatureAlgorithms != undefined).assertEqual(true);
expect(options.secureOptions.cipherSuites != undefined).assertEqual(true);
expect(socket.X509CertRawData == undefined).assertEqual(true);
if (err == undefined) {
expect().assertFail();
done();
} else {
expect(err != undefined).assertEqual(true);
done();
}
})
})
/**
* @tc.number Telephony_NetworkManager_connect_Promise_0100
* @tc.name Test connect() interface
* @tc.desc Function test
*/
it('Telephony_NetworkManager_connect_Promise_0100', 0, async function (done) {
instance = socket.constructTLSSocketInstance()
instance.connect(options).then(() => {
expect().assertFail();
done();
}).catch((err) => {
expect(err != undefined).assertEqual(true);
done();
})
})
/**
* @tc.number Telephony_NetworkManager_close_Async_0100
* @tc.name Test close() interface
* @tc.desc Function test
*/
it('Telephony_NetworkManager_close_Async_0100', 0, async function (done) {
instance = socket.constructTLSSocketInstance()
instance.close((err) => {
if (err == undefined) {
expect().assertFail();
done();
} else {
expect(err != undefined).assertEqual(true);
done();
}
})
})
/**
* @tc.number Telephony_NetworkManager_close_Promise_0100
* @tc.name Test close() interface
* @tc.desc Function test
*/
it('Telephony_NetworkManager_close_Promise_0100', 0, async function (done) {
instance = socket.constructTLSSocketInstance()
instance.close().then(() => {
expect().assertFail();
done();
}).catch((err) => {
expect(err != undefined).assertEqual(true);
done();
})
})
/**
* @tc.number Telephony_NetworkManager_getCertificate_Async_0100
* @tc.name Test getCertificate() interface
* @tc.desc Function test
*/
it('Telephony_NetworkManager_getCertificate_Async_0100', 0, async function (done) {
instance = socket.constructTLSSocketInstance()
instance.getCertificate((err, data) => {
if (err == undefined) {
expect().assertFail();
done();
} else {
expect(data).assertEqual(undefined);
expect(err != undefined).assertEqual(true);
done();
}
})
})
/**
* @tc.number Telephony_NetworkManager_getCertificate_Promise_0100
* @tc.name Test getCertificate() interface
* @tc.desc Function test
*/
it('Telephony_NetworkManager_getCertificate_Promise_0100', 0, async function (done) {
instance = socket.constructTLSSocketInstance()
instance.getCertificate().then((data) => {
expect(data).assertEqual(undefined);
expect().assertFail();
done();
}).catch((err) => {
expect(err != undefined).assertEqual(true);
done();
})
})
/**
* @tc.number Telephony_NetworkManager_getRemoteCertificate_Async_0100
* @tc.name Test getRemoteCertificate() interface
* @tc.desc Function test
*/
it('Telephony_NetworkManager_getRemoteCertificate_Async_0100', 0, async function (done) {
instance = socket.constructTLSSocketInstance()
instance.getRemoteCertificate((err, data) => {
if (err == undefined) {
expect().assertFail();
done();
} else {
expect(data).assertEqual(undefined);
expect(err != undefined).assertEqual(true);
done();
}
})
})
/**
* @tc.number Telephony_NetworkManager_getRemoteCertificate_Promise_0100
* @tc.name Test getRemoteCertificate() interface
* @tc.desc Function test
*/
it('Telephony_NetworkManager_getRemoteCertificate_Promise_0100', 0, async function (done) {
instance = socket.constructTLSSocketInstance()
instance.getRemoteCertificate().then((data) => {
expect(data).assertEqual(undefined);
expect().assertFail();
done();
}).catch((err) => {
expect(err != undefined).assertEqual(true);
done();
})
})
/**
* @tc.number Telephony_NetworkManager_getProtocol_Async_0100
* @tc.name Test getProtocol() interface
* @tc.desc Function test
*/
it('Telephony_NetworkManager_getProtocol_Async_0100', 0, async function (done) {
instance = socket.constructTLSSocketInstance()
instance.getProtocol((err, data) => {
if (err == undefined) {
expect().assertFail();
done();
} else {
expect(data).assertEqual(undefined);
expect(err != undefined).assertEqual(true);
done();
}
})
})
/**
* @tc.number Telephony_NetworkManager_getProtocol_Promise_0100
* @tc.name Test getProtocol() interface
* @tc.desc Function test
*/
it('Telephony_NetworkManager_getProtocol_Promise_0100', 0, async function (done) {
instance = socket.constructTLSSocketInstance()
instance.getProtocol().then((data) => {
expect(data).assertEqual(undefined);
expect().assertFail();
done();
}).catch((err) => {
expect(err != undefined).assertEqual(true);
done();
})
})
/**
* @tc.number Telephony_NetworkManager_getCipherSuites_Async_0100
* @tc.name Test getCipherSuite() interface
* @tc.desc Function test
*/
it('Telephony_NetworkManager_getCipherSuites_Async_0100', 0, async function (done) {
instance = socket.constructTLSSocketInstance()
instance.getCipherSuite((err, data) => {
if (err == undefined) {
expect().assertFail();
done();
} else {
expect(data).assertEqual(undefined);
expect(err != undefined).assertEqual(true);
done();
}
})
})
/**
* @tc.number Telephony_NetworkManager_getCipherSuites_Promise_0100
* @tc.name Test getCipherSuite() interface
* @tc.desc Function test
*/
it('Telephony_NetworkManager_getCipherSuites_Promise_0100', 0, async function (done) {
instance = socket.constructTLSSocketInstance()
instance.getCipherSuite().then((data) => {
expect(data).assertEqual(undefined);
expect().assertFail();
done();
}).catch((err) => {
expect(err != undefined).assertEqual(true);
done();
})
})
/**
* @tc.number Telephony_NetworkManager_getSignatureAlgorithms_Async_0100
* @tc.name Test getSignatureAlgorithms() interface
* @tc.desc Function test
*/
it('Telephony_NetworkManager_getSignatureAlgorithms_Async_0100', 0, async function (done) {
instance = socket.constructTLSSocketInstance()
instance.getSignatureAlgorithms((err, data) => {
if (err == undefined) {
expect().assertFail();
done();
} else {
expect(data).assertEqual(undefined);
expect(err != undefined).assertEqual(true);
done();
}
})
})
/**
* @tc.number Telephony_NetworkManager_getSignatureAlgorithms_Promise_0100
* @tc.name Test getSignatureAlgorithms() interface
* @tc.desc Function test
*/
it('Telephony_NetworkManager_getSignatureAlgorithms_Promise_0100', 0, async function (done) {
instance = socket.constructTLSSocketInstance()
instance.getSignatureAlgorithms().then((data) => {
expect(data).assertEqual(undefined);
expect().assertFail();
done();
}).catch((err) => {
expect(err != undefined).assertEqual(true);
done();
})
})
/**
* @tc.number Telephony_NetworkManager_send_Async_0100
* @tc.name Test send() interface
* @tc.desc Function test
*/
it('Telephony_NetworkManager_send_Async_0100', 0, async function (done) {
instance = socket.constructTLSSocketInstance()
instance.send(sendData, (err) => {
if (err == undefined) {
expect().assertFail();
done();
} else {
expect(err != undefined).assertEqual(true);
done();
}
})
})
/**
* @tc.number Telephony_NetworkManager_send_Promise_0100
* @tc.name Test send() interface
* @tc.desc Function test
*/
it('Telephony_NetworkManager_send_Promise_0100', 0, async function (done) {
instance = socket.constructTLSSocketInstance()
instance.send(sendData).then(() => {
expect().assertFail();
done();
}).catch((err) => {
expect(err != undefined).assertEqual(true);
done();
})
})
})
}
\ No newline at end of file
telephony/telephonyjstest/sms_mms/BUILD.gn
浏览文件 @
36602cd2
...
...
@@ -15,6 +15,6 @@ import("//test/xts/tools/build/suite.gni")
group("sms_mms") {
testonly = true
if (is_standard_system) {
deps = [ "sms_mms_error:ActSmsMmsErrorTest" ]
deps = [ "sms_mms_error:Act
s
SmsMmsErrorTest" ]
}
}
telephony/telephonyjstest/sms_mms/sms_mms_error/BUILD.gn
浏览文件 @
36602cd2
...
...
@@ -13,14 +13,14 @@
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActSmsMmsErrorTest") {
ohos_js_hap_suite("Act
s
SmsMmsErrorTest") {
hap_profile = "./src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActSmsMmsErrorTest"
hap_name = "Act
s
SmsMmsErrorTest"
part_name = "sms_mms"
subsystem_name = "telephony"
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录