    if (testCase === 'send') {
        if (typeof event.data === 'string') {
          result.push({ type: 'text', data: event.data });
        }
        // default value of connection.binaryType is "arraybuffer"
        else if(event.data instanceof ArrayBuffer) {
          result.push({ type: 'binary', data: toText(event.data) });
          if (compare(event.data, message5)) {
            stash.send(JSON.stringify(result));
          }
        }
        else {
          result.push({ type: 'error' });
   