Apple is granted Calif. permit to test autonomous vehicles