B2G/gecko/browser/components/sessionstore/test/browser_480148.js
// builds the tests state based on a few parameters
builds the tests state based on a few parameters
builds the tests state based on a few parameters
function buildTestState(num, selected, hidden, pinned) {
    let state = { windows: [ { "tabs": [], "selected": selected + 1 } ] };
    while (num--) {
      state.windows[0].tabs.push({
        entries: [
          { url: "http://example.com/?t=" + state.windows[0].tabs.length }
        ]
      });
      let i = state.windows[0].tabs.length - 1;
      if (hidden.length > 0 && i == hidden[0]) {
        state.windows[0].tabs[i].hidden = true;
        hidden.splice(0, 1);
      }
      if (pinned.length > 0 && i == pinned[0]) {
        state.windows[0].tabs[i].pinned = true;
        pinned.splice(0, 1);
      }
    }
    return state;
  }
function buildTestState ( num , selected , hidden , pinned ) { let state = { windows : [ { "tabs" : [ ] , "selected" : selected + 1 } ] } ; while ( num -- ) { state . windows [ 0 ] . tabs . push ( { entries : [ { url : "http://example.com/?t=" + state . windows [ 0 ] . tabs . length } ] } ) ; let i = state . windows [ 0 ] . tabs . length - 1 ; if ( hidden . length > 0 && i == hidden [ 0 ] ) { state . windows [ 0 ] . tabs [ i ] . hidden = true ; hidden . splice ( 0 , 1 ) ; } if ( pinned . length > 0 && i == pinned [ 0 ] ) { state . windows [ 0 ] . tabs [ i ] . pinned = true ; pinned . splice ( 0 , 1 ) ; } } return state ; }
builds the tests state based on a few parameters
builds the tests state based on a few parameters