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

Unified Diff: net/tools/quic/end_to_end_test.cc

Issue 2591143003: Add QuicStrCat. (Closed)
Patch Set: correct quic_client_bin.cc Created 4 years 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
Index: net/tools/quic/end_to_end_test.cc
diff --git a/net/tools/quic/end_to_end_test.cc b/net/tools/quic/end_to_end_test.cc
index 470fe25ff238f1f15d0788cd2fef947cad3c3379..060ff800024531184c99ced27e83923c91bc9835 100644
--- a/net/tools/quic/end_to_end_test.cc
+++ b/net/tools/quic/end_to_end_test.cc
@@ -2631,9 +2631,10 @@ class EndToEndTestServerPush : public EndToEndTest {
for (size_t i = 0; i < num_resources; ++i) {
string url = push_urls[i];
GURL resource_url(url);
- string body = use_large_response
- ? large_resource
- : "This is server push response body for " + url;
+ string body =
+ use_large_response
+ ? large_resource
+ : QuicStrCat("This is server push response body for ", url);
SpdyHeaderBlock response_headers;
response_headers[":version"] = "HTTP/1.1";
response_headers[":status"] = "200";
@@ -2686,7 +2687,8 @@ TEST_P(EndToEndTestServerPush, ServerPush) {
for (const string& url : push_urls) {
DVLOG(1) << "send request for pushed stream on url " << url;
- string expected_body = "This is server push response body for " + url;
+ string expected_body =
+ QuicStrCat("This is server push response body for ", url);
string response_body = client_->SendSynchronousRequest(url);
DVLOG(1) << "response body " << response_body;
EXPECT_EQ(expected_body, response_body);
@@ -2732,7 +2734,8 @@ TEST_P(EndToEndTestServerPush, ServerPushUnderLimit) {
// Sending subsequent requesets will not actually send anything on the wire,
// as the responses are already in the client's cache.
DVLOG(1) << "send request for pushed stream on url " << url;
- string expected_body = "This is server push response body for " + url;
+ string expected_body =
+ QuicStrCat("This is server push response body for ", url);
string response_body = client_->SendSynchronousRequest(url);
DVLOG(1) << "response body " << response_body;
EXPECT_EQ(expected_body, response_body);
@@ -2762,7 +2765,7 @@ TEST_P(EndToEndTestServerPush, ServerPushOverLimitNonBlocking) {
const size_t kNumResources = 1 + kNumMaxStreams; // 11.
string push_urls[11];
for (size_t i = 0; i < kNumResources; ++i) {
- push_urls[i] = "https://example.com/push_resources" + base::UintToString(i);
+ push_urls[i] = QuicStrCat("https://example.com/push_resources", i);
}
AddRequestAndResponseWithServerPush("example.com", "/push_example", kBody,
push_urls, kNumResources, 0);
@@ -2779,7 +2782,7 @@ TEST_P(EndToEndTestServerPush, ServerPushOverLimitNonBlocking) {
for (const string& url : push_urls) {
// Sending subsequent requesets will not actually send anything on the wire,
// as the responses are already in the client's cache.
- EXPECT_EQ("This is server push response body for " + url,
+ EXPECT_EQ(QuicStrCat("This is server push response body for ", url),
client_->SendSynchronousRequest(url));
}
@@ -2819,7 +2822,7 @@ TEST_P(EndToEndTestServerPush, ServerPushOverLimitWithBlocking) {
const size_t kNumResources = kNumMaxStreams + 1;
string push_urls[11];
for (size_t i = 0; i < kNumResources; ++i) {
- push_urls[i] = "http://example.com/push_resources" + base::UintToString(i);
+ push_urls[i] = QuicStrCat("http://example.com/push_resources", i);
}
AddRequestAndResponseWithServerPush("example.com", "/push_example", kBody,
push_urls, kNumResources, kBodySize);
@@ -2899,7 +2902,8 @@ TEST_P(EndToEndTestServerPush, DisabledWithoutConnectionOption) {
for (const string& url : push_urls) {
// Sending subsequent requests will trigger sending real requests because
// client doesn't support server push.
- const string expected_body = "This is server push response body for " + url;
+ const string expected_body =
+ QuicStrCat("This is server push response body for ", url);
const string response_body = client_->SendSynchronousRequest(url);
EXPECT_EQ(expected_body, response_body);
}

Powered by Google App Engine
This is Rietveld 408576698