function createTestFunction(expected_message) {
  return function(tab) {
    function onDebuggerEvent(debuggee, method, params) {
      if (debuggee.tabId == tab.id && method == 'Runtime.exceptionThrown') {
        var exception = params.exceptionDetails.exception;
        if (exception.value.indexOf(expected_message) > -1) {
          chrome.debugger.onEvent.removeListener(onDebuggerEvent);
          chrome.test.succeed();
        }
      }
    };
    chrome.debugger.onEvent.addListener(onDebuggerEvent);
    chrome.debugger.attach({ tabId: tab.id }, "1.1", function() {
      // Enabling console provides both stored and new messages via the
      // Console.messageAdded event.
      chrome.debugger.sendCommand({ tabId: tab.id }, "Runtime.enable");
    });
  }
}
// found in the LICENSE file.
found in the LICENSE file.
found in the LICENSE file .
function createTestFunction(expected_message) {
  return function(tab) {
    function onDebuggerEvent(debuggee, method, params) {
      if (debuggee.tabId == tab.id && method == 'Runtime.exceptionThrown') {
        var exception = params.exceptionDetails.exception;
        if (exception.value.indexOf(expected_message) > -1) {
          chrome.debugger.onEvent.removeListener(onDebuggerEvent);
          chrome.test.succeed();
        }
      }
    };
    chrome.debugger.onEvent.addListener(onDebuggerEvent);
    chrome.debugger.attach({ tabId: tab.id }, "1.1", function() {
      chrome.debugger.sendCommand({ tabId: tab.id }, "Runtime.enable");
    });
  }
}
function createTestFunction ( expected_message ) { return function ( tab ) { function onDebuggerEvent ( debuggee , method , params ) { if ( debuggee . tabId == tab . id && method == 'Runtime.exceptionThrown' ) { var exception = params . exceptionDetails . exception ; if ( exception . value . indexOf ( expected_message ) > - 1 ) { chrome . debugger . onEvent . removeListener ( onDebuggerEvent ) ; chrome . test . succeed ( ) ; } } } ; chrome . debugger . onEvent . addListener ( onDebuggerEvent ) ; chrome . debugger . attach ( { tabId : tab . id } , "1.1" , function ( ) { chrome . debugger . sendCommand ( { tabId : tab . id } , "Runtime.enable" ) ; } ) ; } }
found in the LICENSE file.
found in the LICENSE file .
// Enabling console provides both stored and new messages via the // Console.messageAdded event.