Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2420)

Unified Diff: chrome/test/data/webrtc/message_handling.js

Issue 10834229: Fixed race condition in test. Fixed spurious wait requests on shutdown. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review updates Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/test/functional/webrtc_call.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | chrome/test/functional/webrtc_call.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698