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

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: 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') | chrome/test/functional/webrtc_call.py » ('J')
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..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);
« no previous file with comments | « no previous file | chrome/test/functional/webrtc_call.py » ('j') | chrome/test/functional/webrtc_call.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698