aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/clientserver_test.go
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@golang.org>2015-12-09 22:02:46 +0000
committerBrad Fitzpatrick <bradfitz@golang.org>2015-12-10 04:43:08 +0000
commitc2ef005486fa05cbeddc74c7faac8f6a867703d4 (patch)
treec96bea2c128d9f61b8e359ab3fed1ccc14eca59b /src/net/http/clientserver_test.go
parent07f9c25b357d2eb1305e5016a967df1b00d345bd (diff)
downloadgo-c2ef005486fa05cbeddc74c7faac8f6a867703d4.tar.xz
net/http: run more tests in http2 mode
Failing ones are marked skipped. Fixes #13543 (was just a test issue) Updates #13555 (to be fixed later) Updates #13556 (to be fixed later) Updates #13557 (to be fixed later) Fixes bug in golang.org/cl/17428 (http1 now uses HTTP status 431, not 413) Change-Id: I8f7431fee35f2fc081cfe2c232ae75a00800a60b Reviewed-on: https://go-review.googlesource.com/17683 Reviewed-by: Blake Mizerany <blake.mizerany@gmail.com> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Reviewed-by: Burcu Dogan <jbd@google.com> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/net/http/clientserver_test.go')
-rw-r--r--src/net/http/clientserver_test.go15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/net/http/clientserver_test.go b/src/net/http/clientserver_test.go
index 29afe48833..9dae83d6c6 100644
--- a/src/net/http/clientserver_test.go
+++ b/src/net/http/clientserver_test.go
@@ -37,6 +37,11 @@ func (t *clientServerTest) close() {
t.ts.Close()
}
+const (
+ h1Mode = false
+ h2Mode = true
+)
+
func newClientServerTest(t *testing.T, h2 bool, h Handler) *clientServerTest {
cst := &clientServerTest{
t: t,
@@ -87,8 +92,8 @@ func TestNewClientServerTest(t *testing.T) {
}
}
-func TestChunkedResponseHeaders_h1(t *testing.T) { testChunkedResponseHeaders(t, false) }
-func TestChunkedResponseHeaders_h2(t *testing.T) { testChunkedResponseHeaders(t, true) }
+func TestChunkedResponseHeaders_h1(t *testing.T) { testChunkedResponseHeaders(t, h1Mode) }
+func TestChunkedResponseHeaders_h2(t *testing.T) { testChunkedResponseHeaders(t, h2Mode) }
func testChunkedResponseHeaders(t *testing.T, h2 bool) {
defer afterTest(t)
@@ -354,8 +359,6 @@ func TestH12_HandlerWritesTooMuch(t *testing.T) {
}.run(t)
}
-// TODO: TestH12_Trailers
-
// Verify that both our HTTP/1 and HTTP/2 request and auto-decompress gzip.
// Some hosts send gzip even if you don't ask for it; see golang.org/issue/13298
func TestH12_AutoGzip(t *testing.T) {
@@ -375,8 +378,8 @@ func TestH12_AutoGzip(t *testing.T) {
// Test304Responses verifies that 304s don't declare that they're
// chunking in their response headers and aren't allowed to produce
// output.
-func Test304Responses_h1(t *testing.T) { test304Responses(t, false) }
-func Test304Responses_h2(t *testing.T) { test304Responses(t, true) }
+func Test304Responses_h1(t *testing.T) { test304Responses(t, h1Mode) }
+func Test304Responses_h2(t *testing.T) { test304Responses(t, h2Mode) }
func test304Responses(t *testing.T, h2 bool) {
defer afterTest(t)