Clean up spdy_test_util_common |
|
Issue description* Rename to spdy_test_util. (What does common mean here?) * Remove unused SpdyHeaderInfo. * Inline ConstructSpdyGoAway() to all three call sites. * Remove "The caller takes ownership of the frame." comments. (SpdySerializedFrame is constructed on the stack, not heap, so this does not apply any longer.) * Consolidate multiple ConstructSpdyGet() signatures, possibly with some Java-like syntax: ConstructSpdyGet(stream_id).AddHeaders(...).SetPriority(RequestPriority), given that very few call sites add headers or use non-default priority. * Same with multiple ConstructSpdyPush() signatures. * Same with multiple ConstructSpdyPush() signatures. * Same with multiple ConstructSpdyReplyError() signatures. * Same with multiple ConstructSpdyDataFrame() signatures. * See if every call site of ConstructSpdyPushPromise() can use ConstructSpdyPush() instead, and ConstructSpdyPushPromise() could be inlined or made private. * Make ConstructSpdyDataFrame() take StringPiece instead of char* and uint. * Possibly add ConstructSpdyGet().SetUrl() instead of set_default_url().
,
Feb 20 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d74f4381d34aba88bc34cf54140b16fdb4ab428e commit d74f4381d34aba88bc34cf54140b16fdb4ab428e Author: Bence Béky <bnc@chromium.org> Date: Tue Feb 20 18:26:19 2018 Change ConstructSpdyDataFrame() to take StringPiece. This is a test-only change. Change ConstructSpdyDataFrame() to take a base::StringPiece argument instead of separate data and length. To prevent headaches while writing unittests if one forgets to change the length and has a hard time figuring out why mock data does not make any sense. Also move |content| local variable from heap to stack in multiple tests. Also use std::string::data() instead of std::string::c_str() where substrings are constructed in tests. Also replace some potentially politically incorrect text with more neutral text of the exact same length. Bug: 810752 Change-Id: Ib22f9ab5c12be8e2c95bd68205995547fda4e9ba Reviewed-on: https://chromium-review.googlesource.com/926421 Reviewed-by: Ryan Hamilton <rch@chromium.org> Commit-Queue: Bence Béky <bnc@chromium.org> Cr-Commit-Position: refs/heads/master@{#537823} [modify] https://crrev.com/d74f4381d34aba88bc34cf54140b16fdb4ab428e/net/http/bidirectional_stream_unittest.cc [modify] https://crrev.com/d74f4381d34aba88bc34cf54140b16fdb4ab428e/net/http/http_network_transaction_unittest.cc [modify] https://crrev.com/d74f4381d34aba88bc34cf54140b16fdb4ab428e/net/quic/chromium/quic_network_transaction_unittest.cc [modify] https://crrev.com/d74f4381d34aba88bc34cf54140b16fdb4ab428e/net/spdy/chromium/bidirectional_stream_spdy_impl_unittest.cc [modify] https://crrev.com/d74f4381d34aba88bc34cf54140b16fdb4ab428e/net/spdy/chromium/spdy_http_stream_unittest.cc [modify] https://crrev.com/d74f4381d34aba88bc34cf54140b16fdb4ab428e/net/spdy/chromium/spdy_network_transaction_unittest.cc [modify] https://crrev.com/d74f4381d34aba88bc34cf54140b16fdb4ab428e/net/spdy/chromium/spdy_proxy_client_socket_unittest.cc [modify] https://crrev.com/d74f4381d34aba88bc34cf54140b16fdb4ab428e/net/spdy/chromium/spdy_session_unittest.cc [modify] https://crrev.com/d74f4381d34aba88bc34cf54140b16fdb4ab428e/net/spdy/chromium/spdy_stream_unittest.cc [modify] https://crrev.com/d74f4381d34aba88bc34cf54140b16fdb4ab428e/net/spdy/chromium/spdy_test_util_common.cc [modify] https://crrev.com/d74f4381d34aba88bc34cf54140b16fdb4ab428e/net/spdy/chromium/spdy_test_util_common.h [modify] https://crrev.com/d74f4381d34aba88bc34cf54140b16fdb4ab428e/net/websockets/websocket_basic_stream_adapters_test.cc |
|
►
Sign in to add a comment |
|
Comment 1 by bugdroid1@chromium.org
, Feb 11 2018