提交 989195e3 编写于 作者: B bianxinbo

api10andonhttperror

Signed-off-by: Nbianxinbo <bianxinbo@huawei.com>
上级 67c186fb
......@@ -11,10 +11,10 @@
"distributedNotificationEnabled": true,
"keepAlive": true,
"singleUser": true,
"minAPIVersion": 9,
"targetAPIVersion": 9,
"minAPIVersion": 10,
"targetAPIVersion": 10,
"car": {
"apiCompatibleVersion": 9,
"apiCompatibleVersion": 10,
"singleUser": false
}
}
......
......@@ -56,6 +56,8 @@ struct Index {
@State webVisibility: Visibility = Visibility.Visible
@State isProgressFinish:boolean=false
@State isHttpErrorReceive:boolean=false
@State isLargeThan:boolean=false
onPageShow(){
let valueChangeEvent={
eventId:10,
......@@ -414,7 +416,7 @@ struct Index {
case "emitOnHttpErrorReceive":{
this.isHttpErrorReceive=true
await Utils.sleep(1000)
this.controller.loadUrl({url:'https://example1.com/path/does/not/exist/index.jsp'})
this.controller.loadUrl({url:'http://1.1.1.123/index.html'})
break;
}
case "emitOnTitleReceive":{
......@@ -651,7 +653,11 @@ struct Index {
if(this.isHttpErrorReceive){
console.info("isHttpErrorReceive==>")
this.httpErrorReceive = event.response.getResponseCode()
Utils.emitEvent(this.httpErrorReceive,66)
if(this.httpErrorReceive>400){
this.isLargeThan=true
Utils.emitEvent(this.isLargeThan,66)
}
this.isLargeThan=false
this.isHttpErrorReceive=false
}
})
......
......@@ -449,7 +449,7 @@ export default function webJsunit() {
*/
it('onHttpErrorReceive',0,async function(done){
emitKey="emitOnTitleReceive";
Utils.registerEvent("onHttpErrorReceive",404,66,done);
Utils.registerEvent("onHttpErrorReceive",true,66,done);
sendEventByKey('webcomponent',10,'');
})
/*
......
......@@ -14,6 +14,12 @@
"installationFree": false,
"uiSyntax": "ets",
"pages": "$profile:main_pages",
"metadata": [
{
"name": "ArkTSPartialUpdate",
"value": "true"
}
],
"abilities": [{
"name": "com.example.myapplication.MainAbility",
"srcEntrance": "./ets/MainAbility/MainAbility.ts",
......
......@@ -14,6 +14,12 @@
"installationFree": false,
"uiSyntax": "ets",
"pages": "$profile:main_pages",
"metadata": [
{
"name": "ArkTSPartialUpdate",
"value": "true"
}
],
"abilities": [{
"name": "com.example.myapplication.MainAbility",
"srcEntrance": "./ets/MainAbility/MainAbility.ts",
......
......@@ -11,10 +11,10 @@
"distributedNotificationEnabled": true,
"keepAlive": true,
"singleUser": true,
"minAPIVersion": 9,
"targetAPIVersion": 9,
"minAPIVersion": 10,
"targetAPIVersion": 10,
"car": {
"apiCompatibleVersion": 9,
"apiCompatibleVersion": 10,
"singleUser": false
}
}
......
......@@ -14,6 +14,12 @@
"installationFree": false,
"uiSyntax": "ets",
"pages": "$profile:main_pages",
"metadata": [
{
"name": "ArkTSPartialUpdate",
"value": "true"
}
],
"abilities": [{
"name": "com.example.myapplication.MainAbility",
"srcEntrance": "./ets/MainAbility/MainAbility.ts",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册