Chromium Code Reviews| Index: net/spdy/spdy_framer_test.cc |
| diff --git a/net/spdy/spdy_framer_test.cc b/net/spdy/spdy_framer_test.cc |
| index 2676b4df72c65c8234fcf9d18832d191276bea17..e8969d9315b2dcc6937863bfe1e12a531b7a616a 100644 |
| --- a/net/spdy/spdy_framer_test.cc |
| +++ b/net/spdy/spdy_framer_test.cc |
| @@ -2049,8 +2049,9 @@ TEST_P(SpdyFramerTest, CreateSynStreamCompressed) { |
| { |
| const char kDescription[] = |
| "SYN_STREAM frame, low pri, no FIN"; |
| - |
| const SpdyPriority priority = IsSpdy2() ? 2 : 4; |
| + |
| +#if !defined(ZLIB_X86_SIMD) |
|
agl
2014/10/17 00:45:34
Let's not add another #define. How about memcmping
robert.bradford
2014/10/20 16:45:54
Sounds good. Only needed memcmp() against one, if
|
| const unsigned char kV2FrameData[] = { |
| 0x80, spdy_version_ch_, 0x00, 0x01, |
| 0x00, 0x00, 0x00, 0x36, |
| @@ -2087,6 +2088,43 @@ TEST_P(SpdyFramerTest, CreateSynStreamCompressed) { |
| 0x80, 0x00, 0x00, 0x00, |
| 0x00, 0xFF, 0xFF, |
| }; |
| +#else |
| + const unsigned char kV2FrameData[] = { |
| + 0x80, spdy_version_ch_, 0x00, 0x01, |
| + 0x00, 0x00, 0x00, 0x33, |
| + 0x00, 0x00, 0x00, 0x01, |
| + 0x00, 0x00, 0x00, 0x00, |
| + 0x80, 0x00, 0x38, 0xea, |
| + 0xdf, 0xa2, 0x51, 0xb2, |
| + 0x62, 0x60, 0x62, 0x60, |
| + 0x4e, 0x4a, 0x2c, 0x62, |
| + 0x60, 0x06, 0x08, 0xa0, |
| + 0xb4, 0xfc, 0x7c, 0x80, |
| + 0x00, 0x62, 0x60, 0x06, |
| + 0x13, 0x00, 0x01, 0x94, |
| + 0x94, 0x58, 0x04, 0x10, |
| + 0x40, 0x00, 0x00, 0x00, |
| + 0x00, 0xff, 0xff, |
| + }; |
| + const unsigned char kV3FrameData[] = { |
| + 0x80, spdy_version_ch_, 0x00, 0x01, |
| + 0x00, 0x00, 0x00, 0x32, |
| + 0x00, 0x00, 0x00, 0x01, |
| + 0x00, 0x00, 0x00, 0x00, |
| + 0x80, 0x00, 0x38, 0xea, |
| + 0xe3, 0xc6, 0xa7, 0xc2, |
| + 0x02, 0xe5, 0x0e, 0x50, |
| + 0xc2, 0x4b, 0x4a, 0x04, |
| + 0xe5, 0x0b, 0x66, 0x80, |
| + 0x00, 0x4a, 0xcb, 0xcf, |
| + 0x07, 0x08, 0x20, 0x24, |
| + 0x0a, 0x20, 0x80, 0x92, |
| + 0x12, 0x8b, 0x00, 0x02, |
| + 0x08, 0x00, 0x00, 0x00, |
| + 0xff, 0xff, |
| + }; |
| +#endif //!defined(ZLIB_X86_SIMD) |
| + |
| SpdySynStreamIR syn_stream(1); |
| syn_stream.set_priority(priority); |
| syn_stream.SetHeader("bar", "foo"); |
| @@ -2250,6 +2288,7 @@ TEST_P(SpdyFramerTest, CreateSynReplyCompressed) { |
| { |
| const char kDescription[] = "SYN_REPLY frame, no FIN"; |
| +#if !defined(ZLIB_X86_SIMD) |
| const unsigned char kV2FrameData[] = { |
| 0x80, spdy_version_ch_, 0x00, 0x02, |
| 0x00, 0x00, 0x00, 0x32, |
| @@ -2284,6 +2323,40 @@ TEST_P(SpdyFramerTest, CreateSynReplyCompressed) { |
| 0x00, 0x00, 0x00, 0xff, |
| 0xff, |
| }; |
| +#else |
| + const unsigned char kV2FrameData[] = { |
| + 0x80, spdy_version_ch_, 0x00, 0x02, |
| + 0x00, 0x00, 0x00, 0x2f, |
| + 0x00, 0x00, 0x00, 0x01, |
| + 0x00, 0x00, 0x38, 0xea, |
| + 0xdf, 0xa2, 0x51, 0xb2, |
| + 0x62, 0x60, 0x62, 0x60, |
| + 0x4e, 0x4a, 0x2c, 0x62, |
| + 0x60, 0x06, 0x08, 0xa0, |
| + 0xb4, 0xfc, 0x7c, 0x80, |
| + 0x00, 0x62, 0x60, 0x06, |
| + 0x13, 0x00, 0x01, 0x94, |
| + 0x94, 0x58, 0x04, 0x10, |
| + 0x40, 0x00, 0x00, 0x00, |
| + 0x00, 0xff, 0xff, |
| + }; |
| + const unsigned char kV3FrameData[] = { |
| + 0x80, spdy_version_ch_, 0x00, 0x02, |
| + 0x00, 0x00, 0x00, 0x2c, |
| + 0x00, 0x00, 0x00, 0x01, |
| + 0x38, 0xea, 0xe3, 0xc6, |
| + 0xa7, 0xc2, 0x02, 0xe5, |
| + 0x0e, 0x50, 0xc2, 0x4b, |
| + 0x4a, 0x04, 0xe5, 0x0b, |
| + 0x66, 0x80, 0x00, 0x4a, |
| + 0xcb, 0xcf, 0x07, 0x08, |
| + 0x20, 0x24, 0x0a, 0x20, |
| + 0x80, 0x92, 0x12, 0x8b, |
| + 0x00, 0x02, 0x08, 0x00, |
| + 0x00, 0x00, 0xff, 0xff, |
| + }; |
| +#endif //!defined(ZLIB_X86_SIMD) |
| + |
| SpdySynReplyIR syn_reply(1); |
| syn_reply.SetHeader("bar", "foo"); |
| syn_reply.SetHeader("foo", "bar"); |
| @@ -2827,6 +2900,7 @@ TEST_P(SpdyFramerTest, CreateHeadersCompressed) { |
| { |
| const char kDescription[] = "HEADERS frame, no FIN"; |
| +#if !defined(ZLIB_X86_SIMD) |
| const unsigned char kV2FrameData[] = { |
| 0x80, spdy_version_ch_, 0x00, 0x08, |
| 0x00, 0x00, 0x00, 0x32, |
| @@ -2861,6 +2935,40 @@ TEST_P(SpdyFramerTest, CreateHeadersCompressed) { |
| 0x00, 0x00, 0x00, 0xff, |
| 0xff, |
| }; |
| +#else |
| + const unsigned char kV2FrameData[] = { |
| + 0x80, spdy_version_ch_, 0x00, 0x08, |
| + 0x00, 0x00, 0x00, 0x2f, |
| + 0x00, 0x00, 0x00, 0x01, |
| + 0x00, 0x00, 0x38, 0xea, |
| + 0xdf, 0xa2, 0x51, 0xb2, |
| + 0x62, 0x60, 0x62, 0x60, |
| + 0x4e, 0x4a, 0x2c, 0x62, |
| + 0x60, 0x06, 0x08, 0xa0, |
| + 0xb4, 0xfc, 0x7c, 0x80, |
| + 0x00, 0x62, 0x60, 0x06, |
| + 0x13, 0x00, 0x01, 0x94, |
| + 0x94, 0x58, 0x04, 0x10, |
| + 0x40, 0x00, 0x00, 0x00, |
| + 0x00, 0xff, 0xff, |
| + }; |
| + const unsigned char kV3FrameData[] = { |
| + 0x80, spdy_version_ch_, 0x00, 0x08, |
| + 0x00, 0x00, 0x00, 0x2c, |
| + 0x00, 0x00, 0x00, 0x01, |
| + 0x38, 0xea, 0xe3, 0xc6, |
| + 0xa7, 0xc2, 0x02, 0xe5, |
| + 0x0e, 0x50, 0xc2, 0x4b, |
| + 0x4a, 0x04, 0xe5, 0x0b, |
| + 0x66, 0x80, 0x00, 0x4a, |
| + 0xcb, 0xcf, 0x07, 0x08, |
| + 0x20, 0x24, 0x0a, 0x20, |
| + 0x80, 0x92, 0x12, 0x8b, |
| + 0x00, 0x02, 0x08, 0x00, |
| + 0x00, 0x00, 0xff, 0xff, |
| + }; |
| +#endif //!defined(ZLIB_X86_SIMD) |
| + |
| SpdyHeadersIR headers_ir(1); |
| headers_ir.SetHeader("bar", "foo"); |
| headers_ir.SetHeader("foo", "bar"); |