axmol/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/HttpClientTest.h

36 lines
1.0 KiB
C
Raw Normal View History

#ifndef __HTTP_CLIENT_H__
#define __HTTP_CLIENT_H__
#include "cocos2d.h"
#include "extensions/cocos-ext.h"
#include "network/HttpClient.h"
#include "BaseTest.h"
DEFINE_TEST_SUITE(HttpClientTests);
class HttpClientTest : public TestCase
{
public:
CREATE_FUNC(HttpClientTest);
HttpClientTest();
virtual ~HttpClientTest();
//Menu Callbacks
2014-06-22 00:11:20 +08:00
void onMenuGetTestClicked(cocos2d::Ref *sender, bool isImmediate);
void onMenuPostTestClicked(cocos2d::Ref *sender, bool isImmediate);
void onMenuPostBinaryTestClicked(cocos2d::Ref *sender, bool isImmediate);
void onMenuPutTestClicked(cocos2d::Ref *sender, bool isImmediate);
void onMenuDeleteTestClicked(cocos2d::Ref *sender, bool isImmediate);
//Http Response Callback
2014-01-02 16:25:35 +08:00
void onHttpRequestCompleted(cocos2d::network::HttpClient *sender, cocos2d::network::HttpResponse *response);
virtual std::string title() const override { return "Http Request Test"; }
private:
cocos2d::Label* _labelStatusCode;
};
#endif //__HTTPREQUESTHTTP_H