def _AuthFacebookOrGoogleUser(tester, action, user_dict, ident_dict, device_dict, user_cookie):
 if (device_dict is None):
  url = tester.GetUrl(('/%s/%s' % (action, ident_dict['authority'].lower())))
  response = _SendAuthRequest(tester, url, 'GET', user_cookie=user_cookie)
  assert (response.code == 302), response.code
  url = tester.GetUrl(('/%s/%s?code=code' % (action, ident_dict['authority'].lower())))
  response = _SendAuthRequest(tester, url, 'GET', user_cookie=user_cookie)
  assert (response.code == 302), response.code
  assert response.headers['location'].startswith('/view')
 else:
  if (ident_dict['authority'] == 'Facebook'):
   url = tester.GetUrl(('/%s/facebook?access_token=access_token' % action))
  else:
   url = tester.GetUrl(('/%s/google?refresh_token=refresh_token' % action))
  request_dict = _CreateRegisterRequest(device_dict)
  response = _SendAuthRequest(tester, url, 'POST', user_cookie=user_cookie, request_dict=request_dict)
 return response

def _AuthFacebookOrGoogleUser ( tester , action , user_dict , ident_dict , device_dict , user_cookie ) : if ( device_dict is None ) : url = tester . GetUrl ( ( '/%s/%s' % ( action , ident_dict [ 'authority' ] . lower ( ) ) ) ) response = _SendAuthRequest ( tester , url , 'GET' , user_cookie = user_cookie ) assert ( response . code == 302 ) , response . code url = tester . GetUrl ( ( '/%s/%s?code=code' % ( action , ident_dict [ 'authority' ] . lower ( ) ) ) ) response = _SendAuthRequest ( tester , url , 'GET' , user_cookie = user_cookie ) assert ( response . code == 302 ) , response . code assert response . headers [ 'location' ] . startswith ( '/view' ) else : if ( ident_dict [ 'authority' ] == 'Facebook' ) : url = tester . GetUrl ( ( '/%s/facebook?access_token=access_token' % action ) ) else : url = tester . GetUrl ( ( '/%s/google?refresh_token=refresh_token' % action ) ) request_dict = _CreateRegisterRequest ( device_dict ) response = _SendAuthRequest ( tester , url , 'POST' , user_cookie = user_cookie , request_dict = request_dict ) return response
registers a user .