Index: chrome/test/data/webrtc/message_handling.js |
diff --git a/chrome/test/data/webrtc/message_handling.js b/chrome/test/data/webrtc/message_handling.js |
index c0cc454009cc269ba5d65d0baa19b2b0be34a674..40bf83d6470b3c19a70105f4934c0db1c3dcfd5e 100644 |
--- a/chrome/test/data/webrtc/message_handling.js |
+++ b/chrome/test/data/webrtc/message_handling.js |
@@ -125,13 +125,16 @@ function disconnect() { |
request = new XMLHttpRequest(); |
request.open("GET", gServerUrl + "/sign_out?peer_id=" + gOurPeerId, false); |
request.send(); |
- request = null; |
gOurPeerId = null; |
returnToPyAuto('ok-disconnected'); |
} |
// Internals. |
+function isDisconnected() { |
+ return gOurPeerId == null; |
+} |
+ |
function connectCallback(request) { |
debug("Connect callback: " + request.status + ", " + request.readyState); |
if (request.readyState == 4 && request.status == 200) { |
@@ -179,6 +182,8 @@ function parseRemotePeerIdIfConnected(responseText) { |
} |
function startHangingGet(server, ourId) { |
+ if (isDisconnected()) |
+ return; |
hangingGetRequest = new XMLHttpRequest(); |
hangingGetRequest.onreadystatechange = function() { |
hangingGetCallback(hangingGetRequest, server, ourId); |