diff options
Diffstat (limited to 'packages/meshbay-hub/tests/test_search_connect_deadline.py')
| -rw-r--r-- | packages/meshbay-hub/tests/test_search_connect_deadline.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/packages/meshbay-hub/tests/test_search_connect_deadline.py b/packages/meshbay-hub/tests/test_search_connect_deadline.py index 953f0277..0dfee4e0 100644 --- a/packages/meshbay-hub/tests/test_search_connect_deadline.py +++ b/packages/meshbay-hub/tests/test_search_connect_deadline.py @@ -123,3 +123,21 @@ def test_a_fast_connection_is_unaffected(): out = _attempt(progressAt=[], resolveAt=3000) assert out["result"] == "connected" assert out["at"] == 3000 + + +def test_a_node_refused_the_local_network_is_named_when_search_gives_up(): + """Android 17 and Chrome 155 refuse the node's address on the phone's Wi-Fi + without the permission, and connect() names it only when ICE gives up, + long after search has: the refusal is read from the connection then.""" + out = _attempt(lanRefused=[0]) + assert out["result"] == "failed" and out["reason"] == "local_network_blocked", out + assert out["at"] == STALL_MS, out + + +def test_a_refused_node_does_not_stop_the_walk(): + """Refused here is one node: another of the group may be elsewhere.""" + out = _attempt(nodes=2, lanRefused=[0], answering=[1], progressAt=[], resolveAt=500) + assert out["result"] == "connected", out + # And when no node answers, the refusal is what is said, not a timeout. + out = _attempt(nodes=2, lanRefused=[0]) + assert out["reason"] == "local_network_blocked", out |