httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r1783308 - /httpd/test/framework/trunk/t/modules/brotli.t
Date Thu, 16 Feb 2017 21:37:09 GMT
Author: wrowe
Date: Thu Feb 16 21:37:09 2017
New Revision: 1783308

URL: http://svn.apache.org/viewvc?rev=1783308&view=rev
Log:
Test prioritaztion of brotls+deflate

Modified:
    httpd/test/framework/trunk/t/modules/brotli.t

Modified: httpd/test/framework/trunk/t/modules/brotli.t
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/modules/brotli.t?rev=1783308&r1=1783307&r2=1783308&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/modules/brotli.t (original)
+++ httpd/test/framework/trunk/t/modules/brotli.t Thu Feb 16 21:37:09 2017
@@ -5,7 +5,7 @@ use Apache::Test;
 use Apache::TestUtil;
 use Apache::TestRequest;
 
-plan tests => 8, need_module 'brotli', need_module 'alias';
+plan tests => 10, need_module 'brotli', need_module 'alias';
 
 my $r;
 
@@ -51,7 +51,7 @@ if (!defined($r->header("ETag"))) {
 if (have_module('deflate')) {
     # GET request against the location with fallback to deflate (test that
     # Brotli is chosen due to the order in SetOutputFilter).
-    $r = GET("/brotli_and_deflate/apache_pb.gif", "Accept-Encoding" => "deflate, br");
+    $r = GET("/brotli_and_deflate/apache_pb.gif", "Accept-Encoding" => "gzip,br");
     ok t_cmp($r->code, 200);
     ok t_cmp($r->header("Content-Encoding"), "br", "response Content-Encoding is OK");
     if (!defined($r->header("Content-Length"))) {
@@ -62,6 +62,17 @@ if (have_module('deflate')) {
         t_debug "ETag field was expected";
         ok 0;
     }
+    $r = GET("/brotli_and_deflate/apache_pb.gif", "Accept-Encoding" => "gzip");
+    ok t_cmp($r->code, 200);
+    ok t_cmp($r->header("Content-Encoding"), "gzip", "response Content-Encoding is OK");
+    if (!defined($r->header("Content-Length"))) {
+        t_debug "Content-Length was expected";
+        ok 0;
+    }
+    if (!defined($r->header("ETag"))) {
+        t_debug "ETag field was expected";
+        ok 0;
+    }
 } else {
-    skip "skipping tests without mod_deflate" foreach (1..2);
+    skip "skipping tests without mod_deflate" foreach (1..4);
 }



Mime
View raw message