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

Unified Diff: content/test/data/media/peerconnection-call.html

Issue 689783002: Refactor RtcDataChannelHandler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 2 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 | « content/renderer/media/rtc_peer_connection_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/data/media/peerconnection-call.html
diff --git a/content/test/data/media/peerconnection-call.html b/content/test/data/media/peerconnection-call.html
index 3a1eba0bd8ddf5901a5674ff80938d405222b9fa..10a9b2f969521430fbe5cbd131d213115bda077b 100644
--- a/content/test/data/media/peerconnection-call.html
+++ b/content/test/data/media/peerconnection-call.html
@@ -553,11 +553,7 @@
// When |firstDataChannel| transition to open state, send a text string.
firstDataChannel.onopen = function() {
assertEquals('open', firstDataChannel.readyState);
- if (firstDataChannel.reliable) {
- firstDataChannel.send(sendDataString);
- } else {
- sendDataRepeatedlyUntilClosed(firstDataChannel);
- }
+ firstDataChannel.send(sendDataString);
}
// When |firstDataChannel| receive a message, close the channel and
@@ -583,30 +579,10 @@
secondDataChannel.onmessage = function(event) {
assertEquals(event.data, sendDataString);
console.log("gSecondConnection received data");
- if (secondDataChannel.reliable) {
- // If we're reliable we will just send one message over the channel,
- // and therefore channel one's message handler cannot have shut us
- // down already.
- assertEquals('open', secondDataChannel.readyState);
- secondDataChannel.send(sendDataString);
- } else {
- // If unreliable, this could be one in a series of messages and it
- // is possible we already replied (which will close our channel).
- sendDataRepeatedlyUntilClosed(secondDataChannel);
- }
+ assertEquals('open', secondDataChannel.readyState);
+ secondDataChannel.send(sendDataString);
}
}
-
- // Sends |sendDataString| on |dataChannel| every 200ms as long as
- // |dataChannel| is open.
- function sendDataRepeatedlyUntilClosed(dataChannel) {
- var sendTimer = setInterval(function() {
- if (dataChannel.readyState == 'open')
- dataChannel.send(sendDataString);
- else
- clearInterval(sendTimer);
- }, 200);
- }
}
// SCTP data channel setup is slightly different then RTP based
« no previous file with comments | « content/renderer/media/rtc_peer_connection_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698