Fixing macro header bug (#207)
This commit is contained in:
Родитель
c26636f340
Коммит
6773495807
|
@ -3,9 +3,10 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "pch_common.h"
|
||||
|
||||
#ifdef XSAPI_CPP
|
||||
#undef XSAPI_CPP
|
||||
#endif
|
||||
#define XSAPI_CPP 1
|
||||
|
||||
#include "pch_common.h"
|
||||
|
||||
|
|
|
@ -38,6 +38,62 @@ MockHttpCall::get_response(
|
|||
return pplx::task_from_result(ResultValue);
|
||||
}
|
||||
|
||||
#if TV_API | XBOX_UWP
|
||||
|
||||
/// <summary>
|
||||
/// Attach the Xbox Live token, sign the request, send the request to the service, and return the response.
|
||||
/// </summary>
|
||||
pplx::task<std::shared_ptr<http_call_response>>
|
||||
MockHttpCall::get_response_with_auth(
|
||||
_In_ Windows::Xbox::System::User^ user,
|
||||
_In_ http_call_response_body_type httpCallResponseBodyType,
|
||||
_In_ bool allUsersAuthRequired
|
||||
)
|
||||
{
|
||||
if (FAILED(ResultHR))
|
||||
{
|
||||
throw ResultHR;
|
||||
}
|
||||
CallCounter++;
|
||||
return pplx::task_from_result(ResultValue);
|
||||
}
|
||||
|
||||
#elif UNIT_TEST_SERVICES || !XSAPI_CPP
|
||||
|
||||
pplx::task<std::shared_ptr<http_call_response>>
|
||||
MockHttpCall::get_response_with_auth(
|
||||
_In_ Microsoft::Xbox::Services::System::XboxLiveUser^ user,
|
||||
_In_ http_call_response_body_type httpCallResponseBodyType,
|
||||
_In_ bool allUsersAuthRequired
|
||||
)
|
||||
{
|
||||
if (FAILED(ResultHR))
|
||||
{
|
||||
throw ResultHR;
|
||||
}
|
||||
CallCounter++;
|
||||
return pplx::task_from_result(ResultValue);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
pplx::task<std::shared_ptr<http_call_response>> get_response_with_auth(
|
||||
_In_ std::shared_ptr<xbox::services::system::xbox_live_user> user,
|
||||
_In_ http_call_response_body_type httpCallResponseBodyType,
|
||||
_In_ bool allUsersAuthRequired
|
||||
)
|
||||
{
|
||||
if (FAILED(ResultHR))
|
||||
{
|
||||
throw ResultHR;
|
||||
}
|
||||
CallCounter++;
|
||||
return pplx::task_from_result(ResultValue);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
pplx::task<std::shared_ptr<http_call_response>>
|
||||
MockHttpCall::get_response(
|
||||
_In_ http_call_response_body_type httpCallResponseBodyType,
|
||||
|
|
|
@ -15,6 +15,41 @@ public:
|
|||
_In_ http_call_response_body_type httpCallResponseBodyType
|
||||
) override;
|
||||
|
||||
#if TV_API | XBOX_UWP
|
||||
|
||||
/// <summary>
|
||||
/// Attach the Xbox Live token, sign the request, send the request to the service, and return the response.
|
||||
/// </summary>
|
||||
virtual pplx::task<std::shared_ptr<http_call_response>> get_response_with_auth(
|
||||
_In_ Windows::Xbox::System::User^ user,
|
||||
_In_ http_call_response_body_type httpCallResponseBodyType = http_call_response_body_type::json_body,
|
||||
_In_ bool allUsersAuthRequired = false
|
||||
) override;
|
||||
|
||||
#elif UNIT_TEST_SERVICES || !XSAPI_CPP
|
||||
|
||||
/// <summary>
|
||||
/// Attach the Xbox Live token, sign the request, send the request to the service, and return the response.
|
||||
/// </summary>
|
||||
virtual pplx::task<std::shared_ptr<http_call_response>> get_response_with_auth(
|
||||
_In_ Microsoft::Xbox::Services::System::XboxLiveUser^ user,
|
||||
_In_ http_call_response_body_type httpCallResponseBodyType = http_call_response_body_type::json_body,
|
||||
_In_ bool allUsersAuthRequired = false
|
||||
) override;
|
||||
|
||||
#else
|
||||
|
||||
/// <summary>
|
||||
/// Attach the Xbox Live token, sign the request, send the request to the service, and return the response.
|
||||
/// </summary>
|
||||
virtual pplx::task<std::shared_ptr<http_call_response>> get_response_with_auth(
|
||||
_In_ std::shared_ptr<xbox::services::system::xbox_live_user> user,
|
||||
_In_ http_call_response_body_type httpCallResponseBodyType = http_call_response_body_type::json_body,
|
||||
_In_ bool allUsersAuthRequired = false
|
||||
) override;
|
||||
|
||||
#endif
|
||||
|
||||
virtual pplx::task< std::shared_ptr<http_call_response> > get_response(
|
||||
_In_ http_call_response_body_type httpCallResponseBodyType,
|
||||
_In_ const web::http::http_request& httpRequest
|
||||
|
|
Загрузка…
Ссылка в новой задаче