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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/webrtc/datachannel-emptystring.html

Issue 2610243002: Import wpt@5e1a3b80cea8d36774d2afd78b29a74792e9f15a (Closed)
Patch Set: Rebased Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <!-- 2 <!--
3 This test creates a data channel between two local PeerConnection instances 3 This test creates a data channel between two local PeerConnection instances
4 and ensures that an empty string sent by one is received by the second. 4 and ensures that an empty string sent by one is received by the second.
5 --> 5 -->
6 6
7 <html> 7 <html>
8 <head> 8 <head>
9 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 9 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
10 <title>RTCPeerConnection Data Channel Empty String Test</title> 10 <title>RTCPeerConnection Data Channel Empty String Test</title>
(...skipping 15 matching lines...) Expand all
26 var receiveChannel = null; 26 var receiveChannel = null;
27 27
28 var onReceiveChannel = function (event) { 28 var onReceiveChannel = function (event) {
29 receiveChannel = event.channel; 29 receiveChannel = event.channel;
30 receiveChannel.onmessage = onReceiveMessage; 30 receiveChannel.onmessage = onReceiveMessage;
31 }; 31 };
32 32
33 33
34 // When the data channel is open, send an empty string message 34 // When the data channel is open, send an empty string message
35 // followed by a message that contains the string "done". 35 // followed by a message that contains the string "done".
36 var onSendChannelOpen = function (event) { 36 var onSendChannelOpen = test.step_func(function (event) {
37 var msgEl = document.getElementById('msg'); 37 var msgEl = document.getElementById('msg');
38 sendChannel.send(''); 38 sendChannel.send('');
39 msgEl.innerHTML += 'Sent: [empty string]<br>'; 39 msgEl.innerHTML += 'Sent: [empty string]<br>';
40 sendChannel.send('done'); 40 sendChannel.send('done');
41 msgEl.innerHTML += 'Sent: "done"<br>'; 41 msgEl.innerHTML += 'Sent: "done"<br>';
42 }; 42 });
43 43
44 // Check the messages received on the other side. 44 // Check the messages received on the other side.
45 // There should be an empty string message followed by a message that 45 // There should be an empty string message followed by a message that
46 // contains the string "done". 46 // contains the string "done".
47 // Pass/Fail the test according to the messages received 47 // Pass/Fail the test according to the messages received
48 var emptyMessageReceived = false; 48 var emptyMessageReceived = false;
49 var onReceiveMessage = test.step_func(function (event) { 49 var onReceiveMessage = test.step_func(function (event) {
50 var msgEl = document.getElementById('msg'); 50 var msgEl = document.getElementById('msg');
51 msgEl.innerHTML += 'Received: ' + 51 msgEl.innerHTML += 'Received: ' +
52 (event.data ? '"' + event.data + '"' : '[empty string]') + '<br>'; 52 (event.data ? '"' + event.data + '"' : '[empty string]') + '<br>';
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 .then(exchangeDescription(gFirstConnection, gSecondConnection)) 99 .then(exchangeDescription(gFirstConnection, gSecondConnection))
100 .catch(test.step_func(function(e) { 100 .catch(test.step_func(function(e) {
101 assert_unreached('Error ' + e.name + ': ' + e.message); 101 assert_unreached('Error ' + e.name + ': ' + e.message);
102 })); 102 }));
103 }); 103 });
104 </script> 104 </script>
105 105
106 </body> 106 </body>
107 </html> 107 </html>
108 108
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698