function handshakeRequestCancelled() {
      var url = getWSTestURL(testWebSocketPort);
      expect(
        [  // events
          { label: 'onBeforeRequest',
            event: 'onBeforeRequest',
            details: {
              url: url,
              type: 'websocket',
              frameUrl: 'unknown frame URL',
              initiator: getDomain(initiators.WEB_INITIATED)
            },
            retval: {cancel: true}
          },
          // Cancelling is considered an error.
          { label: 'onErrorOccurred',
            event: 'onErrorOccurred',
            details: {
              url: url,
              type: 'websocket',
              fromCache: false,
              initiator: getDomain(initiators.WEB_INITIATED),
              error: 'net::ERR_BLOCKED_BY_CLIENT'
            }
          },
        ],
        [  // event order
          ['onBeforeRequest', 'onErrorOccurred']
        ],
        {urls: ['<all_urls>']},  // filter
        ['blocking']  // extraInfoSpec
      );
      testWebSocketConnection(url, false /* expectedToConnect*/);
    }
// cancels the request. The connection will not be established.
cancels the request. The connection will not be established.
cancels the request . The connection will not be established .
function handshakeRequestCancelled() {
      var url = getWSTestURL(testWebSocketPort);
      expect(
        [  
          { label: 'onBeforeRequest',
            event: 'onBeforeRequest',
            details: {
              url: url,
              type: 'websocket',
              frameUrl: 'unknown frame URL',
              initiator: getDomain(initiators.WEB_INITIATED)
            },
            retval: {cancel: true}
          },
          { label: 'onErrorOccurred',
            event: 'onErrorOccurred',
            details: {
              url: url,
              type: 'websocket',
              fromCache: false,
              initiator: getDomain(initiators.WEB_INITIATED),
              error: 'net::ERR_BLOCKED_BY_CLIENT'
            }
          },
        ],
        [  
          ['onBeforeRequest', 'onErrorOccurred']
        ],
        {urls: ['<all_urls>']},  
        ['blocking']  
      );
      testWebSocketConnection(url, false );
    }
function handshakeRequestCancelled ( ) { var url = getWSTestURL ( testWebSocketPort ) ; expect ( [ { label : 'onBeforeRequest' , event : 'onBeforeRequest' , details : { url : url , type : 'websocket' , frameUrl : 'unknown frame URL' , initiator : getDomain ( initiators . WEB_INITIATED ) } , retval : { cancel : true } } , { label : 'onErrorOccurred' , event : 'onErrorOccurred' , details : { url : url , type : 'websocket' , fromCache : false , initiator : getDomain ( initiators . WEB_INITIATED ) , error : 'net::ERR_BLOCKED_BY_CLIENT' } } , ] , [ [ 'onBeforeRequest' , 'onErrorOccurred' ] ] , { urls : [ '<all_urls>' ] } , [ 'blocking' ] ) ; testWebSocketConnection ( url , false ) ; }
cancels the request.
cancels the request .
// events // Cancelling is considered an error. // event order // filter // extraInfoSpec /* expectedToConnect*/