function test() {
  var testWindowId = null;

  chrome.windows.create({url: 'page.html'}, function(w) {
    testWindowId = w.id;
    chrome.windows.remove(w.id);
  });

  // Regression test for http://crbug.com/436593 (dotted api names).
  chrome.system.storage.onAttached.addListener(function () {
  });

  chrome.windows.onRemoved.addListener(function listener(windowId) {
    if (windowId != testWindowId)
      return;  // I guess some other window might have closed?

    // If the event hasn't been overridden there should be a listener.
    chrome.test.assertTrue(chrome.windows.onRemoved.hasListeners());

    // This used to crash since we try to register the event more than once.
    chrome.windows.onRemoved.removeListener(listener);
    chrome.windows.onRemoved.addListener(listener);

    // Regression test for http://crbug.com/436593 (dotted api names).
    chrome.system.storage.onAttached.addListener(function () {
    })
    chrome.test.succeed();
  });
}
// found in the LICENSE file.
found in the LICENSE file.
found in the LICENSE file .
function test() {
  var testWindowId = null;
  chrome.windows.create({url: 'page.html'}, function(w) {
    testWindowId = w.id;
    chrome.windows.remove(w.id);
  });
  chrome.system.storage.onAttached.addListener(function () {
  });
  chrome.windows.onRemoved.addListener(function listener(windowId) {
    if (windowId != testWindowId)
      return;  
    chrome.test.assertTrue(chrome.windows.onRemoved.hasListeners());
    chrome.windows.onRemoved.removeListener(listener);
    chrome.windows.onRemoved.addListener(listener);
    chrome.system.storage.onAttached.addListener(function () {
    })
    chrome.test.succeed();
  });
}
function test ( ) { var testWindowId = null ; chrome . windows . create ( { url : 'page.html' } , function ( w ) { testWindowId = w . id ; chrome . windows . remove ( w . id ) ; } ) ; chrome . system . storage . onAttached . addListener ( function ( ) { } ) ; chrome . windows . onRemoved . addListener ( function listener ( windowId ) { if ( windowId != testWindowId ) return ; chrome . test . assertTrue ( chrome . windows . onRemoved . hasListeners ( ) ) ; chrome . windows . onRemoved . removeListener ( listener ) ; chrome . windows . onRemoved . addListener ( listener ) ; chrome . system . storage . onAttached . addListener ( function ( ) { } ) chrome . test . succeed ( ) ; } ) ; }
found in the LICENSE file.
found in the LICENSE file .
// Regression test for http://crbug.com/436593 (dotted api names). // I guess some other window might have closed? // If the event hasn't been overridden there should be a listener. // This used to crash since we try to register the event more than once. // Regression test for http://crbug.com/436593 (dotted api names).