function runTest(otherWindow) {
  chrome.test.runWithUserGesture(function() {
    chrome.permissions.request({permissions: ['alarms']}, function(granted) {
      chrome.test.assertTrue(granted);
      // Assert that the bindings have been updated on ourselves the background
      // page, and the tab that was created.
      var expectedAlarmsKeys = [
          'clear', 'clearAll', 'create', 'get', 'getAll', 'onAlarm'];
      [window, otherWindow].forEach(function(w) {
        chrome.test.assertEq(expectedAlarmsKeys,
                             Object.keys(w.chrome.alarms).sort());
      });
      chrome.test.succeed();
    });
  });
}
// |otherWindow| is its window object.
|otherWindow| is its window object.
|otherWindow| is its window object .
function runTest(otherWindow) {
  chrome.test.runWithUserGesture(function() {
    chrome.permissions.request({permissions: ['alarms']}, function(granted) {
      chrome.test.assertTrue(granted);
      var expectedAlarmsKeys = [
          'clear', 'clearAll', 'create', 'get', 'getAll', 'onAlarm'];
      [window, otherWindow].forEach(function(w) {
        chrome.test.assertEq(expectedAlarmsKeys,
                             Object.keys(w.chrome.alarms).sort());
      });
      chrome.test.succeed();
    });
  });
}
function runTest ( otherWindow ) { chrome . test . runWithUserGesture ( function ( ) { chrome . permissions . request ( { permissions : [ 'alarms' ] } , function ( granted ) { chrome . test . assertTrue ( granted ) ; var expectedAlarmsKeys = [ 'clear' , 'clearAll' , 'create' , 'get' , 'getAll' , 'onAlarm' ] ; [ window , otherWindow ] . forEach ( function ( w ) { chrome . test . assertEq ( expectedAlarmsKeys , Object . keys ( w . chrome . alarms ) . sort ( ) ) ; } ) ; chrome . test . succeed ( ) ; } ) ; } ) ; }
|otherWindow| is its window object.
|otherWindow| is its window object .
// Assert that the bindings have been updated on ourselves the background // page, and the tab that was created.