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

api10andonhttperror

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