未验证 提交 517bb9b1 编写于 作者: O openharmony_ci 提交者: Gitee

!7533 【OpenHarmony 4.0.3.2】【master】【web】删除已迁移的api9接口

Merge pull request !7533 from 王旭鹏/master
......@@ -5,7 +5,8 @@
"test-timeout": "600000",
"bundle-name": "com.open.harmony.aceEtsAttrLack",
"package-name": "com.open.harmony.aceEtsAttrLack",
"shell-timeout": "600000"
"shell-timeout": "600000",
"testcase-timeout":"10000"
},
"kits": [
{
......
......@@ -79,8 +79,6 @@ struct WebEditText {
})
.onHttpErrorReceive((event) => {
console.log('setResponseHeader:' + event.response.setResponseHeader([]));
console.log('web getExtra:' + this.controller.getHitTestValue().getExtra());
console.log('web getType:' + this.controller.getHitTestValue().getType());
let result = event.request.getRequestHeader();
console.log('The request header result size is ' + result.length);
for (let i of result) {
......
......@@ -84,6 +84,7 @@ export default function alertDialogCenterStartJsunit() {
try {
let measureOptions = {textContent : "alertDialog-CenterStart"};
let width = measure.measureText(measureOptions);
console.info("++++++++++++++++++++++" + width.toString());
expect(width > 0).assertFalse();
done();
} catch (err) {
......
......@@ -127,10 +127,12 @@ struct Index {
break;
}
case "emitLoadUrl":{
this.controller.loadUrl({url:"https://gitee.com/"})
this.controller.loadUrl({url:"resource://rawfile/index.html"})
setTimeout(()=>{
let webTitle=this.controller.getTitle()
Utils.emitEvent(webTitle,110)
this.controller.runJavaScript({script:"gettitle()",callback:(res)=>{
console.info("gettitle1==>"+res)
Utils.emitEvent(res,110)
}})
},3000)
break;
}
......@@ -165,25 +167,6 @@ struct Index {
Utils.emitEvent("webId",120)
break;
}
case "emitGetTitle":{
this.controller.loadUrl({url:"resource://rawfile/index.html"});
setTimeout(()=>{
let webTitle=this.controller.getTitle()
Utils.emitEvent(webTitle,122)
},3000)
break;
}
case "emitGetPageHeight":{
this.controller.loadUrl({url:"resource://rawfile/index.html"});
let webPageHeight=this.controller.getPageHeight()+""
setTimeout(()=>{
this.controller.runJavaScript({script:"getPageHeight()",callback:(res)=>{
console.info("getPageHeight==>"+res)
Utils.emitEventTwo(res,webPageHeight,124)
}})
},3000)
break;
}
case "emitGetRequestFocus":{
this.controller.loadUrl({url:"resource://rawfile/second.html"});
await Utils.sleep(2000)
......@@ -207,25 +190,18 @@ struct Index {
}
case "emitBackward":{
this.controller.backward()
this.controller.loadUrl({url:"resource://rawfile/index.html"});
setTimeout(()=>{
let webTitle=this.controller.getTitle()
Utils.emitEvent(webTitle,134)
this.controller.runJavaScript({script:"gettitle()",callback:(res)=>{
Utils.emitEvent(res,134)
}})
},3000)
break;
}
case "emitForward":{
this.controller.forward()
setTimeout(()=>{
let webTitle=this.controller.getTitle()
Utils.emitEvent(webTitle,136)
},3000)
break;
}
case "emitBackOrForward":{
this.controller.backOrForward(-1)
setTimeout(()=>{
let webTitle=this.controller.getTitle()
Utils.emitEvent(webTitle,138)
Utils.emitEvent(this.newUrl,136)
},3000)
break;
}
......@@ -363,10 +339,11 @@ struct Index {
case "emitCacheModeDefault":{
this.cacheMode=CacheMode.Default
await Utils.sleep(2000)
this.controller.loadUrl({url:"https://www.openharmony.cn/mainPlay"})
this.controller.loadUrl({url:"resource://rawfile/index.html"})
setTimeout(()=>{
let webTitle=this.controller.getTitle()
Utils.emitEvent(webTitle,184)
this.controller.runJavaScript({script:"gettitle()",callback:(res)=>{
Utils.emitEvent(res,184)
}})
},3000)
break;
}
......@@ -389,8 +366,9 @@ struct Index {
this.controller.loadUrl({url:"resource://rawfile/index.html"});
this.controller.runJavaScript({script:"openRawFile()"})
setTimeout(()=>{
let webTitle=this.controller.getTitle()
Utils.emitEvent(webTitle,190)
this.controller.runJavaScript({script:"gettitle()",callback:(res)=>{
Utils.emitEvent(res,190)
}})
},3000)
break;
}
......@@ -452,62 +430,20 @@ struct Index {
this.controller.loadUrl({url:"https://consumer.huawei.com/content/dam/huawei-cbg-site/cn/mkt/mobileservices/2022/download/PC107f1b3947c942ffaa14334a879065d8.2107261020.exe"})
break;
}
case "emitSetCookie":{
this.controller.getCookieManager().setCookie('http://www.baidu.com','e=f')
setTimeout(()=>{
let setCookieCalled = this.controller.getCookieManager().getCookie('http://www.baidu.com')
Utils.emitEvent(setCookieCalled,76)
},3000)
break;
}
case "emitGetCookie":{
this.controller.getCookieManager().setCookie('https://www.bilibili.com/','e=f')
setTimeout(()=>{
let getCookieCalled = this.controller.getCookieManager().getCookie('https://www.bilibili.com/')
Utils.emitEvent(getCookieCalled,69)
},3000)
break;
}
case "emitZoom":{
this.controller.loadUrl({url:"resource://rawfile/index.html"});
setTimeout(()=>{
this.controller.zoom(2)
setTimeout(() => {
if(this.controller.getPageHeight() > 1400){
setTimeout(()=>{
this.controller.runJavaScript({script:"getPageHeight()",callback:(res)=>{
console.info("getPageHeight++++++"+res)
if(Number(res) > 1400){
var zoomCalled = true
}
Utils.emitEvent(zoomCalled,77)
},3000)
}})
},5000)
break;
}
case "emitZoomOut":{
setTimeout(()=>{
var zoomOutCalled = true
Utils.emitEvent(zoomOutCalled,78)
},3000)
break;
}
case "emitZoomIn":{
setTimeout(()=>{
var zoomInCalled = false
Utils.emitEvent(zoomInCalled,79)
},3000)
break;
}
case "emitDeleteEntireCookie":{
this.controller.getCookieManager().deleteEntireCookie()
setTimeout(()=>{
let deleteEntireCookieCalled = this.controller.getCookieManager().getCookie('http://www.baidu.com')
Utils.emitEvent(deleteEntireCookieCalled,80)
},3000)
break;
}
case "emitSaveCookieSync":{
let saveCookieSyncCalled = this.controller.getCookieManager().saveCookieSync()
Utils.emitEvent(saveCookieSyncCalled,81)
break;
}
case "emitClearHistory":{
this.controller.loadUrl({url:"http://www.baidu.com/"})
setTimeout(()=>{
......@@ -532,14 +468,17 @@ struct Index {
break;
}
case "emitOnInactive":{
this.controller.loadUrl({url:"resource://rawfile/index.html"});
this.controller.onInactive()
this.controller.zoomOut()
setTimeout(()=>{
var onInactiveCalled = false
if(this.controller.getPageHeight() < 2600){
this.controller.runJavaScript({script:"gettitle()",callback:(res)=>{
console.info("gettitle++++++"+res)
if(res == "\"index\""){
onInactiveCalled = true
}
Utils.emitEvent(onInactiveCalled,84)
}})
},3000)
break;
}
......@@ -584,14 +523,6 @@ struct Index {
},3000)
break;
}
case "emitGetCookieManager":{
this.controller.getCookieManager().setCookie("https://weibo.com","a=b")
setTimeout(()=>{
let getCookieManagerCalled = this.controller.getCookieManager().getCookie('https://weibo.com')
Utils.emitEvent(getCookieManagerCalled,89)
},3000)
break;
}
case "emitWebVisibility":{
this.webVisibility = Visibility.Hidden;
setTimeout(()=>{
......
文件模式从 100755 更改为 100644
......@@ -101,7 +101,7 @@ export default function webJsunit() {
*/
it('loadUrl',0,async function(done){
emitKey="emitRunJavaScript";
Utils.registerContainEvent("loadUrl","代码托管和研发协作平台",110,done);
Utils.registerContainEvent("loadUrl","index",110,done);
sendEventByKey('webcomponent',10,'');
})
/*
......@@ -148,28 +148,8 @@ export default function webJsunit() {
*tc.desic Gets the id for the current Web
*/
it('getWebId',0,async function(done){
emitKey="emitGetTitle";
Utils.registerEvent("getWebId","webId",120,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_012
*tc.name getTitle
*tc.desic Gets the title of current Web page
*/
it('getTitle',0,async function(done){
emitKey="emitGetPageHeight";
Utils.registerEvent("getTitle","index",122,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_013
*tc.name getPageHeight
*tc.desic Gets the content height of current Web page
*/
it('getPageHeight',0,async function(done){
emitKey="emitGetRequestFocus";
Utils.registerEventTwo("getPageHeight",124,done);
Utils.registerEvent("getWebId","webId",120,done);
sendEventByKey('webcomponent',10,'');
})
/*
......@@ -219,7 +199,7 @@ export default function webJsunit() {
*/
it('backward',0,async function(done){
emitKey="emitForward";
Utils.registerEvent("backward","index",134,done);
Utils.registerEvent("backward","\"index\"",134,done);
sendEventByKey('webcomponent',10,'');
})
/*
......@@ -228,18 +208,8 @@ export default function webJsunit() {
*tc.desic Goes forward in the history of the web page
*/
it('forward',0,async function(done){
emitKey="emitBackOrForward";
Utils.registerEvent("forward","second",136,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_020
*tc.name backOrForward
*tc.desic Goes forward or back backOrForward in the history of the web page
*/
it('backOrForward',0,async function(done){
emitKey="emitGeolocationAccessFalse";
Utils.registerEvent("backOrForward","index",138,done);
Utils.registerEvent("forward","resource://rawfile/index.html",136,done);
sendEventByKey('webcomponent',10,'');
})
/*
......@@ -379,7 +349,7 @@ export default function webJsunit() {
*/
it('cacheModeDefault',0,async function(done){
emitKey="emitMixedModeNone";
Utils.registerContainEvent("cacheModeDefault","OpenHarmony",184,done);
Utils.registerContainEvent("cacheModeDefault","index",184,done);
sendEventByKey('webcomponent',10,'');
})
/*
......@@ -498,28 +468,8 @@ export default function webJsunit() {
*tc.desic Triggered when starting to download
*/
it('onDownloadStart',0,async function(done){
emitKey="emitSetCookie";
Utils.registerEvent("onDownloadStart","https://consumer.huawei.com/content/dam/huawei-cbg-site/cn/mkt/mobileservices/2022/download/PC107f1b3947c942ffaa14334a879065d8.2107261020.exe",68,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_047
*tc.name setCookie
*tc.desic Sets the cookie
*/
it('setCookie',0,async function(done){
emitKey="emitGetCookie";
Utils.registerEvent("setCookie","e=f",76,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_048
*tc.name getCookie
*tc.desic Gets all cookies for the given URL
*/
it('getCookie',0,async function(done){
emitKey="emitZoom";
Utils.registerEvent("getCookie","e=f",69,done);
Utils.registerEvent("onDownloadStart","https://consumer.huawei.com/content/dam/huawei-cbg-site/cn/mkt/mobileservices/2022/download/PC107f1b3947c942ffaa14334a879065d8.2107261020.exe",68,done);
sendEventByKey('webcomponent',10,'');
})
/*
......@@ -528,48 +478,8 @@ export default function webJsunit() {
*tc.desic Let the Web zoom by
*/
it('zoom',0,async function(done){
emitKey="emitZoomOut";
Utils.registerEvent("zoom",true,77,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_050
*tc.name zoomOut
*tc.desic Let the Web zoom out
*/
it('zoomOut',0,async function(done){
emitKey="emitZoomIn";
Utils.registerEvent("zoomOut",true,78,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_051
*tc.name zoomIn
*tc.desic Let the Web zoom in
*/
it('zoomIn',0,async function(done){
emitKey="emitDeleteEntireCookie";
Utils.registerEvent("zoomIn",false,79,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_052
*tc.name deleteEntireCookie
*tc.desic Delete all cookies
*/
it('deleteEntireCookie',0,async function(done){
emitKey="emitSaveCookieSync";
Utils.registerEvent("deleteEntireCookie","",80,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_053
*tc.name saveCookieSync
*tc.desic Saves the cookies
*/
it('saveCookieSync',0,async function(done){
emitKey="emitClearHistory";
Utils.registerEvent("saveCookieSync",true,81,done);
Utils.registerEvent("zoom",true,77,done);
sendEventByKey('webcomponent',10,'');
})
/*
......@@ -638,21 +548,10 @@ export default function webJsunit() {
*tc.desic Sets whether the Web allows JavaScript scripts to execute
*/
it('javaScriptAccess',0,async function(done){
emitKey="emitGetCookieManager";
Utils.registerEvent("javaScriptAccess",true,88,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_061
*tc.name getCookieManager
*tc.desic Gets network cookie manager
*/
it('getCookieManager',0,async function(done){
emitKey="emitWebVisibility";
Utils.registerEvent("getCookieManager","a=b",89,done);
Utils.registerEvent("javaScriptAccess",true,88,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_062
*tc.name webVisibility
......
......@@ -66,5 +66,8 @@
function openRawFile(){
document.getElementById("fileAccess").click()
}
function gettitle(){
return document.title
}
</script>
</html>
\ No newline at end of file
......@@ -9,4 +9,9 @@
<body>
<div style="height: 1300px;background-color: #999999;">second pages</div>
</body>
<script>
function gettitle(){
return document.title
}
</script>
</html>
\ No newline at end of file
......@@ -25,7 +25,7 @@ let loadedUrl;
struct Index {
controller:WebController = new WebController()
responseweb: WebResourceResponse = new WebResourceResponse()
@State str:string="emitStoreWebArchive"
@State str:string="emitAllowGeolocation"
@State text:string=""
@State textRatio:number=100
@State zoomAccessValue:boolean=true
......@@ -75,15 +75,6 @@ struct Index {
Button("web click").key('webcomponent').onClick(async ()=>{
console.info("key==>"+this.str)
switch(this.str){
case "emitStoreWebArchive":{
let webAsyncController = new web_webview.WebAsyncController(this.controller)
webAsyncController.storeWebArchive("/data/storage/el2/base/",true,(filename) => {
if(filename != null) {
Utils.emitEvent(filename,400)
}
})
break;
}
case "emitAllowGeolocation":{
try {
web_webview.GeolocationPermissions.allowGeolocation("resource://rawfile/");
......@@ -150,15 +141,6 @@ struct Index {
},3000)
break;
}
case "emitExistCookie":{
this.controller.getCookieManager().deleteEntireCookie();
setTimeout(()=>{
var result = web_webview.WebCookieManager.existCookie();
console.log(result.toString());
Utils.emitEvent(result,414)
},3000)
break ;
}
case "emitOnConsole":{
this.controller.runJavaScript({script:"consoleTest()"})
break;
......@@ -167,28 +149,32 @@ struct Index {
this.controller.loadUrl({url:"resource://rawfile/index.html"})
setTimeout(()=>{
this.controller.loadData({
data: "<html><title>index</title></html>",
data: "<html><head><title>index</title></head><body bgcolor=\"white\">Source:<pre>source</pre</body><script>function gettitle(){return document.title}</script></html>",
mimeType: "text/html",
encoding: "UTF-8"
})
},3000)
setTimeout(()=>{
this.text = this.controller.getTitle();
Utils.emitEvent(this.text,424)
this.controller.runJavaScript({script:"gettitle()",callback:(res)=>{
Utils.emitEvent(res,424)
}})
},4000)
break ;
}
case "emitZoomAccess":{
this.zoomAccessValue = false
this.controller.refresh()
var origin = this.controller.getPageHeight()
var zoomInCalled = false
setTimeout(()=>{
if (this.controller.getPageHeight() > origin) {
this.controller.runJavaScript({script:"getPageHeight()",callback:(res1)=>{
var zoomInCalled = false
this.controller.runJavaScript({script:"getPageHeight()",callback:(res)=>{
console.info("getPageHeight==>"+res)
if (Number(res) > Number(res1)) {
zoomInCalled = true
}
console.log("final" + this.controller.getPageHeight())
Utils.emitEvent(zoomInCalled,428);
}})
}})
},3000);
break ;
}
......
......@@ -16,7 +16,7 @@
import { describe, beforeEach, afterEach, it, expect } from "@ohos/hypium";
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets';
let emitKey = "emitUserAgent";
let emitKey = "emitAllowGeolocation";
export default function webJsunit() {
describe('ActsAceWebDevTest', function () {
beforeEach(async function (done) {
......@@ -44,16 +44,6 @@ export default function webJsunit() {
await Utils.sleep(2000);
done();
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_066
*tc.name storeWebArchive
*tc.desic Save current page
*/
it('storeWebArchive',0,async function(done){
emitKey="emitAllowGeolocation";
Utils.registerContainEvent("storeWebArchive","/data/storage/el2/base/",400,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_067
*tc.name allowGeolocation
......@@ -110,18 +100,8 @@ export default function webJsunit() {
*tc.desic return whether the third party cookie is allowed
*/
it('isThirdPartyCookieAllowed',0,async function(done){
emitKey="emitExistCookie";
Utils.registerEvent("isThirdPartyCookieAllowed",false,412,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_073
*tc.name existCookie
*tc.desic return whether there exits cookie
*/
it('existCookie',0,async function(done){
emitKey="emitOnConsole";
Utils.registerEvent("existCookie",false,414,done);
Utils.registerEvent("isThirdPartyCookieAllowed",false,412,done);
sendEventByKey('webcomponent',10,'');
})
/*
......
......@@ -66,5 +66,8 @@
function openRawFile(){
document.getElementById("fileAccess").click()
}
function gettitle(){
return document.title
}
</script>
</html>
\ No newline at end of file
......@@ -9,4 +9,9 @@
<body>
<div style="height: 1300px;background-color: #999999;">second pages</div>
</body>
<script>
function gettitle(){
return document.title
}
</script>
</html>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册