Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(981)

Unified Diff: net/spdy/spdy_websocket_test_util.cc

Issue 17570014: [SPDY] Unfork websocket_handshake_handler_spdy{2,3}_unittest.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/spdy/spdy_websocket_test_util.h ('k') | net/websockets/websocket_handshake_handler_spdy2_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_websocket_test_util.cc
diff --git a/net/spdy/spdy_websocket_test_util.cc b/net/spdy/spdy_websocket_test_util.cc
index 2327ee2cb1967e76c32fe5c65e8e71a0f93361a5..0872e3f116e765ee97599a4507144543a5366764 100644
--- a/net/spdy/spdy_websocket_test_util.cc
+++ b/net/spdy/spdy_websocket_test_util.cc
@@ -19,11 +19,17 @@ static const int kDefaultExtraHeaderCount = 0;
SpdyWebSocketTestUtil::SpdyWebSocketTestUtil(
NextProto protocol) : spdy_util_(protocol) {}
+std::string SpdyWebSocketTestUtil::GetHeader(const SpdyHeaderBlock& headers,
+ const std::string& key) const {
+ SpdyHeaderBlock::const_iterator it = headers.find(GetHeaderKey(key));
+ return (it == headers.end()) ? "" : it->second;
+}
+
void SpdyWebSocketTestUtil::SetHeader(
const std::string& key,
const std::string& value,
SpdyHeaderBlock* headers) const {
- (*headers)[(spdy_util_.is_spdy2() ? "" : ":") + key] = value;
+ (*headers)[GetHeaderKey(key)] = value;
}
SpdyFrame* SpdyWebSocketTestUtil::ConstructSpdyWebSocketSynStream(
@@ -146,4 +152,13 @@ SpdyFrame* SpdyWebSocketTestUtil::ConstructSpdySettings(
return spdy_util_.ConstructSpdySettings(settings);
}
+SpdyMajorVersion SpdyWebSocketTestUtil::spdy_version() const {
+ return spdy_util_.spdy_version();
+}
+
+std::string SpdyWebSocketTestUtil::GetHeaderKey(
+ const std::string& key) const {
+ return (spdy_util_.is_spdy2() ? "" : ":") + key;
+}
+
} // namespace net
« no previous file with comments | « net/spdy/spdy_websocket_test_util.h ('k') | net/websockets/websocket_handshake_handler_spdy2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698