1 <!-- Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ -->
6 <meta charset=
"utf-8"/>
7 <meta http-equiv=
"Cache-Control" content=
"no-cache, no-store, must-revalidate" />
8 <meta http-equiv=
"Pragma" content=
"no-cache" />
9 <meta http-equiv=
"Expires" content=
"0" />
10 <title>WebSocket Inspection Test Page
</title>
13 <h1>WebSocket Inspection Test Page
</h1>
14 <script type=
"text/javascript">
15 /* exported openConnection, closeConnection, sendData, sendFrames */
19 function openConnection(numFramesToSend
) {
20 return new Promise(resolve
=> {
22 "ws://mochi.test:8888/browser/devtools/client/netmonitor/test/file_ws_backend");
25 for (let i
= 0; i
< numFramesToSend
; i
++) {
26 ws
.send("Payload " + i
);
33 function sendFrames(numFramesToSend
) {
34 return new Promise(resolve
=> {
35 for (let i
= 0; i
< numFramesToSend
; i
++) {
36 ws
.send("Payload " + i
);
42 function closeConnection() {
43 return new Promise(resolve
=> {
51 function sendData(payload
, asBinary
= false) {
53 asBinary
? Uint8Array
.from(payload
, c
=> c
.charCodeAt(0)) : payload