function testSendMessage() {
    chrome.test.listenOnce(chrome.runtime.onMessage,
        function(msg, sender, sendResponse) {
          chrome.test.assertEq('First from interstitial', msg);

          var kResponse = 'hello me!';
          chrome.test.listenOnce(chrome.runtime.onMessage, function(msg) {
            chrome.test.assertEq('interstitial received: ' + kResponse, msg);
          });
          sendResponse(kResponse);
        });
    sendToInterstitialAndWait('testSendMessage');
  }
// Tests whether ping-ponging with sendMessage works.
Tests whether ping-ponging with sendMessage works.
Tests whether ping - ponging with sendMessage works .
function testSendMessage() {
    chrome.test.listenOnce(chrome.runtime.onMessage,
        function(msg, sender, sendResponse) {
          chrome.test.assertEq('First from interstitial', msg);
          var kResponse = 'hello me!';
          chrome.test.listenOnce(chrome.runtime.onMessage, function(msg) {
            chrome.test.assertEq('interstitial received: ' + kResponse, msg);
          });
          sendResponse(kResponse);
        });
    sendToInterstitialAndWait('testSendMessage');
  }
function testSendMessage ( ) { chrome . test . listenOnce ( chrome . runtime . onMessage , function ( msg , sender , sendResponse ) { chrome . test . assertEq ( 'First from interstitial' , msg ) ; var kResponse = 'hello me!' ; chrome . test . listenOnce ( chrome . runtime . onMessage , function ( msg ) { chrome . test . assertEq ( 'interstitial received: ' + kResponse , msg ) ; } ) ; sendResponse ( kResponse ) ; } ) ; sendToInterstitialAndWait ( 'testSendMessage' ) ; }
Tests whether ping-ponging with sendMessage works.
Tests whether ping - ponging with sendMessage works .