Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
0d12f421
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看板
提交
0d12f421
编写于
1月 29, 2023
作者:
Z
zhangjing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
hap包不解压需求相关修改回退,overviewAccessMode属性的用例优化
Signed-off-by:
N
zhangjing
<
zhangjing403@huawei.com
>
上级
da23ee2c
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
219 addition
and
105 deletion
+219
-105
arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets
..._ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets
+21
-50
arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/webTwo.ets
...s_web_dev/entry/src/main/ets/MainAbility/pages/webTwo.ets
+73
-0
arkui/ace_ets_web_dev/entry/src/main/ets/test/List.test.ets
arkui/ace_ets_web_dev/entry/src/main/ets/test/List.test.ets
+2
-1
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
+31
-51
arkui/ace_ets_web_dev/entry/src/main/ets/test/WebTwoJsunit.test.ets
...ets_web_dev/entry/src/main/ets/test/WebTwoJsunit.test.ets
+88
-0
arkui/ace_ets_web_dev/entry/src/main/resources/base/profile/main_pages.json
...dev/entry/src/main/resources/base/profile/main_pages.json
+2
-1
arkui/ace_ets_web_dev/entry/src/main/resources/rawfile/overview.html
...ts_web_dev/entry/src/main/resources/rawfile/overview.html
+2
-2
未找到文件。
arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets
浏览文件 @
0d12f421
...
@@ -43,7 +43,6 @@ struct Index {
...
@@ -43,7 +43,6 @@ struct Index {
@State geolocationAccess:boolean=true
@State geolocationAccess:boolean=true
@State onlineImageAccess:boolean=true
@State onlineImageAccess:boolean=true
@State databaseAccess:boolean=true
@State databaseAccess:boolean=true
@State overviewModeAccess:boolean=false
@State initialScale:number=100
@State initialScale:number=100
@State enterPageEnd:boolean=false
@State enterPageEnd:boolean=false
@State newScale:number=0
@State newScale:number=0
...
@@ -54,7 +53,6 @@ struct Index {
...
@@ -54,7 +53,6 @@ struct Index {
@State cacheError:boolean=false
@State cacheError:boolean=false
@State mixedSwitch:boolean=false
@State mixedSwitch:boolean=false
@State mixedAllSwitch:boolean=false
@State mixedAllSwitch:boolean=false
@State overViewFalseHeight:number=0
@State isProgressFinish:boolean=false
@State isProgressFinish:boolean=false
@State isHttpErrorReceive:boolean=false
@State isHttpErrorReceive:boolean=false
onPageShow(){
onPageShow(){
...
@@ -106,7 +104,6 @@ struct Index {
...
@@ -106,7 +104,6 @@ struct Index {
.cacheMode(this.cacheMode)
.cacheMode(this.cacheMode)
.initialScale(this.initialScale)
.initialScale(this.initialScale)
.mixedMode(this.mixedMode)
.mixedMode(this.mixedMode)
.overviewModeAccess(this.overviewModeAccess)
.userAgent("Mozila/5.0 (Linux; Andriod 9; VRD-AL10; HMSCore 6.3.0.331) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.105 HuaweiBrowser/12.0.4.1 MobileSafari/537.36")
.userAgent("Mozila/5.0 (Linux; Andriod 9; VRD-AL10; HMSCore 6.3.0.331) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.105 HuaweiBrowser/12.0.4.1 MobileSafari/537.36")
.javaScriptProxy({
.javaScriptProxy({
object:this.jsObj,
object:this.jsObj,
...
@@ -269,7 +266,7 @@ struct Index {
...
@@ -269,7 +266,7 @@ struct Index {
break;
break;
}
}
case "emitOnResourceLoad":{
case "emitOnResourceLoad":{
this.controller.loadUrl({url:"
resource:/
/rawfile/second.html"});
this.controller.loadUrl({url:"
file:///data/storage/el1/bundle/phone/resources
/rawfile/second.html"});
setTimeout(()=>{
setTimeout(()=>{
Utils.emitEvent(this.loadedResource,108)
Utils.emitEvent(this.loadedResource,108)
},3000)
},3000)
...
@@ -284,7 +281,7 @@ struct Index {
...
@@ -284,7 +281,7 @@ struct Index {
break;
break;
}
}
case "emitRunJavaScript":{
case "emitRunJavaScript":{
this.controller.loadUrl({url:"
resource:/
/rawfile/index.html"});
this.controller.loadUrl({url:"
file:///data/storage/el1/bundle/phone/resources
/rawfile/index.html"});
setTimeout(()=>{
setTimeout(()=>{
this.controller.runJavaScript({script:"testRunJavaScript()",callback:(res)=>{
this.controller.runJavaScript({script:"testRunJavaScript()",callback:(res)=>{
Utils.emitEvent(res,112)
Utils.emitEvent(res,112)
...
@@ -299,7 +296,7 @@ struct Index {
...
@@ -299,7 +296,7 @@ struct Index {
break;
break;
}
}
case "emitOnRefreshAccessedHistory":{
case "emitOnRefreshAccessedHistory":{
this.controller.loadUrl({url:"
resource:/
/rawfile/second.html"});
this.controller.loadUrl({url:"
file:///data/storage/el1/bundle/phone/resources
/rawfile/second.html"});
setTimeout(()=>{
setTimeout(()=>{
Utils.emitEvent(this.newUrl,116)
Utils.emitEvent(this.newUrl,116)
},3000)
},3000)
...
@@ -316,7 +313,7 @@ struct Index {
...
@@ -316,7 +313,7 @@ struct Index {
break;
break;
}
}
case "emitGetTitle":{
case "emitGetTitle":{
this.controller.loadUrl({url:"
resource:/
/rawfile/index.html"});
this.controller.loadUrl({url:"
file:///data/storage/el1/bundle/phone/resources
/rawfile/index.html"});
setTimeout(()=>{
setTimeout(()=>{
let webTitle=this.controller.getTitle()
let webTitle=this.controller.getTitle()
Utils.emitEvent(webTitle,122)
Utils.emitEvent(webTitle,122)
...
@@ -324,7 +321,7 @@ struct Index {
...
@@ -324,7 +321,7 @@ struct Index {
break;
break;
}
}
case "emitGetPageHeight":{
case "emitGetPageHeight":{
this.controller.loadUrl({url:"
resource:/
/rawfile/index.html"});
this.controller.loadUrl({url:"
file:///data/storage/el1/bundle/phone/resources
/rawfile/index.html"});
let webPageHeight=this.controller.getPageHeight()+""
let webPageHeight=this.controller.getPageHeight()+""
setTimeout(()=>{
setTimeout(()=>{
this.controller.runJavaScript({script:"getPageHeight()",callback:(res)=>{
this.controller.runJavaScript({script:"getPageHeight()",callback:(res)=>{
...
@@ -335,7 +332,7 @@ struct Index {
...
@@ -335,7 +332,7 @@ struct Index {
break;
break;
}
}
case "emitGetRequestFocus":{
case "emitGetRequestFocus":{
this.controller.loadUrl({url:"
resource:/
/rawfile/second.html"});
this.controller.loadUrl({url:"
file:///data/storage/el1/bundle/phone/resources
/rawfile/second.html"});
await Utils.sleep(2000)
await Utils.sleep(2000)
sendEventByKey('textInput',10,'')
sendEventByKey('textInput',10,'')
break;
break;
...
@@ -382,7 +379,7 @@ struct Index {
...
@@ -382,7 +379,7 @@ struct Index {
case "emitGeolocationAccessFalse":{
case "emitGeolocationAccessFalse":{
this.geolocationAccess=false
this.geolocationAccess=false
await Utils.sleep(2000)
await Utils.sleep(2000)
this.controller.loadUrl({url:"
resource:/
/rawfile/geo.html"});
this.controller.loadUrl({url:"
file:///data/storage/el1/bundle/phone/resources
/rawfile/geo.html"});
setTimeout(()=>{
setTimeout(()=>{
this.controller.runJavaScript({script:"getGeoResult()",callback:(res)=>{
this.controller.runJavaScript({script:"getGeoResult()",callback:(res)=>{
console.info("getGeoResult==>"+res)
console.info("getGeoResult==>"+res)
...
@@ -394,7 +391,7 @@ struct Index {
...
@@ -394,7 +391,7 @@ struct Index {
case "emitInitialScale":{
case "emitInitialScale":{
this.initialScale=120
this.initialScale=120
await Utils.sleep(1000)
await Utils.sleep(1000)
this.controller.loadUrl({url:"
resource:/
/rawfile/second.html"});
this.controller.loadUrl({url:"
file:///data/storage/el1/bundle/phone/resources
/rawfile/second.html"});
this.enterPageEnd=true
this.enterPageEnd=true
break;
break;
}
}
...
@@ -409,13 +406,13 @@ struct Index {
...
@@ -409,13 +406,13 @@ struct Index {
this.geolocationAccess=true
this.geolocationAccess=true
this.geoShow=true
this.geoShow=true
await Utils.sleep(2000)
await Utils.sleep(2000)
this.controller.loadUrl({url:"
resource:/
/rawfile/geo.html"});
this.controller.loadUrl({url:"
file:///data/storage/el1/bundle/phone/resources
/rawfile/geo.html"});
break;
break;
}
}
case "emitDomStorageAccessFalse":{
case "emitDomStorageAccessFalse":{
this.domStorageAccess=false
this.domStorageAccess=false
await Utils.sleep(2000)
await Utils.sleep(2000)
this.controller.loadUrl({url:"
resource:/
/rawfile/domApi.html"});
this.controller.loadUrl({url:"
file:///data/storage/el1/bundle/phone/resources
/rawfile/domApi.html"});
setTimeout(()=>{
setTimeout(()=>{
this.controller.runJavaScript({script:"getDomResult()",callback:(res)=>{
this.controller.runJavaScript({script:"getDomResult()",callback:(res)=>{
console.info("getDomResult==>"+res)
console.info("getDomResult==>"+res)
...
@@ -427,7 +424,7 @@ struct Index {
...
@@ -427,7 +424,7 @@ struct Index {
case "emitDomStorageAccessTrue":{
case "emitDomStorageAccessTrue":{
this.domStorageAccess=true
this.domStorageAccess=true
await Utils.sleep(2000)
await Utils.sleep(2000)
this.controller.loadUrl({url:"
resource:/
/rawfile/domApi.html"});
this.controller.loadUrl({url:"
file:///data/storage/el1/bundle/phone/resources
/rawfile/domApi.html"});
setTimeout(()=>{
setTimeout(()=>{
this.controller.runJavaScript({script:"getDomResult()",callback:(res)=>{
this.controller.runJavaScript({script:"getDomResult()",callback:(res)=>{
console.info("getDomResult==>"+res)
console.info("getDomResult==>"+res)
...
@@ -439,7 +436,7 @@ struct Index {
...
@@ -439,7 +436,7 @@ struct Index {
case "emitImageAccessFalse":{
case "emitImageAccessFalse":{
this.imageAccess=false
this.imageAccess=false
await Utils.sleep(1000)
await Utils.sleep(1000)
this.controller.loadUrl({url:"
resource:/
/rawfile/index.html"});
this.controller.loadUrl({url:"
file:///data/storage/el1/bundle/phone/resources
/rawfile/index.html"});
setTimeout(()=>{
setTimeout(()=>{
this.controller.runJavaScript({script:"getImgResult()",callback:(res)=>{
this.controller.runJavaScript({script:"getImgResult()",callback:(res)=>{
console.info("getImgResult==>"+res)
console.info("getImgResult==>"+res)
...
@@ -451,7 +448,7 @@ struct Index {
...
@@ -451,7 +448,7 @@ struct Index {
case "emitImageAccessTrue":{
case "emitImageAccessTrue":{
this.imageAccess=true
this.imageAccess=true
await Utils.sleep(1000)
await Utils.sleep(1000)
this.controller.loadUrl({url:"
resource:/
/rawfile/index.html"});
this.controller.loadUrl({url:"
file:///data/storage/el1/bundle/phone/resources
/rawfile/index.html"});
setTimeout(()=>{
setTimeout(()=>{
this.controller.runJavaScript({script:"getImgResult()",callback:(res)=>{
this.controller.runJavaScript({script:"getImgResult()",callback:(res)=>{
console.info("getImgResult==>"+res)
console.info("getImgResult==>"+res)
...
@@ -463,7 +460,7 @@ struct Index {
...
@@ -463,7 +460,7 @@ struct Index {
case "emitOnlineImageAccessFalse":{
case "emitOnlineImageAccessFalse":{
this.onlineImageAccess=false
this.onlineImageAccess=false
await Utils.sleep(1000)
await Utils.sleep(1000)
this.controller.loadUrl({url:"
resource:/
/rawfile/onlineImageAccess.html"});
this.controller.loadUrl({url:"
file:///data/storage/el1/bundle/phone/resources
/rawfile/onlineImageAccess.html"});
setTimeout(()=>{
setTimeout(()=>{
this.controller.runJavaScript({script:"getImageLoadResult()",callback:(res)=>{
this.controller.runJavaScript({script:"getImageLoadResult()",callback:(res)=>{
console.info("getImageLoadResult==>"+res)
console.info("getImageLoadResult==>"+res)
...
@@ -475,7 +472,7 @@ struct Index {
...
@@ -475,7 +472,7 @@ struct Index {
case "emitOnlineImageAccessTrue":{
case "emitOnlineImageAccessTrue":{
this.onlineImageAccess=true
this.onlineImageAccess=true
await Utils.sleep(1000)
await Utils.sleep(1000)
this.controller.loadUrl({url:"
resource:/
/rawfile/onlineImageAccess.html"});
this.controller.loadUrl({url:"
file:///data/storage/el1/bundle/phone/resources
/rawfile/onlineImageAccess.html"});
setTimeout(()=>{
setTimeout(()=>{
this.controller.runJavaScript({script:"getImageLoadResult()",callback:(res)=>{
this.controller.runJavaScript({script:"getImageLoadResult()",callback:(res)=>{
console.info("getImageLoadResult==>"+res)
console.info("getImageLoadResult==>"+res)
...
@@ -487,7 +484,7 @@ struct Index {
...
@@ -487,7 +484,7 @@ struct Index {
case "emitDatabaseAccessTrue":{
case "emitDatabaseAccessTrue":{
this.databaseAccess=true
this.databaseAccess=true
await Utils.sleep(2000)
await Utils.sleep(2000)
this.controller.loadUrl({url:"
resource:/
/rawfile/databaseAccess.html"});
this.controller.loadUrl({url:"
file:///data/storage/el1/bundle/phone/resources
/rawfile/databaseAccess.html"});
setTimeout(()=>{
setTimeout(()=>{
this.controller.runJavaScript({script:"getDataResult()",callback:(res)=>{
this.controller.runJavaScript({script:"getDataResult()",callback:(res)=>{
console.info("getDataResult==>"+res)
console.info("getDataResult==>"+res)
...
@@ -496,34 +493,8 @@ struct Index {
...
@@ -496,34 +493,8 @@ struct Index {
},3000)
},3000)
break;
break;
}
}
case "emitOverviewModeAccessFalse":{
this.overviewModeAccess=false
await Utils.sleep(1000)
this.controller.loadUrl({url:"resource://rawfile/overview.html"});
setTimeout(()=>{
let webPageHeight=this.controller.getPageHeight()
this.controller.runJavaScript({script:"getViewResult()",callback:(res)=>{
this.overViewFalseHeight=parseInt(res)
console.info("getViewResult==>"+res)
Utils.emitEventTwo(webPageHeight,res,168)
}})
},3000)
break;
}
case "emitOverviewModeAccessTrue":{
this.overviewModeAccess=true
await Utils.sleep(1000)
this.controller.loadUrl({url:"resource://rawfile/overview.html"});
setTimeout(()=>{
this.controller.runJavaScript({script:"getViewResult()",callback:(res)=>{
console.info("getViewResult==>"+res)
Utils.emitEventTwo(this.overViewFalseHeight,parseInt(res),170)
}})
},3000)
break;
}
case "emitOnPrompt":{
case "emitOnPrompt":{
this.controller.loadUrl({url:"
resource:/
/rawfile/index.html"});
this.controller.loadUrl({url:"
file:///data/storage/el1/bundle/phone/resources
/rawfile/index.html"});
setTimeout(()=>{
setTimeout(()=>{
this.controller.runJavaScript({script:"toPrompt()"})
this.controller.runJavaScript({script:"toPrompt()"})
},3000)
},3000)
...
@@ -562,7 +533,7 @@ struct Index {
...
@@ -562,7 +533,7 @@ struct Index {
}
}
case "emitFileAccessTrue":{
case "emitFileAccessTrue":{
this.fileAccess=true
this.fileAccess=true
this.controller.loadUrl({url:"
resource:/
/rawfile/index.html"});
this.controller.loadUrl({url:"
file:///data/storage/el1/bundle/phone/resources
/rawfile/index.html"});
this.controller.runJavaScript({script:"openRawFile()"})
this.controller.runJavaScript({script:"openRawFile()"})
setTimeout(()=>{
setTimeout(()=>{
let webTitle=this.controller.getTitle()
let webTitle=this.controller.getTitle()
...
@@ -616,7 +587,7 @@ struct Index {
...
@@ -616,7 +587,7 @@ struct Index {
break;
break;
}
}
case "emitOnTitleReceive":{
case "emitOnTitleReceive":{
this.controller.loadUrl({url:"
resource:/
/rawfile/index.html"});
this.controller.loadUrl({url:"
file:///data/storage/el1/bundle/phone/resources
/rawfile/index.html"});
setTimeout(()=>{
setTimeout(()=>{
Utils.emitEvent(this.titleReceive,67)
Utils.emitEvent(this.titleReceive,67)
},3000)
},3000)
...
@@ -645,7 +616,7 @@ struct Index {
...
@@ -645,7 +616,7 @@ struct Index {
break;
break;
}
}
case "emitZoom":{
case "emitZoom":{
this.controller.loadUrl({url:"
resource:/
/rawfile/index.html"});
this.controller.loadUrl({url:"
file:///data/storage/el1/bundle/phone/resources
/rawfile/index.html"});
setTimeout(()=>{
setTimeout(()=>{
this.controller.zoom(2)
this.controller.zoom(2)
setTimeout(() => {
setTimeout(() => {
...
@@ -728,7 +699,7 @@ struct Index {
...
@@ -728,7 +699,7 @@ struct Index {
}
}
case "emitOnActive":{
case "emitOnActive":{
this.controller.onActive()
this.controller.onActive()
this.controller.loadUrl({url:"
resource:/
/rawfile/index.html"});
this.controller.loadUrl({url:"
file:///data/storage/el1/bundle/phone/resources
/rawfile/index.html"});
setTimeout(()=>{
setTimeout(()=>{
let onActiveCalled = this.pageBegin
let onActiveCalled = this.pageBegin
Utils.emitEvent(onActiveCalled,85)
Utils.emitEvent(onActiveCalled,85)
...
...
arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/webTwo.ets
0 → 100644
浏览文件 @
0d12f421
/*
* Copyright (c) 2021 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 events_emitter from '@ohos.events.emitter';
import Utils from '../../test/Utils';
@Entry
@Component
struct Second {
controller:WebController = new WebController()
@State str:string="emitOverviewModeAccessTrue"
@State overviewModeAccess:boolean=true
@State overviewScale:string=""
onPageShow(){
let valueChangeEvent={
eventId:10,
priority:events_emitter.EventPriority.LOW
};
events_emitter.on(valueChangeEvent,this.valueChangeCallBack);
}
private valueChangeCallBack=(eventData)=>{
console.info("web page valueChangeCallBack");
if(eventData != null){
console.info("valueChangeCallBack:"+ JSON.stringify(eventData));
if(eventData.data.ACTION != null){
this.str = eventData.data.ACTION;
}
}
}
build(){
Column(){
Row(){
Button("web click").key('webcomponenttwo').onClick(async ()=>{
console.info("key==>"+this.str);
switch(this.str){
case "emitOverviewModeAccessTrue":{
this.controller.runJavaScript({script:"getViewResult()",callback:(res)=>{
console.info("getViewResult==>"+res);
this.overviewScale=res;
Utils.emitEventTwo(res,"1",168);
}});
break;
}
case "emitOverviewModeAccessFalse":{
this.overviewModeAccess=false;
await Utils.sleep(2000);
this.controller.runJavaScript({script:"getViewResult()",callback:(res)=>{
console.info("getViewResult==>"+res);
Utils.emitEventTwo(this.overviewScale,res,170);
}});
break;
}
default:
console.info("can not match case");
}
})
}
Web({src:$rawfile('overview.html'),controller:this.controller})
.overviewModeAccess(this.overviewModeAccess)
}
}
}
arkui/ace_ets_web_dev/entry/src/main/ets/test/List.test.ets
浏览文件 @
0d12f421
...
@@ -13,7 +13,8 @@
...
@@ -13,7 +13,8 @@
* limitations under the License.
* limitations under the License.
*/
*/
import webJsunit from './WebJsunit.test'
import webJsunit from './WebJsunit.test'
import webTwoJsunit from './WebTwoJsunit.test'
export default function testsuite() {
export default function testsuite() {
webJsunit()
webJsunit()
webTwoJsunit()
}
}
\ No newline at end of file
arkui/ace_ets_web_dev/entry/src/main/ets/test/WebJsunit.test.ets
浏览文件 @
0d12f421
...
@@ -348,32 +348,12 @@ export default function webJsunit() {
...
@@ -348,32 +348,12 @@ export default function webJsunit() {
*tc.desic Sets allow the Web access the database
*tc.desic Sets allow the Web access the database
*/
*/
it('databaseAccessTrue',0,async function(done){
it('databaseAccessTrue',0,async function(done){
emitKey="emitOverviewModeAccessFalse";
Utils.registerContainEvent("databaseAccessTrue","openDatabase",164,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_032
*tc.name overviewModeAccessFalse
*tc.desic Sets not allow the Web access overview mode
*/
it('overviewModeAccessFalse',0,async function(done){
emitKey="emitOverviewModeAccessTrue";
Utils.registerEventTwo("overviewModeAccessFalse",168,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_033
*tc.name overviewModeAccessTrue
*tc.desic Sets allow the Web access overview mode
*/
it('overviewModeAccessTrue',0,async function(done){
emitKey="emitOnPrompt";
emitKey="emitOnPrompt";
Utils.register
LargerEvent("overviewModeAccessTrue",170
,done);
Utils.register
ContainEvent("databaseAccessTrue","openDatabase",164
,done);
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_03
4
*tc.number SUB_ACE_BASIC_ETS_API_03
2
*tc.name onPrompt
*tc.name onPrompt
*tc.desic Triggered when the web page wants to display a JavaScript prompt() dialog
*tc.desic Triggered when the web page wants to display a JavaScript prompt() dialog
*/
*/
...
@@ -383,7 +363,7 @@ export default function webJsunit() {
...
@@ -383,7 +363,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_03
5
*tc.number SUB_ACE_BASIC_ETS_API_03
3
*tc.name cacheModeOnly
*tc.name cacheModeOnly
*tc.desic load cache and not online
*tc.desic load cache and not online
*/
*/
...
@@ -393,7 +373,7 @@ export default function webJsunit() {
...
@@ -393,7 +373,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_03
6
*tc.number SUB_ACE_BASIC_ETS_API_03
4
*tc.name cacheModeDefault
*tc.name cacheModeDefault
*tc.desic load cache when they are available and not expired, otherwise load online
*tc.desic load cache when they are available and not expired, otherwise load online
*/
*/
...
@@ -403,7 +383,7 @@ export default function webJsunit() {
...
@@ -403,7 +383,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_03
7
*tc.number SUB_ACE_BASIC_ETS_API_03
5
*tc.name mixedModeNone
*tc.name mixedModeNone
*tc.desic Sets Don't allow unsecure sources from a secure origin
*tc.desic Sets Don't allow unsecure sources from a secure origin
*/
*/
...
@@ -413,7 +393,7 @@ export default function webJsunit() {
...
@@ -413,7 +393,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_03
8
*tc.number SUB_ACE_BASIC_ETS_API_03
6
*tc.name mixedModeAll
*tc.name mixedModeAll
*tc.desic Sets Allows all HTTP and HTTPS content can be loaded
*tc.desic Sets Allows all HTTP and HTTPS content can be loaded
*/
*/
...
@@ -423,7 +403,7 @@ export default function webJsunit() {
...
@@ -423,7 +403,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_03
9
*tc.number SUB_ACE_BASIC_ETS_API_03
7
*tc.name fileAccessTrue
*tc.name fileAccessTrue
*tc.desic Sets enable local file system access in Web
*tc.desic Sets enable local file system access in Web
*/
*/
...
@@ -433,7 +413,7 @@ export default function webJsunit() {
...
@@ -433,7 +413,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_0
40
*tc.number SUB_ACE_BASIC_ETS_API_0
38
*tc.name onPageBegin
*tc.name onPageBegin
*tc.desic Triggered when the page loading progress changes
*tc.desic Triggered when the page loading progress changes
*/
*/
...
@@ -443,7 +423,7 @@ export default function webJsunit() {
...
@@ -443,7 +423,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_0
41
*tc.number SUB_ACE_BASIC_ETS_API_0
39
*tc.name onPageEnd
*tc.name onPageEnd
*tc.desic Triggered at the begin of web page loading
*tc.desic Triggered at the begin of web page loading
*/
*/
...
@@ -453,7 +433,7 @@ export default function webJsunit() {
...
@@ -453,7 +433,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_04
2
*tc.number SUB_ACE_BASIC_ETS_API_04
0
*tc.name onConsole
*tc.name onConsole
*tc.desic Triggered when the web page receives a JavaScript console message
*tc.desic Triggered when the web page receives a JavaScript console message
*/
*/
...
@@ -463,7 +443,7 @@ export default function webJsunit() {
...
@@ -463,7 +443,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_04
3
*tc.number SUB_ACE_BASIC_ETS_API_04
1
*tc.name onAlert
*tc.name onAlert
*tc.desic Triggered when the Web wants to display a JavaScript alert() dialog
*tc.desic Triggered when the Web wants to display a JavaScript alert() dialog
*/
*/
...
@@ -473,7 +453,7 @@ export default function webJsunit() {
...
@@ -473,7 +453,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_04
4
*tc.number SUB_ACE_BASIC_ETS_API_04
2
*tc.name onConfirm
*tc.name onConfirm
*tc.desic Triggered when the web page wants to display a JavaScript confirm() dialog
*tc.desic Triggered when the web page wants to display a JavaScript confirm() dialog
*/
*/
...
@@ -483,7 +463,7 @@ export default function webJsunit() {
...
@@ -483,7 +463,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_04
5
*tc.number SUB_ACE_BASIC_ETS_API_04
3
*tc.name onErrorReceive
*tc.name onErrorReceive
*tc.desic Triggered when the web page receives a web resource loading error
*tc.desic Triggered when the web page receives a web resource loading error
*/
*/
...
@@ -493,7 +473,7 @@ export default function webJsunit() {
...
@@ -493,7 +473,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_04
6
*tc.number SUB_ACE_BASIC_ETS_API_04
4
*tc.name onHttpErrorReceive
*tc.name onHttpErrorReceive
*tc.desic Triggered when the web page receives a web resource loading HTTP error
*tc.desic Triggered when the web page receives a web resource loading HTTP error
*/
*/
...
@@ -503,7 +483,7 @@ export default function webJsunit() {
...
@@ -503,7 +483,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_04
7
*tc.number SUB_ACE_BASIC_ETS_API_04
5
*tc.name onTitleReceive
*tc.name onTitleReceive
*tc.desic Triggered when the title of the main application document changes
*tc.desic Triggered when the title of the main application document changes
*/
*/
...
@@ -513,7 +493,7 @@ export default function webJsunit() {
...
@@ -513,7 +493,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_04
8
*tc.number SUB_ACE_BASIC_ETS_API_04
6
*tc.name onDownloadStart
*tc.name onDownloadStart
*tc.desic Triggered when starting to download
*tc.desic Triggered when starting to download
*/
*/
...
@@ -523,7 +503,7 @@ export default function webJsunit() {
...
@@ -523,7 +503,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_04
9
*tc.number SUB_ACE_BASIC_ETS_API_04
7
*tc.name setCookie
*tc.name setCookie
*tc.desic Sets the cookie
*tc.desic Sets the cookie
*/
*/
...
@@ -533,7 +513,7 @@ export default function webJsunit() {
...
@@ -533,7 +513,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_0
50
*tc.number SUB_ACE_BASIC_ETS_API_0
48
*tc.name getCookie
*tc.name getCookie
*tc.desic Gets all cookies for the given URL
*tc.desic Gets all cookies for the given URL
*/
*/
...
@@ -543,7 +523,7 @@ export default function webJsunit() {
...
@@ -543,7 +523,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_0
51
*tc.number SUB_ACE_BASIC_ETS_API_0
49
*tc.name zoom
*tc.name zoom
*tc.desic Let the Web zoom by
*tc.desic Let the Web zoom by
*/
*/
...
@@ -553,7 +533,7 @@ export default function webJsunit() {
...
@@ -553,7 +533,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_05
2
*tc.number SUB_ACE_BASIC_ETS_API_05
0
*tc.name zoomOut
*tc.name zoomOut
*tc.desic Let the Web zoom out
*tc.desic Let the Web zoom out
*/
*/
...
@@ -563,7 +543,7 @@ export default function webJsunit() {
...
@@ -563,7 +543,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_05
3
*tc.number SUB_ACE_BASIC_ETS_API_05
1
*tc.name zoomIn
*tc.name zoomIn
*tc.desic Let the Web zoom in
*tc.desic Let the Web zoom in
*/
*/
...
@@ -573,7 +553,7 @@ export default function webJsunit() {
...
@@ -573,7 +553,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_05
4
*tc.number SUB_ACE_BASIC_ETS_API_05
2
*tc.name deleteEntireCookie
*tc.name deleteEntireCookie
*tc.desic Delete all cookies
*tc.desic Delete all cookies
*/
*/
...
@@ -583,7 +563,7 @@ export default function webJsunit() {
...
@@ -583,7 +563,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_05
5
*tc.number SUB_ACE_BASIC_ETS_API_05
3
*tc.name saveCookieSync
*tc.name saveCookieSync
*tc.desic Saves the cookies
*tc.desic Saves the cookies
*/
*/
...
@@ -593,7 +573,7 @@ export default function webJsunit() {
...
@@ -593,7 +573,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_05
6
*tc.number SUB_ACE_BASIC_ETS_API_05
4
*tc.name clearHistory
*tc.name clearHistory
*tc.desic Clears the history in the Web
*tc.desic Clears the history in the Web
*/
*/
...
@@ -603,7 +583,7 @@ export default function webJsunit() {
...
@@ -603,7 +583,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_05
7
*tc.number SUB_ACE_BASIC_ETS_API_05
5
*tc.name stop
*tc.name stop
*tc.desic Stops the current load
*tc.desic Stops the current load
*/
*/
...
@@ -613,7 +593,7 @@ export default function webJsunit() {
...
@@ -613,7 +593,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_05
8
*tc.number SUB_ACE_BASIC_ETS_API_05
6
*tc.name onInactive
*tc.name onInactive
*tc.desic Let the Web inactive.
*tc.desic Let the Web inactive.
*/
*/
...
@@ -623,7 +603,7 @@ export default function webJsunit() {
...
@@ -623,7 +603,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_05
9
*tc.number SUB_ACE_BASIC_ETS_API_05
7
*tc.name onActive
*tc.name onActive
*tc.desic Let the Web active
*tc.desic Let the Web active
*/
*/
...
@@ -633,7 +613,7 @@ export default function webJsunit() {
...
@@ -633,7 +613,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_0
60
*tc.number SUB_ACE_BASIC_ETS_API_0
58
*tc.name registerJavaScriptProxy
*tc.name registerJavaScriptProxy
*tc.desic Registers the JavaScript object and method list
*tc.desic Registers the JavaScript object and method list
*/
*/
...
@@ -643,7 +623,7 @@ export default function webJsunit() {
...
@@ -643,7 +623,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_0
61
*tc.number SUB_ACE_BASIC_ETS_API_0
59
*tc.name deleteJavaScriptRegister
*tc.name deleteJavaScriptRegister
*tc.desic Deletes a registered JavaScript object with given name
*tc.desic Deletes a registered JavaScript object with given name
*/
*/
...
@@ -653,7 +633,7 @@ export default function webJsunit() {
...
@@ -653,7 +633,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_06
2
*tc.number SUB_ACE_BASIC_ETS_API_06
0
*tc.name javaScriptAccess
*tc.name javaScriptAccess
*tc.desic Sets whether the Web allows JavaScript scripts to execute
*tc.desic Sets whether the Web allows JavaScript scripts to execute
*/
*/
...
@@ -663,7 +643,7 @@ export default function webJsunit() {
...
@@ -663,7 +643,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_06
3
*tc.number SUB_ACE_BASIC_ETS_API_06
1
*tc.name getCookieManager
*tc.name getCookieManager
*tc.desic Gets network cookie manager
*tc.desic Gets network cookie manager
*/
*/
...
...
arkui/ace_ets_web_dev/entry/src/main/ets/test/WebTwoJsunit.test.ets
0 → 100644
浏览文件 @
0d12f421
/*
* 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.
*/
// @ts-nocheck
import { describe, beforeEach, afterEach, it, expect, beforeAll} from "@ohos/hypium";
import events_emitter from '@ohos.events.emitter';
import router from '@system.router';
import Utils from './Utils.ets';
let emitKey = "emitOverviewModeAccessTrue";
export default function webTwoJsunit() {
describe('overviewTest', function () {
beforeAll(async function (done) {
let options = {
uri: 'MainAbility/pages/webTwo',
}
try {
router.clear();
let pages = router.getState();
console.info("get webTwo state success " + JSON.stringify(pages));
if (!("webTwo" == pages.name)) {
console.info("get webTwo state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push webTwo page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push webTwo page error: " + err);
}
done()
});
beforeEach(async function (done) {
await Utils.sleep(2000);
console.info("web beforeEach start");
done();
})
afterEach(async function (done) {
console.info("web afterEach start:"+emitKey);
try {
let backData = {
data: {
"ACTION": emitKey
}
}
let backEvent = {
eventId:10,
priority:events_emitter.EventPriority.LOW
}
console.info("start send emitKey");
events_emitter.emit(backEvent, backData);
} catch (err) {
console.info("emit emitKey err: " + JSON.stringify(err));
}
await Utils.sleep(2000);
done();
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_001
*tc.name overviewModeAccessTrue
*tc.desic Sets allow the Web access overview mode
*/
it('overviewModeAccessTrue',0,async function(done){
emitKey="emitOverviewModeAccessFalse";
Utils.registerLargerEvent("overviewModeAccessTrue",168,done);
sendEventByKey('webcomponenttwo',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_002
*tc.name overviewModeAccessFalse
*tc.desic Sets not allow the Web access overview mode
*/
it('overviewModeAccessFalse',0,async function(done){
emitKey="emitOverviewModeAccessFalse";
Utils.registerLargerEvent("overviewModeAccessFalse",170,done);
sendEventByKey('webcomponenttwo',10,'');
})
})
}
arkui/ace_ets_web_dev/entry/src/main/resources/base/profile/main_pages.json
浏览文件 @
0d12f421
{
{
"src"
:
[
"src"
:
[
"MainAbility/pages/web"
"MainAbility/pages/web"
,
"MainAbility/pages/webTwo"
]
]
}
}
\ No newline at end of file
arkui/ace_ets_web_dev/entry/src/main/resources/rawfile/overview.html
浏览文件 @
0d12f421
...
@@ -15,8 +15,8 @@
...
@@ -15,8 +15,8 @@
</body>
</body>
<script>
<script>
function
getViewResult
(){
function
getViewResult
(){
let
height
=
document
.
getElementsByTagName
(
"
body
"
)[
0
].
scrollHeight
let
scaleNumber
=
window
.
visualViewport
.
scale
;
return
height
return
scaleNumber
;
}
}
</script>
</script>
</html>
</html>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录