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

!9668 MDNS增加off接口

Merge pull request !9668 from 高曦/master
...@@ -801,6 +801,7 @@ export default function NetworkManagerMdnsTest() { ...@@ -801,6 +801,7 @@ export default function NetworkManagerMdnsTest() {
expect(err).assertEqual(undefined); expect(err).assertEqual(undefined);
setTimeout(() => { setTimeout(() => {
expect(startSearching_status).assertEqual(true); expect(startSearching_status).assertEqual(true);
discoveryService.off("discoveryStart");
done(); done();
}, delayTime) }, delayTime)
} }
...@@ -843,6 +844,7 @@ export default function NetworkManagerMdnsTest() { ...@@ -843,6 +844,7 @@ export default function NetworkManagerMdnsTest() {
expect(err).assertEqual(undefined); expect(err).assertEqual(undefined);
setTimeout(() => { setTimeout(() => {
expect(stopSearching_status).assertEqual(true); expect(stopSearching_status).assertEqual(true);
discoveryService.off("discoveryStop");
done(); done();
}, delayTime) }, delayTime)
} }
...@@ -884,6 +886,7 @@ export default function NetworkManagerMdnsTest() { ...@@ -884,6 +886,7 @@ export default function NetworkManagerMdnsTest() {
expect(err).assertEqual(undefined); expect(err).assertEqual(undefined);
setTimeout(() => { setTimeout(() => {
expect(startSearching_status).assertEqual(true); expect(startSearching_status).assertEqual(true);
discoveryService.off("discoveryStart");
done(); done();
}, delayTime) }, delayTime)
} }
...@@ -925,6 +928,7 @@ export default function NetworkManagerMdnsTest() { ...@@ -925,6 +928,7 @@ export default function NetworkManagerMdnsTest() {
expect(err).assertEqual(undefined); expect(err).assertEqual(undefined);
setTimeout(() => { setTimeout(() => {
expect(stopSearching_status).assertEqual(true); expect(stopSearching_status).assertEqual(true);
discoveryService.off("discoveryStop");
done(); done();
}, delayTime) }, delayTime)
} }
...@@ -966,6 +970,7 @@ export default function NetworkManagerMdnsTest() { ...@@ -966,6 +970,7 @@ export default function NetworkManagerMdnsTest() {
expect(err).assertEqual(undefined); expect(err).assertEqual(undefined);
setTimeout(() => { setTimeout(() => {
expect(found_status).assertEqual(true); expect(found_status).assertEqual(true);
discoveryService.off("serviceFound");
done(); done();
}, delayTime) }, delayTime)
} }
...@@ -1005,6 +1010,7 @@ export default function NetworkManagerMdnsTest() { ...@@ -1005,6 +1010,7 @@ export default function NetworkManagerMdnsTest() {
expect(err).assertEqual(undefined); expect(err).assertEqual(undefined);
setTimeout(() => { setTimeout(() => {
expect(lost_status).assertEqual(true); expect(lost_status).assertEqual(true);
discoveryService.off("serviceLost");
done(); done();
}, delayTime) }, delayTime)
} }
......
...@@ -108,7 +108,7 @@ export default function NetTCPSocketServerTest() { ...@@ -108,7 +108,7 @@ export default function NetTCPSocketServerTest() {
done(); done();
} catch (error) { } catch (error) {
console.info(`${caseName} catch error, expect error: [${error.code}, ${error.message}]`); console.info(`${caseName} catch error, expect error: [${error.code}, ${error.message}]`);
expect(error.code).assertEqual(401); expect(error.code == 401).assertTrue();
done(); done();
} }
}); });
...@@ -172,7 +172,7 @@ export default function NetTCPSocketServerTest() { ...@@ -172,7 +172,7 @@ export default function NetTCPSocketServerTest() {
done(); done();
} catch (error) { } catch (error) {
console.info(`${caseName} catch error, expect error: [${error.code}, ${error.message}]`); console.info(`${caseName} catch error, expect error: [${error.code}, ${error.message}]`);
expect(error.code).assertEqual(401); expect(error.code == 401).assertTrue();
done(); done();
return; return;
} }
...@@ -225,7 +225,7 @@ export default function NetTCPSocketServerTest() { ...@@ -225,7 +225,7 @@ export default function NetTCPSocketServerTest() {
done(); done();
} catch (error) { } catch (error) {
console.info(`${caseName} catch error, expect error: [${error.code}, ${error.message}]`); console.info(`${caseName} catch error, expect error: [${error.code}, ${error.message}]`);
expect(error.code).assertEqual(401); expect(error.code == 401).assertTrue();
done(); done();
return; return;
} }
...@@ -690,7 +690,7 @@ export default function NetTCPSocketServerTest() { ...@@ -690,7 +690,7 @@ export default function NetTCPSocketServerTest() {
}); });
} catch (error) { } catch (error) {
console.info(`${caseName} catch error, expect error: [${error.code}, ${error.message}]`); console.info(`${caseName} catch error, expect error: [${error.code}, ${error.message}]`);
ExpectFalse(); expect(error.code == 401).assertTrue();
done(); done();
return; return;
} }
...@@ -1305,7 +1305,7 @@ export default function NetTCPSocketServerTest() { ...@@ -1305,7 +1305,7 @@ export default function NetTCPSocketServerTest() {
done(); done();
} catch (error) { } catch (error) {
console.info(`${caseName} catch err, expect err: [${error.code}, ${error.message}]`); console.info(`${caseName} catch err, expect err: [${error.code}, ${error.message}]`);
expect(error.code).assertEqual(401); expect(error.code == 401).assertTrue();
done(); done();
return; return;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册