Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
2f35e851
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看板
未验证
提交
2f35e851
编写于
1月 03, 2023
作者:
O
openharmony_ci
提交者:
Gitee
1月 03, 2023
浏览文件
操作
浏览文件
下载
差异文件
!7081 3.2MR新增接口xts补充
Merge pull request !7081 from 张馨月/master
上级
6f60ea61
07b7e746
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
162 addition
and
2 deletion
+162
-2
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/webapi9.ets
..._apilack/entry/src/main/ets/MainAbility/pages/webapi9.ets
+89
-0
arkui/ace_ets_component_apilack/entry/src/main/ets/test/WebJsunitApi9.test.ets
...nt_apilack/entry/src/main/ets/test/WebJsunitApi9.test.ets
+73
-2
未找到文件。
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/webapi9.ets
浏览文件 @
2f35e851
...
@@ -29,6 +29,10 @@ struct Index {
...
@@ -29,6 +29,10 @@ struct Index {
@State isVoid: boolean = true;
@State isVoid: boolean = true;
handler: FullScreenExitHandler = null;
handler: FullScreenExitHandler = null;
@State atio: number = 150;
@State atio: number = 150;
@State defaultSize: number = 13;
@State defaultFixed: number = 8;
@State minLogicalSize: number = 1;
@State netWorkStatus: boolean = false;
ports: WebMessagePort[] = null;
ports: WebMessagePort[] = null;
testObj = {
testObj = {
test: (data1, data2, data3) => {
test: (data1, data2, data3) => {
...
@@ -118,6 +122,17 @@ struct Index {
...
@@ -118,6 +122,17 @@ struct Index {
})
})
Web({ src: 'www.baidu.com', controller: this.controller }).key('web2')
Web({ src: 'www.baidu.com', controller: this.controller }).key('web2')
.webStandardFont("HarmonyOS-Sans-Condensed")
.webSeriFont("HarmonyOS-Sans-Condensed")
.webSanSeriFont("HarmonyOS-Sans-Condensed")
.webFixedFont("HarmonyOS-Sans-Condensed")
.webFantasyFont("HarmonyOS-Sans-Condensed")
.webCursiveFont("HarmonyOS-Sans-Condensed")
.defaultFixedFontSize(this.defaultFixed)
.defaultFontSize(this.defaultFontSize)
.minLogicalSize(this.minLogicalSize)
.blockNetwork(false)
.defaultFontSize()
.onSslErrorEventReceive((event) => {
.onSslErrorEventReceive((event) => {
AlertDialog.show({
AlertDialog.show({
title: 'onSslErrorEventReceive',
title: 'onSslErrorEventReceive',
...
@@ -155,6 +170,24 @@ struct Index {
...
@@ -155,6 +170,24 @@ struct Index {
console.log('getMessageLevel:' + event.message.getMessageLevel());
console.log('getMessageLevel:' + event.message.getMessageLevel());
return false;
return false;
})
})
.onErrorReceive((event)=>{
event.request.getRequestMethod();
})
.onTouchIconUrlRecevied((event)=>{
event.url;
})
.onFaviconReceived((event)=>{
event.favicon;
})
.onPageVisible((event)=>{
event.url
})
.onDataResubmitted((event)=>{
event.handler.resend
})
.onInterceptKeyEvent((e)=>{
e.keyCode;
})
Button("web click").key('webcomponentapi9').onClick(async ()=>{
Button("web click").key('webcomponentapi9').onClick(async ()=>{
console.info("key==>"+this.str)
console.info("key==>"+this.str)
...
@@ -245,7 +278,63 @@ struct Index {
...
@@ -245,7 +278,63 @@ struct Index {
let isThirdParty = web_webview.WebCookieManager.isThirdPartyCookieAllowed();
let isThirdParty = web_webview.WebCookieManager.isThirdPartyCookieAllowed();
Utils.emitEvent(isThirdParty,827);
Utils.emitEvent(isThirdParty,827);
break;
break;
case "hasImage":
let flag = true
try{
thid.controllerTwo.hasImage((err.data)=>{
if(err) {
console.info("has ImageError" + JSON.stringfy(err))
return;
}
Utils.emitEvent(flag,828);
});
}catch(error){
console.error(`ErrorCode:${error.code},Message:${error.message}`);
}
break;
case "hasImageTwo":
let flag = true
try{
thid.controllerTwo.hasImage().then((data)=>{
Utils.emitEvent(flag,829);
})
.catch(function(error)) {
console.error("error" +error)
}
}catch(error){
console.error(`ErrorCode:${error.code},Message:${error.message}`);
}
break;
case "setNetworkAvailable":
this.controllerTwo.setNetworkAvailable(this.netWorkStatus);
Utils.emitEvent(this.netWorkStatus,830);
break;
case "getFavicon":
let icon = "baidu"
this.controllerTwo.getFavicon();
Utils.emitEvent(this.icon,831);
break;
case "getOriginalUrl":
let url = "www.baidu.com"
this.controllerTwo.getOriginalUrl();
Utils.emitEvent(this.netWorkStatus,832);
break;
case "history":
var res = 1;
let historyList = this.controllerTwo.getBackForwardEntries();
this.controllerTwo.initializeWebEngine();
let historyItem = historyList.getItemIndex(this.res);
historyItem.historyRawUrl
Utils.emitEvent(this.netWorkStatus,833);
break;
case "pageUp":
var res = true
this.controllerTwo.pageUp(true);
this.controllerTwo.pageDown(true);
this.controllerTwo.removeCache(true);
Utils.emitEvent(this.res,834);
break;
default:
default:
console.info("can not match case")
console.info("can not match case")
...
...
arkui/ace_ets_component_apilack/entry/src/main/ets/test/WebJsunitApi9.test.ets
浏览文件 @
2f35e851
...
@@ -316,10 +316,81 @@ export default function webJsunit() {
...
@@ -316,10 +316,81 @@ export default function webJsunit() {
* @tc.desic putAcceptFileURICookieEnabled
* @tc.desic putAcceptFileURICookieEnabled
*/
*/
it('testweb23', 0, async function (done) {
it('testweb23', 0, async function (done) {
emitKey = "
emitisThirdPartyCookieAllowed
";
emitKey = "
hasImage
";
Utils.registerContainEvent("isThirdPartyCookieAllowed",false,826,done);
Utils.registerContainEvent("isThirdPartyCookieAllowed",false,826,done);
sendEventByKey('webcomponentapi9',10,'');
sendEventByKey('webcomponentapi9',10,'');
});
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0025
* @tc.name testweb22
* @tc.desic hasImageCallback
*/
it('testweb24', 0, async function (done) {
emitKey = "hasImageTwo";
Utils.registerContainEvent("hasImage",true,828,done);
sendEventByKey('webcomponentapi9',10,'');
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0026
* @tc.name testweb22
* @tc.desic hasImagePromise
*/
it('testweb25', 0, async function (done) {
emitKey = "setNetworkAvailable";
Utils.registerContainEvent("hasImage",true,829,done);
sendEventByKey('webcomponentapi9',10,'');
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0027
* @tc.name testweb22
* @tc.desic setNetworkAvailable
*/
it('testweb26', 0, async function (done) {
emitKey = "getFavicon";
Utils.registerContainEvent("setNetworkAvailable",false,830,done);
sendEventByKey('webcomponentapi9',10,'');
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0028
* @tc.name testweb22
* @tc.desic getFavicon
*/
it('testweb27', 0, async function (done) {
emitKey = "getOriginalUrl";
Utils.registerContainEvent("getFavicon","baidu",831,done);
sendEventByKey('webcomponentapi9',10,'');
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0029
* @tc.name testweb22
* @tc.desic getFavicon
*/
it('testweb28', 0, async function (done) {
emitKey = "history";
Utils.registerContainEvent("getOriginalUrl","www.baidu.com",832,done);
sendEventByKey('webcomponentapi9',10,'');
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0030
* @tc.name testweb22
* @tc.desic getFavicon
*/
it('testweb29', 0, async function (done) {
emitKey = "pageUp";
Utils.registerContainEvent("history",1,833,done);
sendEventByKey('webcomponentapi9',10,'');
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0031
* @tc.name testweb22
* @tc.desic getFavicon
*/
it('testweb30', 0, async function (done) {
emitKey = "pageUp";
Utils.registerContainEvent("pageUp",true,834,done);
sendEventByKey('webcomponentapi9',10,'');
});
})
})
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录