未验证 提交 5a698cfb 编写于 作者: O openharmony_ci 提交者: Gitee

!9804 unsubscribe接口增加等待时间,保证注册成功

Merge pull request !9804 from 高曦/master
......@@ -38,7 +38,6 @@ export default function Telephony_NetManager_NetWorkTest() {
console.info("NetManager getType " + JSON.stringify(data));
expect(data.type == "none").assertTrue();
expect(data.metered == false).assertTrue();
network.unsubscribe();
done();
},
fail: function (data, code) {
......@@ -69,7 +68,6 @@ export default function Telephony_NetManager_NetWorkTest() {
console.info("NetManager getType 1 " + JSON.stringify(data));
expect(data.type == "none").assertTrue();
expect(data.metered == false).assertTrue();
network.unsubscribe();
done();
console.info("NetManager Telephony_NetManager_NetWorkTest_GetType_none_1 end");
},
......@@ -101,16 +99,19 @@ export default function Telephony_NetManager_NetWorkTest() {
console.info("NetManager subscribe " + JSON.stringify(data));
expect(data.type == "none").assertTrue();
expect(data.metered == false).assertTrue();
network.unsubscribe();
done();
},
fail: function (data, code) {
console.log("data:" + JSON.stringify(data) + " code:" + JSON.stringify(code));
expect().assertFail();
done();
}
})
})
});
setTimeout(()=>{
network.unsubscribe();
console.info("async function unsubscribe end");
done();
},1500);
});
});
/**
......@@ -130,16 +131,19 @@ export default function Telephony_NetManager_NetWorkTest() {
console.info("NetManager subscribe " + JSON.stringify(data));
expect(data.type == "none").assertTrue();
expect(data.metered == false).assertTrue();
network.unsubscribe();
done();
},
fail: function (data, code) {
console.log("data:" + JSON.stringify(data) + " code:" + JSON.stringify(code));
expect().assertFail();
done();
}
})
})
});
setTimeout(()=>{
network.unsubscribe();
console.info("async function unsubscribe end");
done();
},1500);
});
});
});
}
\ No newline at end of file
......@@ -18,12 +18,6 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
export default function Telephony_NetManager_NetWorkTest() {
describe("Telephony_NetManager_NetWorkTest", function () {
afterEach(function(){
setTimeout(()=>{
network.unsubscribe();
console.info("async function unsubscribe end");
},100);
});
/**
* @tc.number Telephony_NetManager_NetWorkTest_GetType_WiFi_0100
......@@ -60,13 +54,17 @@ describe("Telephony_NetManager_NetWorkTest", function () {
console.info("NetManager subscribe "+JSON.stringify(data));
expect(data.type === "WiFi").assertTrue();
expect(data.metered === false).assertTrue();
done();
},
fail : function(data,code){
expect().assertFail();
done();
}
});
setTimeout(()=>{
network.unsubscribe();
console.info("async function unsubscribe end");
done();
},100);
});
/**
......@@ -105,13 +103,17 @@ describe("Telephony_NetManager_NetWorkTest", function () {
console.info("NetManager subscribe 1 "+JSON.stringify(data));
expect(data.type === "WiFi").assertTrue();
expect(data.metered === false).assertTrue();
done();
},
fail : function(data,code){
expect().assertFail();
done();
}
});
setTimeout(()=>{
network.unsubscribe();
console.info("async function unsubscribe end");
done();
},100);
});
});
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册