Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
139b0ae6
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看板
未验证
提交
139b0ae6
编写于
6月 06, 2023
作者:
O
openharmony_ci
提交者:
Gitee
6月 06, 2023
浏览文件
操作
浏览文件
下载
差异文件
!8927 【OpenHarmony 4.0.8.1】【Master】【ARKUI子系统】【TOD】【rk3568】【必现】修改OnErrorReceive的Url,新增接口覆盖属性覆盖
Merge pull request !8927 from 边鑫博/master
上级
d6843af0
a0ed86ba
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
165 addition
and
20 deletion
+165
-20
arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets
..._ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets
+4
-4
arkui/ace_ets_web_dev/entry/src/main/ets/test/WebJsunit.test.ets
...ce_ets_web_dev/entry/src/main/ets/test/WebJsunit.test.ets
+1
-1
arkui/ace_ets_web_dev_three/entry/src/main/ets/MainAbility/pages/web.ets
...eb_dev_three/entry/src/main/ets/MainAbility/pages/web.ets
+109
-14
arkui/ace_ets_web_dev_three/entry/src/main/ets/test/WebJsunit.test.ets
..._web_dev_three/entry/src/main/ets/test/WebJsunit.test.ets
+51
-1
未找到文件。
arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets
浏览文件 @
139b0ae6
...
@@ -404,13 +404,13 @@ struct Index {
...
@@ -404,13 +404,13 @@ struct Index {
break;
break;
}
}
case "emitOnErrorReceive":{
case "emitOnErrorReceive":{
this.controller.loadUrl({url:'http://
192.168.5.40:9006/sso_web/html/H5/doctor/aboutUs.html
'})
this.controller.loadUrl({url:'http://
bianixnbo.com
'})
setTimeout(()=>{
setTimeout(()=>{
this.controller.loadUrl({url:'http://
192.168.5.40:9006/sso_web/html/H5/doctor/aboutUs.html
'})
this.controller.loadUrl({url:'http://
bianixnbo.com
'})
setTimeout(() => {
setTimeout(() => {
Utils.emitEvent(this.errorReceive,65)
Utils.emitEvent(this.errorReceive,65)
},
3
000)
},
4
000)
},
3
000)
},
4
000)
break;
break;
}
}
case "emitOnHttpErrorReceive":{
case "emitOnHttpErrorReceive":{
...
...
arkui/ace_ets_web_dev/entry/src/main/ets/test/WebJsunit.test.ets
浏览文件 @
139b0ae6
...
@@ -439,7 +439,7 @@ export default function webJsunit() {
...
@@ -439,7 +439,7 @@ export default function webJsunit() {
*/
*/
it('onErrorReceive',0,async function(done){
it('onErrorReceive',0,async function(done){
emitKey="emitOnHttpErrorReceive";
emitKey="emitOnHttpErrorReceive";
Utils.registerEvent("onErrorReceive","http://
192.168.5.40:9006/sso_web/html/H5/doctor/aboutUs.html
",65,done);
Utils.registerEvent("onErrorReceive","http://
bianixnbo.com/
",65,done);
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
...
...
arkui/ace_ets_web_dev_three/entry/src/main/ets/MainAbility/pages/web.ets
浏览文件 @
139b0ae6
...
@@ -22,6 +22,25 @@ import fileio from '@ohos.fileio';
...
@@ -22,6 +22,25 @@ import fileio from '@ohos.fileio';
import prompt from '@system.prompt';
import prompt from '@system.prompt';
let loadedUrl;
let loadedUrl;
function Uint8ArrayToString(dataArray) {
var dataString = ''
for (var i = 0; i
<
dataArray.length
;
i
++)
{
dataString
+=
String.fromCharCode
(
dataArray
[
i
])
}
return
dataString
}
function
ParseX509CertInfo
(
x509CertArray
)
{
let
res:
string =
'getCertificate success: len = '
+
x509CertArray.length
;
for
(
let
i =
0;
i
<
x509CertArray.length
;
i
++)
{
res
+=
',
index =
' + i + '
,
issuer
name =
'
+ Uint8ArrayToString(x509CertArray[i].getIssuerName().data) + '
,
subject
name =
'
+ Uint8ArrayToString(x509CertArray[i].getSubjectName().data) + '
,
valid
start =
'
+ x509CertArray[i].getNotBeforeTime()
+ '
,
valid
end =
' + x509CertArray[i].getNotAfterTime()
}
return res
}
@Entry
@Entry
@Component
@Component
...
@@ -49,6 +68,10 @@ struct Index {
...
@@ -49,6 +68,10 @@ struct Index {
@State getArray:boolean =false
@State getArray:boolean =false
@State msg1:string=""
@State msg1:string=""
@State type:number=0
@State type:number=0
@State enterPageEndAuto: boolean =false
@State enterPageEndOff: boolean =false
@State outputStr: string = '
'
...
@@ -572,7 +595,7 @@ struct Index {
...
@@ -572,7 +595,7 @@ struct Index {
}
}
case "emitSetHttpDnsSuccess":{
case "emitSetHttpDnsSuccess":{
try {
try {
web_webview.WebviewController.setHttpDns(web_webview.SecureDnsMode.S
ecureOnly
, "https://httpdns-browser.platform.dbankcloud.cn/dns-query{?dns}")
web_webview.WebviewController.setHttpDns(web_webview.SecureDnsMode.S
ECURE_ONLY
, "https://httpdns-browser.platform.dbankcloud.cn/dns-query{?dns}")
this.controller.loadUrl("https://www.example.com/");
this.controller.loadUrl("https://www.example.com/");
this.enterPageEnd=true
this.enterPageEnd=true
} catch(error) {
} catch(error) {
...
@@ -856,6 +879,75 @@ struct Index {
...
@@ -856,6 +879,75 @@ struct Index {
}
}
break;
break;
}
}
case "emitGetAccessibleGeolocationPromise":{
try {
web_webview.GeolocationPermissions.getAccessibleGeolocation("file:///")
.then(result => {
console.log('getAccessibleGeolocationPromise result: ' + result);
Utils.emitEvent(result,517)
}).catch(error => {
console.log('getAccessibleGeolocationPromise error: ' + JSON.stringify(error));
});
} catch (error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
break;
}
case "emitSetHttpDnsSuccessAuto":{
try {
web_webview.WebviewController.setHttpDns(web_webview.SecureDnsMode.AUTO, "https://httpdns-browser.platform.dbankcloud.cn/dns-query{?dns}")
this.controller.loadUrl("https://www.example.com/");
this.enterPageEndAuto=true
} catch(error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
break;
}
case "emitSetHttpDnsSuccessOff":{
try {
web_webview.WebviewController.setHttpDns(web_webview.SecureDnsMode.OFF, "https://httpdns-browser.platform.dbankcloud.cn/dns-query{?dns}")
this.controller.loadUrl("https://www.example.com/");
this.enterPageEndOff=true
} catch(error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
break;
}
case "emitGetCertificateCallback":{
try {
this.controller.loadUrl("https://www.example.com/");
console.info("jinru")
this.controller.getCertificate((error, x509CertArray) => {
if (error) {
this.outputStr = 'getCertificate failed: ' + error.code + ", errMsg: " + error.message;
} else {
this.outputStr = ParseX509CertInfo(x509CertArray);
console.info("hahahha"+this.outputStr.length)
console.info("hahahha"+this.outputStr)
Utils.emitEvent(this.outputStr.length,520)
}
})
} catch (error) {
this.outputStr = 'getCertificate failed: ' + error.code + ", errMsg: " + error.message;
}
break;
}
case "emitGetStoredGeolocationPromise":{
try {
web_webview.GeolocationPermissions.allowGeolocation("file:///")
web_webview.GeolocationPermissions.getStoredGeolocation()
.then(origins => {
let origins_str: string = origins.join();
console.log('getStoredGeolocationPromise origins: ' + origins_str);
Utils.emitEvent(origins_str, 521);
}).catch(error => {
console.log('getStoredGeolocationPromise error: ' + JSON.stringify(error));
});
} catch (error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
break;
}
...
@@ -898,6 +990,14 @@ struct Index {
...
@@ -898,6 +990,14 @@ struct Index {
Utils.emitEvent(1,446)
Utils.emitEvent(1,446)
this.enterPageEnd=false
this.enterPageEnd=false
}
}
if(this.enterPageEndAuto){
Utils.emitEvent(this.controller.getTitle(),518)
this.enterPageEndAuto=false
}
if(this.enterPageEndOff){
Utils.emitEvent(this.controller.getTitle(),519)
this.enterPageEndOff=false
}
if(this.getString){
if(this.getString){
try {
try {
this.controller.runJavaScriptExt(
this.controller.runJavaScriptExt(
...
@@ -980,19 +1080,14 @@ struct Index {
...
@@ -980,19 +1080,14 @@ struct Index {
}
}
if(this.getArray){
if(this.getArray){
try {
try {
this.controller.runJavaScriptExt(
this.controller.runJavaScriptExt('getArrayForJs()')
'getArrayForJs()',
.then((result) => {
(error, result) => {
var type = result.getType()
if (error) {
if(web_webview.JsMessageType.ARRAY== type){
console.info(`run JavaScript error: ` + JSON.stringify(error))
this.msg1 = "result type:" + typeof (result.getArray());
return;
Utils.emitEvent(this.msg1+web_webview.JsMessageType.NOT_SUPPORT,504)
}
}
var type = result.getType()
})
if(web_webview.JsMessageType.ARRAY== type){
this.msg1 = "result type:" + typeof (result.getArray());
Utils.emitEvent(this.msg1+web_webview.JsMessageType.NOT_SUPPORT,504)
}
});
console.info('urlgetstring: ', event.url);
console.info('urlgetstring: ', event.url);
} catch (error) {
} catch (error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
...
...
arkui/ace_ets_web_dev_three/entry/src/main/ets/test/WebJsunit.test.ets
浏览文件 @
139b0ae6
...
@@ -602,9 +602,59 @@ export default function webJsunit() {
...
@@ -602,9 +602,59 @@ export default function webJsunit() {
*tc.desic Save current page
*tc.desic Save current page
*/
*/
it('WebMessExtGetError',0,async function(done){
it('WebMessExtGetError',0,async function(done){
emitKey="emit
WebMessExtGetError
";
emitKey="emit
GetAccessibleGeolocationPromise
";
Utils.registerEvent("WebMessExtGetError","result type:object",516,done);
Utils.registerEvent("WebMessExtGetError","result type:object",516,done);
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_056
*tc.name GetAccessibleGeolocationPromise
*tc.desic Save current page
*/
it('GetAccessibleGeolocationPromise',0,async function(done){
emitKey="emitSetHttpDnsSuccessAuto";
Utils.registerEvent("GetAccessibleGeolocationPromise",true,517,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_057
*tc.name SetHttpDnsSuccessAuto
*tc.desic Save current page
*/
it('SetHttpDnsSuccessAuto',0,async function(done){
emitKey="emitSetHttpDnsSuccessOff";
Utils.registerEvent("SetHttpDnsSuccessAuto","Example Domain",518,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_058
*tc.name SetHttpDnsSuccessOff
*tc.desic Save current page
*/
it('SetHttpDnsSuccessOff',0,async function(done){
emitKey="emitGetCertificateCallback";
Utils.registerEvent("SetHttpDnsSuccessOff","Example Domain",519,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_059
*tc.name GetCertificateCallback
*tc.desic Save current page
*/
it('GetCertificateCallback',0,async function(done){
emitKey="emitGetStoredGeolocationPromise";
Utils.registerEvent("GetCertificateCallback",31,520,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_060
*tc.name GetStoredGeolocationPromise
*tc.desic Save current page
*/
it('GetStoredGeolocationPromise',0,async function(done){
emitKey="emitGetStoredGeolocationPromise";
Utils.registerEvent("GetStoredGeolocationPromise","file:///",521,done);
sendEventByKey('webcomponent',10,'');
})
})
})
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录