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..ce7c695d8cb8d087fe12671117a8a763a902f7a2 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 is_disconnected() { |
Nirnimesh
2012/08/08 18:41:04
js function names should not have underscores. Use
phoglund_chromium
2012/08/09 09:00:24
Done.
|
+ 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) { |
phoglund_chromium
2012/08/08 15:24:17
We were sending messages after disconnecting earli
|
+ if (is_disconnected()) |
+ return; |
hangingGetRequest = new XMLHttpRequest(); |
hangingGetRequest.onreadystatechange = function() { |
hangingGetCallback(hangingGetRequest, server, ourId); |