function tabNested() {
      // Setup our listeners. We check that the events fire in order.
      var eventCounter = 0;
      chrome.test.listenOnce(chrome.tabs.onCreated, function(tab) {
        assertEq(1, ++eventCounter);
        assertEq(incognitoTab.windowId, tab.windowId);
        assertTrue(tab.incognito);
      });
      chrome.test.listenOnce(chrome.tabs.onMoved, function(tabId) {
        assertEq(2, ++eventCounter);
      });
      chrome.test.listenOnce(chrome.tabs.onRemoved, function(tabId) {
        assertEq(3, ++eventCounter);
      });

      // Create, select, move, and close a tab in our incognito window.
      chrome.tabs.create({windowId: incognitoTab.windowId},
        pass(function(tab) {
          chrome.tabs.move(tab.id, {index: 0},
            pass(function(tab) {
              assertEq(incognitoTab.incognito, tab.incognito);
              chrome.tabs.remove(tab.id, pass());
            }));
        }));
    }
// Tests a sequence of tab API calls.
Tests a sequence of tab API calls.
Tests a sequence of tab API calls .
function tabNested() {
      var eventCounter = 0;
      chrome.test.listenOnce(chrome.tabs.onCreated, function(tab) {
        assertEq(1, ++eventCounter);
        assertEq(incognitoTab.windowId, tab.windowId);
        assertTrue(tab.incognito);
      });
      chrome.test.listenOnce(chrome.tabs.onMoved, function(tabId) {
        assertEq(2, ++eventCounter);
      });
      chrome.test.listenOnce(chrome.tabs.onRemoved, function(tabId) {
        assertEq(3, ++eventCounter);
      });
      chrome.tabs.create({windowId: incognitoTab.windowId},
        pass(function(tab) {
          chrome.tabs.move(tab.id, {index: 0},
            pass(function(tab) {
              assertEq(incognitoTab.incognito, tab.incognito);
              chrome.tabs.remove(tab.id, pass());
            }));
        }));
    }
function tabNested ( ) { var eventCounter = 0 ; chrome . test . listenOnce ( chrome . tabs . onCreated , function ( tab ) { assertEq ( 1 , ++ eventCounter ) ; assertEq ( incognitoTab . windowId , tab . windowId ) ; assertTrue ( tab . incognito ) ; } ) ; chrome . test . listenOnce ( chrome . tabs . onMoved , function ( tabId ) { assertEq ( 2 , ++ eventCounter ) ; } ) ; chrome . test . listenOnce ( chrome . tabs . onRemoved , function ( tabId ) { assertEq ( 3 , ++ eventCounter ) ; } ) ; chrome . tabs . create ( { windowId : incognitoTab . windowId } , pass ( function ( tab ) { chrome . tabs . move ( tab . id , { index : 0 } , pass ( function ( tab ) { assertEq ( incognitoTab . incognito , tab . incognito ) ; chrome . tabs . remove ( tab . id , pass ( ) ) ; } ) ) ; } ) ) ; }
Tests a sequence of tab API calls.
Tests a sequence of tab API calls .
// Setup our listeners. We check that the events fire in order. // Create, select, move, and close a tab in our incognito window.