Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96ee54c8d6 | ||
|
|
24ed6b7c58 |
@@ -19,17 +19,11 @@ import (
|
|||||||
func TestImageProxyRefusesFitOutsideAboveMaximum(t *testing.T) {
|
func TestImageProxyRefusesFitOutsideAboveMaximum(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
// The upstream paths of the sources
|
// The sources, by their upstream paths
|
||||||
const (
|
|
||||||
widePath = "/wide.png"
|
|
||||||
rowPath = "/row.png"
|
|
||||||
columnPath = "/column.png"
|
|
||||||
)
|
|
||||||
|
|
||||||
sources := map[string][]byte{
|
sources := map[string][]byte{
|
||||||
widePath: encodeTestPNG(t, 3000, 600),
|
"/wide.png": encodeTestPNG(t, 3000, 600),
|
||||||
rowPath: encodeTestPNG(t, 8192, 1),
|
"/row.png": encodeTestPNG(t, 8192, 1),
|
||||||
columnPath: encodeTestPNG(t, 1, 8192),
|
"/column.png": encodeTestPNG(t, 1, 8192),
|
||||||
}
|
}
|
||||||
|
|
||||||
upstream := httptest.NewServer(http.HandlerFunc(
|
upstream := httptest.NewServer(http.HandlerFunc(
|
||||||
@@ -52,10 +46,10 @@ func TestImageProxyRefusesFitOutsideAboveMaximum(t *testing.T) {
|
|||||||
// wantWidth and wantHeight are the served image's, 0 for a refusal
|
// wantWidth and wantHeight are the served image's, 0 for a refusal
|
||||||
wantWidth, wantHeight int
|
wantWidth, wantHeight int
|
||||||
}{
|
}{
|
||||||
{widePath, 1, 8192, 0, 0},
|
{"/wide.png", 1, 8192, 0, 0},
|
||||||
{rowPath, 1, 8192, 0, 0},
|
{"/row.png", 1, 8192, 0, 0},
|
||||||
{columnPath, 8192, 1, 0, 0},
|
{"/column.png", 8192, 1, 0, 0},
|
||||||
{widePath, 1, 1200, 6000, 1200},
|
{"/wide.png", 1, 1200, 6000, 1200},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
|
|||||||
Reference in new issue
Block a user