1 /* 2 * Copyright 2014-2020 Haiku, inc. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef HTTP_TEST_H 6 #define HTTP_TEST_H 7 8 9 #include <Url.h> 10 11 #include <TestCase.h> 12 #include <TestSuite.h> 13 14 #include <cppunit/TestSuite.h> 15 #include <tools/cppunit/ThreadedTestCase.h> 16 17 #include "TestServer.h" 18 19 20 class HttpTest: public BThreadedTestCase { 21 public: 22 HttpTest(TestServerMode mode = TEST_SERVER_MODE_HTTP); 23 virtual ~HttpTest(); 24 25 virtual void setUp(); 26 27 void GetTest(); 28 void HeadTest(); 29 void NoContentTest(); 30 void UploadTest(); 31 void AuthBasicTest(); 32 void AuthDigestTest(); 33 void ProxyTest(); 34 void AutoRedirectTest(); 35 36 static void AddTests(BTestSuite& suite); 37 38 private: 39 void _GetTest(const BString& path); 40 private: 41 TestServer fTestServer; 42 }; 43 44 45 class HttpsTest: public HttpTest { 46 public: 47 HttpsTest(); 48 }; 49 50 51 #endif 52