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

Unified Diff: net/spdy/spdy_proxy_client_socket_unittest.cc

Issue 1411383005: Initial implementation of RequestPriority-based HTTP/2 dependencies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final round of comments. Created 5 years, 1 month 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_network_transaction_unittest.cc ('k') | net/spdy/spdy_session.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_proxy_client_socket_unittest.cc
diff --git a/net/spdy/spdy_proxy_client_socket_unittest.cc b/net/spdy/spdy_proxy_client_socket_unittest.cc
index 0a2ae8ecf40200d55cf24f10bba1aed28299aba5..67fbf3a1795ddcd1408746c75b8d49d9284bd207 100644
--- a/net/spdy/spdy_proxy_client_socket_unittest.cc
+++ b/net/spdy/spdy_proxy_client_socket_unittest.cc
@@ -33,6 +33,19 @@
namespace {
+enum TestCase {
+ // Test using the SPDY/3.1 protocol.
+ kTestCaseSPDY31,
+
+ // Test using the HTTP/2 protocol, without specifying a stream
+ // dependency based on the RequestPriority.
+ kTestCaseHTTP2NoPriorityDependencies,
+
+ // Test using the HTTP/2 protocol, specifying a stream
+ // dependency based on the RequestPriority.
+ kTestCaseHTTP2PriorityDependencies
+};
+
static const char kRequestUrl[] = "https://www.google.com/";
static const char kOriginHost[] = "www.google.com";
static const int kOriginPort = 443;
@@ -61,15 +74,18 @@ static const char kRedirectUrl[] = "https://example.com/";
namespace net {
-class SpdyProxyClientSocketTest
- : public PlatformTest,
- public testing::WithParamInterface<NextProto> {
+class SpdyProxyClientSocketTest : public PlatformTest,
+ public testing::WithParamInterface<TestCase> {
public:
SpdyProxyClientSocketTest();
+ ~SpdyProxyClientSocketTest();
void TearDown() override;
protected:
+ NextProto GetProtocol() const;
+ bool GetDependenciesFromPriority() const;
+
void Initialize(MockRead* reads, size_t reads_count, MockWrite* writes,
size_t writes_count);
void PopulateConnectRequestIR(SpdyHeaderBlock* syn_ir);
@@ -140,15 +156,16 @@ class SpdyProxyClientSocketTest
DISALLOW_COPY_AND_ASSIGN(SpdyProxyClientSocketTest);
};
-INSTANTIATE_TEST_CASE_P(NextProto,
+INSTANTIATE_TEST_CASE_P(ProtoPlusDepend,
SpdyProxyClientSocketTest,
- testing::Values(kProtoSPDY31,
- kProtoHTTP2));
+ testing::Values(kTestCaseSPDY31,
+ kTestCaseHTTP2NoPriorityDependencies,
+ kTestCaseHTTP2PriorityDependencies));
SpdyProxyClientSocketTest::SpdyProxyClientSocketTest()
- : spdy_util_(GetParam()),
+ : spdy_util_(GetProtocol(), GetDependenciesFromPriority()),
read_buf_(NULL),
- session_deps_(GetParam()),
+ session_deps_(GetProtocol()),
connect_data_(SYNCHRONOUS, OK),
framer_(spdy_util_.spdy_version(), false),
user_agent_(kUserAgent),
@@ -160,6 +177,12 @@ SpdyProxyClientSocketTest::SpdyProxyClientSocketTest()
proxy_,
PRIVACY_MODE_DISABLED) {
session_deps_.net_log = net_log_.bound().net_log();
+ SpdySession::SetPriorityDependencyDefaultForTesting(
+ GetDependenciesFromPriority());
+}
+
+SpdyProxyClientSocketTest::~SpdyProxyClientSocketTest() {
+ SpdySession::SetPriorityDependencyDefaultForTesting(false);
}
void SpdyProxyClientSocketTest::TearDown() {
@@ -171,6 +194,14 @@ void SpdyProxyClientSocketTest::TearDown() {
PlatformTest::TearDown();
}
+NextProto SpdyProxyClientSocketTest::GetProtocol() const {
+ return GetParam() == kTestCaseSPDY31 ? kProtoSPDY31 : kProtoHTTP2;
+}
+
+bool SpdyProxyClientSocketTest::GetDependenciesFromPriority() const {
+ return GetParam() == kTestCaseHTTP2PriorityDependencies;
+}
+
void SpdyProxyClientSocketTest::Initialize(MockRead* reads,
size_t reads_count,
MockWrite* writes,
« no previous file with comments | « net/spdy/spdy_network_transaction_unittest.cc ('k') | net/spdy/spdy_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698