function beforeTests(callback) {
  assertTrue(!!chrome.enterprise, "No enterprise namespace.");
  assertTrue(!!chrome.enterprise.platformKeys, "No platformKeys namespace.");
  assertTrue(!!chrome.enterprise.platformKeys.getTokens,
             "No getTokens function.");
  assertTrue(!!chrome.enterprise.platformKeys.importCertificate,
             "No importCertificate function.");
  assertTrue(!!chrome.enterprise.platformKeys.removeCertificate,
             "No removeCertificate function.");

  getTokens(function(userToken, systemToken) {
    if (!userToken)
      fail('no user token');
    assertEq('user', userToken.id);

    if (systemTokenEnabled) {
      if (!systemToken)
        fail('no system token');
      assertEq('system', systemToken.id);
    } else {
      assertEq(null,
               systemToken,
               'system token is disabled, but found the token nonetheless.');
    }

    callback(userToken, systemToken);
  });
}
/**
 * Runs preparations before the actual tests. Calls |callback| with |userToken|.
 */
Runs preparations before the actual tests. Calls |callback| with |userToken|.
Runs preparations before the actual tests . Calls |callback| with |userToken| .
function beforeTests(callback) {
  assertTrue(!!chrome.enterprise, "No enterprise namespace.");
  assertTrue(!!chrome.enterprise.platformKeys, "No platformKeys namespace.");
  assertTrue(!!chrome.enterprise.platformKeys.getTokens,
             "No getTokens function.");
  assertTrue(!!chrome.enterprise.platformKeys.importCertificate,
             "No importCertificate function.");
  assertTrue(!!chrome.enterprise.platformKeys.removeCertificate,
             "No removeCertificate function.");
  getTokens(function(userToken, systemToken) {
    if (!userToken)
      fail('no user token');
    assertEq('user', userToken.id);
    if (systemTokenEnabled) {
      if (!systemToken)
        fail('no system token');
      assertEq('system', systemToken.id);
    } else {
      assertEq(null,
               systemToken,
               'system token is disabled, but found the token nonetheless.');
    }
    callback(userToken, systemToken);
  });
}
function beforeTests ( callback ) { assertTrue ( ! ! chrome . enterprise , "No enterprise namespace." ) ; assertTrue ( ! ! chrome . enterprise . platformKeys , "No platformKeys namespace." ) ; assertTrue ( ! ! chrome . enterprise . platformKeys . getTokens , "No getTokens function." ) ; assertTrue ( ! ! chrome . enterprise . platformKeys . importCertificate , "No importCertificate function." ) ; assertTrue ( ! ! chrome . enterprise . platformKeys . removeCertificate , "No removeCertificate function." ) ; getTokens ( function ( userToken , systemToken ) { if ( ! userToken ) fail ( 'no user token' ) ; assertEq ( 'user' , userToken . id ) ; if ( systemTokenEnabled ) { if ( ! systemToken ) fail ( 'no system token' ) ; assertEq ( 'system' , systemToken . id ) ; } else { assertEq ( null , systemToken , 'system token is disabled, but found the token nonetheless.' ) ; } callback ( userToken , systemToken ) ; } ) ; }
Runs preparations before the actual tests.
Runs preparations before the actual tests .