未验证 提交 30ddf9d9 编写于 作者: O openharmony_ci 提交者: Gitee

!6599 ACE子系统】修复用例超时问题&修改webviewcontrol用例

Merge pull request !6599 from hekun/master
...@@ -250,7 +250,7 @@ struct Index { ...@@ -250,7 +250,7 @@ struct Index {
var origin = this.controller.getPageHeight() var origin = this.controller.getPageHeight()
var zoomInCalled = false var zoomInCalled = false
setTimeout(()=>{ setTimeout(()=>{
this.controller.zoomIn() this.newcontroller.zoomIn();
if (this.controller.getPageHeight() > origin) { if (this.controller.getPageHeight() > origin) {
zoomInCalled = true zoomInCalled = true
} }
...@@ -383,7 +383,7 @@ struct Index { ...@@ -383,7 +383,7 @@ struct Index {
case "emitSearchAllAsync":{ case "emitSearchAllAsync":{
this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/index.html"}) this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/index.html"})
setTimeout(()=>{ setTimeout(()=>{
this.controller.searchAllAsync("首页"); this.newcontroller.searchAllAsync("首页");
},3000) },3000)
break; break;
} }
...@@ -523,7 +523,7 @@ struct Index { ...@@ -523,7 +523,7 @@ struct Index {
case "emitgetUrl":{ case "emitgetUrl":{
try{ try{
setTimeout(() => { setTimeout(() => {
this.controller.getUrl(); this.newcontroller.getUrl();
Utils.emitEvent('succesful',446) Utils.emitEvent('succesful',446)
},3000) },3000)
}catch (error) { }catch (error) {
......
...@@ -219,7 +219,7 @@ struct Index { ...@@ -219,7 +219,7 @@ struct Index {
var origin = this.controller.getPageHeight() var origin = this.controller.getPageHeight()
var zoomInCalled = false var zoomInCalled = false
setTimeout(()=>{ setTimeout(()=>{
this.controller.zoomIn() this.newcontroller.zoomIn();
if (this.controller.getPageHeight() > origin) { if (this.controller.getPageHeight() > origin) {
zoomInCalled = true zoomInCalled = true
} }
...@@ -358,7 +358,7 @@ struct Index { ...@@ -358,7 +358,7 @@ struct Index {
case "emitSearchAllAsync":{ case "emitSearchAllAsync":{
this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/index.html"}) this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/index.html"})
setTimeout(()=>{ setTimeout(()=>{
this.controller.searchAllAsync("首页"); this.newcontroller.searchAllAsync("首页");
},3000) },3000)
break; break;
} }
......
...@@ -93,7 +93,8 @@ struct VideoOnFullscreenChange { ...@@ -93,7 +93,8 @@ struct VideoOnFullscreenChange {
Button("FullScreen") Button("FullScreen")
.key("fullScreen") .key("fullScreen")
.onClick(() => { .onClick(() => {
this.controller.requestFullscreen(true) this.controller.requestFullscreen(true);
console.info("video_101 onClick start to fullScreen");
}); });
Button("ExitFullScreen") Button("ExitFullScreen")
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
*/ */
import Log from '../common/Log.ets'; import Log from '../common/Log.ets';
import web_webview from '@ohos.web.webview';
@Entry @Entry
@Component @Component
...@@ -24,6 +25,7 @@ struct WebComponent { ...@@ -24,6 +25,7 @@ struct WebComponent {
fileAccess: boolean = true; fileAccess: boolean = true;
// 定义Web组件的控制器controller // 定义Web组件的控制器controller
controller: WebController = new WebController(); controller: WebController = new WebController();
controllerTwo: web_webview.WebviewController = new web_webview.WebviewController();
webResourceResponse: WebResourceResponse = new WebResourceResponse(); webResourceResponse: WebResourceResponse = new WebResourceResponse();
build() { build() {
Column() { Column() {
...@@ -146,8 +148,8 @@ struct WebComponent { ...@@ -146,8 +148,8 @@ struct WebComponent {
console.log('setResponseEncoding:' + event.response.setResponseEncoding("UTF-8")); console.log('setResponseEncoding:' + event.response.setResponseEncoding("UTF-8"));
console.log('setResponseMimeType:' + event.response.setResponseMimeType("application/json")); console.log('setResponseMimeType:' + event.response.setResponseMimeType("application/json"));
console.log('setResponseHeader:' + event.response.setResponseHeader([])); console.log('setResponseHeader:' + event.response.setResponseHeader([]));
console.log('web getExtra:' + this.controller.getHitTestValue().getExtra()); console.log('web getExtra:' + this.controllerTwo.getHitTestValue().getExtra());
console.log('web getType:' + this.controller.getHitTestValue().getType()); console.log('web getType:' + this.controllerTwo.getHitTestValue().getType());
console.log('web getCookieManager:' + this.controller.getCookieManager()); console.log('web getCookieManager:' + this.controller.getCookieManager());
console.log('web getCookie:' + this.controller.getCookieManager().getCookie("www.baidu.com")); console.log('web getCookie:' + this.controller.getCookieManager().getCookie("www.baidu.com"));
console.log('web existCookie:' + this.controller.getCookieManager().existCookie()); console.log('web existCookie:' + this.controller.getCookieManager().existCookie());
...@@ -165,10 +167,10 @@ struct WebComponent { ...@@ -165,10 +167,10 @@ struct WebComponent {
console.log('web putAcceptThirdPartyCookieEnabled:' + this.controller.getCookieManager() console.log('web putAcceptThirdPartyCookieEnabled:' + this.controller.getCookieManager()
.putAcceptThirdPartyCookieEnabled(true)); .putAcceptThirdPartyCookieEnabled(true));
console.log('web saveCookieSync:' + this.controller.getCookieManager().saveCookieSync()); console.log('web saveCookieSync:' + this.controller.getCookieManager().saveCookieSync());
console.log('web zoomIn:' + this.controller.zoomIn()); console.log('web zoomIn:' + this.controllerTwo.zoomIn());
console.log('web zoomOut:' + this.controller.zoomOut()); console.log('web zoomOut:' + this.controllerTwo.zoomOut());
console.log('web zoom:' + this.controller.zoom(2)); console.log('web zoom:' + this.controller.zoom(2));
console.log('web getWebId:' + this.controller.getWebId()); console.log('web getWebId:' + this.controllerTwo.getWebId());
console.log('web getDefaultUserAgent:' + this.controller.getDefaultUserAgent()); console.log('web getDefaultUserAgent:' + this.controller.getDefaultUserAgent());
console.log('web getTitle:' + this.controller.getTitle()); console.log('web getTitle:' + this.controller.getTitle());
console.log('web getPageHeight:' + this.controller.getPageHeight()); console.log('web getPageHeight:' + this.controller.getPageHeight());
......
...@@ -45,7 +45,8 @@ struct Index { ...@@ -45,7 +45,8 @@ struct Index {
message = new ConsoleMessage("1","12",23,MessageLevel.Debug); message = new ConsoleMessage("1","12",23,MessageLevel.Debug);
controller:WebController = new WebController() controller:WebController = new WebController();
controllerTwo: web_webview.WebviewController = new web_webview.WebviewController();
responseweb: WebResourceResponse = new WebResourceResponse() responseweb: WebResourceResponse = new WebResourceResponse()
@State str:string="emitStoreWebArchive" @State str:string="emitStoreWebArchive"
...@@ -160,23 +161,23 @@ struct Index { ...@@ -160,23 +161,23 @@ struct Index {
switch(this.str){ switch(this.str){
// add // add
case "emitGeturl": case "emitGeturl":
let url = this.controller.getUrl(); let url = this.controllerTwo.getUrl();
Utils.emitEvent(url,810); Utils.emitEvent(url,810);
break; break;
case "emitclearClientAuthenticationCache": case "emitclearClientAuthenticationCache":
this.controller.clearClientAuthenticationCache(); this.controllerTwo.clearClientAuthenticationCache();
Utils.emitEvent(this.isVoid,811); Utils.emitEvent(this.isVoid,811);
break; break;
case "emitclearSslCache": case "emitclearSslCache":
this.controller.clearSslCache(); this.controllerTwo.clearSslCache();
Utils.emitEvent(this.isVoid,812); Utils.emitEvent(this.isVoid,812);
break; break;
case "emitsearchNext": case "emitsearchNext":
this.controller.searchNext(true); this.controllerTwo.searchNext(true);
Utils.emitEvent(this.isVoid,813); Utils.emitEvent(this.isVoid,813);
break; break;
case "emitclearMatches": case "emitclearMatches":
this.controller.clearMatches(); this.controllerTwo.clearMatches();
Utils.emitEvent(this.isVoid,814); Utils.emitEvent(this.isVoid,814);
break; break;
case "emitDefaultUserAgent": case "emitDefaultUserAgent":
...@@ -184,7 +185,7 @@ struct Index { ...@@ -184,7 +185,7 @@ struct Index {
Utils.emitEvent(usrAgent,815); Utils.emitEvent(usrAgent,815);
break; break;
case "emitgetWebId": case "emitgetWebId":
let webId = this.controller.getWebId(); let webId = this.controllerTwo.getWebId();
Utils.emitEvent(webId,816); Utils.emitEvent(webId,816);
break; break;
case "emitpostMessage": case "emitpostMessage":
......
...@@ -91,7 +91,7 @@ export default function sideBarShowSideBarJsunit() { ...@@ -91,7 +91,7 @@ export default function sideBarShowSideBarJsunit() {
console.info("[testsideBarShowSideBar0003] component autoHide strJson:" + strJson); console.info("[testsideBarShowSideBar0003] component autoHide strJson:" + strJson);
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('SideBarContainer'); expect(obj.$type).assertEqual('SideBarContainer');
expect(obj.$attrs.sideBarPosition).assertEqual(undefined); expect(obj.$attrs.sideBarPosition).assertEqual('SideBarPosition.End');
console.info("[testsideBarShowSideBar0003] autoHide value :" + obj.$attrs.autoHide); console.info("[testsideBarShowSideBar0003] autoHide value :" + obj.$attrs.autoHide);
done(); done();
}); });
......
...@@ -214,11 +214,13 @@ export default function videoOnFullscreenChangeJsunit() { ...@@ -214,11 +214,13 @@ export default function videoOnFullscreenChangeJsunit() {
}catch(err){ }catch(err){
console.info("video_101 on events_emitter err : " + JSON.stringify(err)); console.info("video_101 on events_emitter err : " + JSON.stringify(err));
} }
done();
} }
try { try {
events_emitter.on(innerEvent, callback); events_emitter.on(innerEvent, callback);
await Utils.sleep(500);
console.info("video_101 click result is: " + JSON.stringify(sendEventByKey('fullScreen', 10, ""))); console.info("video_101 click result is: " + JSON.stringify(sendEventByKey('fullScreen', 10, "")));
await Utils.sleep(2000);
done();
} catch (err) { } catch (err) {
console.info("video_101 on events_emitter err : " + JSON.stringify(err)); console.info("video_101 on events_emitter err : " + JSON.stringify(err));
} }
......
...@@ -62,14 +62,16 @@ export default function xcomponentGetXComponentContextJsunit() { ...@@ -62,14 +62,16 @@ export default function xcomponentGetXComponentContextJsunit() {
var callback1 = (eventData) => { var callback1 = (eventData) => {
console.info("onRequestPopupData_0010 get event state result is: " + JSON.stringify(eventData)); console.info("onRequestPopupData_0010 get event state result is: " + JSON.stringify(eventData));
expect(eventData.data.STATUS).assertEqual("callBackSuccess"); expect(eventData.data.STATUS).assertEqual("callBackSuccess");
done();
} }
console.info("onSelect_0012 click result is: " + JSON.stringify(sendEventByKey('getXComponentContextText', 10, "")));
events_emitter.on(innerEventOne, callback1); events_emitter.on(innerEventOne, callback1);
await Utils.sleep(1000);
console.info("onSelect_0012 click result is: " + JSON.stringify(sendEventByKey('getXComponentContextText', 10, "")));
await Utils.sleep(2000);
} catch (err) { } catch (err) {
console.info("onRequestPopupData_0010 on events_emitter err : " + JSON.stringify(err)); console.info("onRequestPopupData_0010 on events_emitter err : " + JSON.stringify(err));
} }
console.info('testxcomponentGetXComponentContext0010 END'); console.info('testxcomponentGetXComponentContext0010 END');
done();
}); });
/* /*
...@@ -80,7 +82,8 @@ export default function xcomponentGetXComponentContextJsunit() { ...@@ -80,7 +82,8 @@ export default function xcomponentGetXComponentContextJsunit() {
it('testxcomponentSetXComponentSurfaceSize0001', 0, async function (done) { it('testxcomponentSetXComponentSurfaceSize0001', 0, async function (done) {
console.info('xcomponentSetXComponentContext testxcomponentSetXComponentSurfaceSize0001 START'); console.info('xcomponentSetXComponentContext testxcomponentSetXComponentSurfaceSize0001 START');
await Utils.sleep(2000); await Utils.sleep(2000);
console.info("setXComponentSurfaceSize0001 click result is: " + JSON.stringify(sendEventByKey('setXComponentSurfaceSizeText', 10, ""))) console.info("setXComponentSurfaceSize0001 click result is: " + JSON.stringify(sendEventByKey('setXComponentSurfaceSizeText', 10, "")));
await Utils.sleep(2000);
let strJson = getInspectorByKey('setXComponentSurfaceSizeText'); let strJson = getInspectorByKey('setXComponentSurfaceSizeText');
//console //console
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
...@@ -99,6 +102,7 @@ export default function xcomponentGetXComponentContextJsunit() { ...@@ -99,6 +102,7 @@ export default function xcomponentGetXComponentContextJsunit() {
console.info('xcomponentSetXComponentContext testxcomponentSetXComponentSurfaceSize0002 START'); console.info('xcomponentSetXComponentContext testxcomponentSetXComponentSurfaceSize0002 START');
await Utils.sleep(2000); await Utils.sleep(2000);
console.info("testxcomponentSetXComponentSurfaceSize0002 click result is: " + JSON.stringify(sendEventByKey('setXComponentSurfaceSizeText', 10, ""))) console.info("testxcomponentSetXComponentSurfaceSize0002 click result is: " + JSON.stringify(sendEventByKey('setXComponentSurfaceSizeText', 10, "")))
await Utils.sleep(2000);
let strJson = getInspectorByKey('setXComponentSurfaceSizeText'); let strJson = getInspectorByKey('setXComponentSurfaceSizeText');
//console //console
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册