Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
TestWebServer.cpp File Reference
#include <errno.h>
#include <stdlib.h>
#include <gtest/gtest.h>
#include "URL.h"
#include "filesystem/CurlFile.h"
#include "filesystem/File.h"
#include "interfaces/json-rpc/JSONRPC.h"
#include "network/WebServer.h"
#include "network/httprequesthandler/HTTPVfsHandler.h"
#include "network/httprequesthandler/HTTPJsonRpcHandler.h"
#include "settings/MediaSourceSettings.h"
#include "test/TestUtils.h"
#include "utils/JSONVariantParser.h"
#include "utils/StringUtils.h"
#include "utils/URIUtils.h"
#include "utils/Variant.h"
#include <random>

Classes

class  TestWebServer
 

Macros

#define WEBSERVER_HOST   "localhost"
 
#define TEST_URL_JSONRPC   "jsonrpc"
 
#define TEST_FILES_DATA   "test"
 
#define TEST_FILES_DATA_RANGES   "range1;range2;range3"
 
#define TEST_FILES_HTML   TEST_FILES_DATA ".html"
 
#define TEST_FILES_RANGES   TEST_FILES_DATA "-ranges.txt"
 

Functions

 TEST_F (TestWebServer, IsStarted)
 
 TEST_F (TestWebServer, CanGetJsonRpcApiDescriptionWithHttpGet)
 
 TEST_F (TestWebServer, CanReadDataOverJsonRpcWithHttpGet)
 
 TEST_F (TestWebServer, CannotModifyOverJsonRpcWithHttpGet)
 
 TEST_F (TestWebServer, CanReadDataOverJsonRpcWithHttpPost)
 
 TEST_F (TestWebServer, CanModifyOverJsonRpcWithHttpPost)
 
 TEST_F (TestWebServer, CanNotHeadNonExistingFile)
 
 TEST_F (TestWebServer, CanHeadFile)
 
 TEST_F (TestWebServer, CanNotGetNonExistingFile)
 
 TEST_F (TestWebServer, CanGetFile)
 
 TEST_F (TestWebServer, CanGetFileForcingNoCache)
 
 TEST_F (TestWebServer, CanGetCachedFileWithOlderIfModifiedSince)
 
 TEST_F (TestWebServer, CanGetCachedFileWithExactIfModifiedSince)
 
 TEST_F (TestWebServer, CanGetCachedFileWithNewerIfModifiedSince)
 
 TEST_F (TestWebServer, CanGetCachedFileWithNewerIfModifiedSinceForcingNoCache)
 
 TEST_F (TestWebServer, CanGetCachedFileWithOlderIfUnmodifiedSince)
 
 TEST_F (TestWebServer, CanGetCachedFileWithExactIfUnmodifiedSince)
 
 TEST_F (TestWebServer, CanGetCachedFileWithNewerIfUnmodifiedSince)
 
 TEST_F (TestWebServer, CanGetRangedFileRange0_)
 
 TEST_F (TestWebServer, CanGetRangedFileRange0_End)
 
 TEST_F (TestWebServer, CanGetRangedFileRange0_2xEnd)
 
 TEST_F (TestWebServer, CanGetRangedFileRange0_First)
 
 TEST_F (TestWebServer, CanGetRangedFileRangeFirst_Second)
 
 TEST_F (TestWebServer, CanGetRangedFileRange_Last)
 
 TEST_F (TestWebServer, CanGetRangedFileRangeFirstSecond)
 
 TEST_F (TestWebServer, CanGetRangedFileRangeFirstSecondLast)
 
 TEST_F (TestWebServer, CanGetCachedRangedFileWithOlderIfRange)
 
 TEST_F (TestWebServer, CanGetCachedRangedFileWithExactIfRange)
 
 TEST_F (TestWebServer, CanGetCachedRangedFileWithNewerIfRange)
 

Macro Definition Documentation

◆ TEST_FILES_DATA

#define TEST_FILES_DATA   "test"

◆ TEST_FILES_DATA_RANGES

#define TEST_FILES_DATA_RANGES   "range1;range2;range3"

◆ TEST_FILES_HTML

#define TEST_FILES_HTML   TEST_FILES_DATA ".html"

◆ TEST_FILES_RANGES

#define TEST_FILES_RANGES   TEST_FILES_DATA "-ranges.txt"

◆ TEST_URL_JSONRPC

#define TEST_URL_JSONRPC   "jsonrpc"

◆ WEBSERVER_HOST

#define WEBSERVER_HOST   "localhost"

Function Documentation

◆ TEST_F() [1/29]

TEST_F ( TestWebServer ,
CanGetCachedFileWithExactIfModifiedSince  )

◆ TEST_F() [2/29]

TEST_F ( TestWebServer ,
CanGetCachedFileWithExactIfUnmodifiedSince  )

◆ TEST_F() [3/29]

TEST_F ( TestWebServer ,
CanGetCachedFileWithNewerIfModifiedSince  )

◆ TEST_F() [4/29]

TEST_F ( TestWebServer ,
CanGetCachedFileWithNewerIfModifiedSinceForcingNoCache  )

◆ TEST_F() [5/29]

TEST_F ( TestWebServer ,
CanGetCachedFileWithNewerIfUnmodifiedSince  )

◆ TEST_F() [6/29]

TEST_F ( TestWebServer ,
CanGetCachedFileWithOlderIfModifiedSince  )

◆ TEST_F() [7/29]

TEST_F ( TestWebServer ,
CanGetCachedFileWithOlderIfUnmodifiedSince  )

◆ TEST_F() [8/29]

TEST_F ( TestWebServer ,
CanGetCachedRangedFileWithExactIfRange  )

◆ TEST_F() [9/29]

TEST_F ( TestWebServer ,
CanGetCachedRangedFileWithNewerIfRange  )

◆ TEST_F() [10/29]

TEST_F ( TestWebServer ,
CanGetCachedRangedFileWithOlderIfRange  )

◆ TEST_F() [11/29]

TEST_F ( TestWebServer ,
CanGetFile  )

◆ TEST_F() [12/29]

TEST_F ( TestWebServer ,
CanGetFileForcingNoCache  )

◆ TEST_F() [13/29]

TEST_F ( TestWebServer ,
CanGetJsonRpcApiDescriptionWithHttpGet  )

◆ TEST_F() [14/29]

TEST_F ( TestWebServer ,
CanGetRangedFileRange0_  )

◆ TEST_F() [15/29]

TEST_F ( TestWebServer ,
CanGetRangedFileRange0_2xEnd  )

◆ TEST_F() [16/29]

TEST_F ( TestWebServer ,
CanGetRangedFileRange0_End  )

◆ TEST_F() [17/29]

TEST_F ( TestWebServer ,
CanGetRangedFileRange0_First  )

◆ TEST_F() [18/29]

TEST_F ( TestWebServer ,
CanGetRangedFileRange_Last  )

◆ TEST_F() [19/29]

TEST_F ( TestWebServer ,
CanGetRangedFileRangeFirst_Second  )

◆ TEST_F() [20/29]

TEST_F ( TestWebServer ,
CanGetRangedFileRangeFirstSecond  )

◆ TEST_F() [21/29]

TEST_F ( TestWebServer ,
CanGetRangedFileRangeFirstSecondLast  )

◆ TEST_F() [22/29]

TEST_F ( TestWebServer ,
CanHeadFile  )

◆ TEST_F() [23/29]

TEST_F ( TestWebServer ,
CanModifyOverJsonRpcWithHttpPost  )

◆ TEST_F() [24/29]

TEST_F ( TestWebServer ,
CanNotGetNonExistingFile  )

◆ TEST_F() [25/29]

TEST_F ( TestWebServer ,
CanNotHeadNonExistingFile  )

◆ TEST_F() [26/29]

TEST_F ( TestWebServer ,
CannotModifyOverJsonRpcWithHttpGet  )

◆ TEST_F() [27/29]

TEST_F ( TestWebServer ,
CanReadDataOverJsonRpcWithHttpGet  )

◆ TEST_F() [28/29]

TEST_F ( TestWebServer ,
CanReadDataOverJsonRpcWithHttpPost  )

◆ TEST_F() [29/29]

TEST_F ( TestWebServer ,
IsStarted  )