xref: /aosp_15_r20/external/cronet/net/data/websocket/split_packet_check.html (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1<!DOCTYPE html>
2<html>
3<head>
4<title>test ws split packet</title>
5<script type="text/javascript">
6var protocol = location.protocol.replace('http', 'ws');
7var url = protocol + '//' + location.host + '/close-with-split-packet';
8
9// Do connection test.
10var ws = new WebSocket(url);
11
12ws.onopen = function()
13{
14  // Close WebSocket connection once it is established.
15  ws.close();
16}
17
18ws.onclose = function(event)
19{
20  // Check wasClean, then set proper title.
21  if (event.wasClean && event.code === 3004 && event.reason === 'split test')
22    document.title = 'PASS';
23  else
24    document.title = 'FAIL';
25}
26
27</script>
28</head>
29</html>
30