Simplify data channel buffer amount low tests
https://bugs.webkit.org/show_bug.cgi?id=202693
Reviewed by Eric Carlson.
Neither of these tests need to handle a remoteChannel.
Remove the related code and remove variables that are also unneeded.
* webrtc/datachannel/bufferedAmountLowThreshold-default.html:
* webrtc/datachannel/bufferedAmountLowThreshold.html:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@250836 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index c4b3d8f..de36a12 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2019-10-08 Youenn Fablet <youenn@apple.com>
+
+ Simplify data channel buffer amount low tests
+ https://bugs.webkit.org/show_bug.cgi?id=202693
+
+ Reviewed by Eric Carlson.
+
+ Neither of these tests need to handle a remoteChannel.
+ Remove the related code and remove variables that are also unneeded.
+
+ * webrtc/datachannel/bufferedAmountLowThreshold-default.html:
+ * webrtc/datachannel/bufferedAmountLowThreshold.html:
+
2019-10-08 Wenson Hsieh <wenson_hsieh@apple.com>
[Clipboard API] Introduce bindings for the async Clipboard API
diff --git a/LayoutTests/webrtc/datachannel/bufferedAmountLowThreshold-default.html b/LayoutTests/webrtc/datachannel/bufferedAmountLowThreshold-default.html
index 268c170..050456a 100644
--- a/LayoutTests/webrtc/datachannel/bufferedAmountLowThreshold-default.html
+++ b/LayoutTests/webrtc/datachannel/bufferedAmountLowThreshold-default.html
@@ -14,11 +14,9 @@
});
var localChannel;
-var remoteChannel;
function closeDataChannels() {
localChannel.close();
- remoteChannel.close();
closeConnections();
}
@@ -32,14 +30,7 @@
channel.send(longString);
}
-function receiveMessages(event) {
- if (++counter === 1)
- return;
-}
-
promise_test((test) => {
- counter = 0;
- var gotEvent = false;
return new Promise((resolve, reject) => {
createConnections((localConnection) => {
localChannel = localConnection.createDataChannel('sendDataChannel');
@@ -49,10 +40,6 @@
}
assert_equals(localChannel.bufferedAmountLowThreshold, 0, "default bufferedAmountLowThreshold value");
}, (remoteConnection) => {
- remoteConnection.ondatachannel = (event) => {
- remoteChannel = event.channel;
- remoteChannel.onmessage = receiveMessages;
- };
});
setTimeout(() => reject('timed out'), 5000);
}).then (() => {
diff --git a/LayoutTests/webrtc/datachannel/bufferedAmountLowThreshold.html b/LayoutTests/webrtc/datachannel/bufferedAmountLowThreshold.html
index 3f2c1b7..fce08b6 100644
--- a/LayoutTests/webrtc/datachannel/bufferedAmountLowThreshold.html
+++ b/LayoutTests/webrtc/datachannel/bufferedAmountLowThreshold.html
@@ -14,11 +14,9 @@
});
var localChannel;
-var remoteChannel;
function closeDataChannels() {
localChannel.close();
- remoteChannel.close();
closeConnections();
}
@@ -26,11 +24,6 @@
for (var cptr = 0; cptr < 10; ++cptr)
longString += longString;
-function receiveMessages(event) {
- if (++counter === 1)
- return;
-}
-
function sendContinuouslyMessages(channel)
{
try {
@@ -43,8 +36,6 @@
}
promise_test((test) => {
- counter = 0;
- var gotEvent = false;
return new Promise((resolve, reject) => {
createConnections((localConnection) => {
localChannel = localConnection.createDataChannel('sendDataChannel');
@@ -56,10 +47,6 @@
};
localChannel.bufferedAmountLowThreshold = 200000;
}, (remoteConnection) => {
- remoteConnection.ondatachannel = (event) => {
- remoteChannel = event.channel;
- remoteChannel.onmessage = receiveMessages;
- };
});
setTimeout(() => reject('timed out'), 5000);
}).then (() => {