Browse Source

Added HTMLForm unit tests

Pierre-Olivier Latour 11 years ago
parent
commit
3dc7cb0ec4

+ 2 - 0
Run-Tests.sh

@@ -43,6 +43,8 @@ rm -rf "$ARC_BUILD_DIR"
 xcodebuild -sdk "$OSX_SDK" -target "$OSX_TARGET" -configuration "$CONFIGURATION" build "SYMROOT=$ARC_BUILD_DIR" "CLANG_ENABLE_OBJC_ARC=YES" > /dev/null
 
 # Run tests
+runTests $MRC_PRODUCT "htmlForm" "Tests/HTMLForm"
+runTests $ARC_PRODUCT "htmlForm" "Tests/HTMLForm"
 runTests $MRC_PRODUCT "webServer" "Tests/WebServer"
 runTests $ARC_PRODUCT "webServer" "Tests/WebServer"
 runTests $MRC_PRODUCT "webDAV" "Tests/WebDAV-Transmit"

+ 9 - 0
Tests/HTMLForm/001-200.response

@@ -0,0 +1,9 @@
+HTTP/1.1 200 OK
+Cache-Control: no-cache
+Content-Length: 293
+Content-Type: text/html; charset=utf-8
+Connection: Close
+Server: GCDWebServer
+Date: Fri, 25 Apr 2014 14:12:09 GMT
+
+             <html><body>               <form name="input" action="/" method="post" enctype="application/x-www-form-urlencoded">               Value: <input type="text" name="value">               <input type="submit" value="Submit">               </form>             </body></html>           

+ 10 - 0
Tests/HTMLForm/001-GET.request

@@ -0,0 +1,10 @@
+GET / HTTP/1.1
+Host: localhost:8080
+Connection: keep-alive
+Cache-Control: max-age=0
+Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
+User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36
+DNT: 1
+Accept-Encoding: gzip,deflate,sdch
+Accept-Language: en-US,en;q=0.8,fr;q=0.6
+

+ 9 - 0
Tests/HTMLForm/002-200.response

@@ -0,0 +1,9 @@
+HTTP/1.1 200 OK
+Cache-Control: no-cache
+Content-Length: 47
+Content-Type: text/html; charset=utf-8
+Connection: Close
+Server: GCDWebServer
+Date: Fri, 25 Apr 2014 14:12:20 GMT
+
+<html><body><p>Hellø Wörld!</p></body></html>

+ 15 - 0
Tests/HTMLForm/002-POST.request

@@ -0,0 +1,15 @@
+POST / HTTP/1.1
+Host: localhost:8080
+Connection: keep-alive
+Content-Length: 30
+Cache-Control: max-age=0
+Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
+Origin: http://localhost:8080
+User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36
+Content-Type: application/x-www-form-urlencoded
+DNT: 1
+Referer: http://localhost:8080/
+Accept-Encoding: gzip,deflate,sdch
+Accept-Language: en-US,en;q=0.8,fr;q=0.6
+
+value=Hell%C3%B8+W%C3%B6rld%21