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

Side by Side Diff: net/tools/quic/quic_in_memory_cache_test.cc

Issue 2481923002: [WIP] make GURL::path() return a StringPiece (Closed)
Patch Set: thanks asan Created 4 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 unified diff | Download patch
« no previous file with comments | « net/tools/quic/quic_in_memory_cache.cc ('k') | net/tools/quic/quic_simple_server_session.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <string> 5 #include <string>
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 QuicInMemoryCache* cache = QuicInMemoryCache::GetInstance(); 238 QuicInMemoryCache* cache = QuicInMemoryCache::GetInstance();
239 cache->AddSimpleResponseWithServerPushResources( 239 cache->AddSimpleResponseWithServerPushResources(
240 request_host, "/", 200, response_body, push_resources); 240 request_host, "/", 200, response_body, push_resources);
241 string request_url = request_host + "/"; 241 string request_url = request_host + "/";
242 list<ServerPushInfo> resources = cache->GetServerPushResources(request_url); 242 list<ServerPushInfo> resources = cache->GetServerPushResources(request_url);
243 ASSERT_EQ(kNumResources, resources.size()); 243 ASSERT_EQ(kNumResources, resources.size());
244 int i = 0; 244 int i = 0;
245 for (const auto& push_resource : push_resources) { 245 for (const auto& push_resource : push_resources) {
246 GURL url = resources.front().request_url; 246 GURL url = resources.front().request_url;
247 string host = url.host(); 247 string host = url.host();
248 string path = url.path(); 248 string path = url.path().as_string();
249 const QuicInMemoryCache::Response* response = 249 const QuicInMemoryCache::Response* response =
250 cache->GetResponse(host, path); 250 cache->GetResponse(host, path);
251 ASSERT_TRUE(response); 251 ASSERT_TRUE(response);
252 ASSERT_TRUE(ContainsKey(response->headers(), ":status")); 252 ASSERT_TRUE(ContainsKey(response->headers(), ":status"));
253 EXPECT_EQ(push_response_status[i++], 253 EXPECT_EQ(push_response_status[i++],
254 response->headers().find(":status")->second); 254 response->headers().find(":status")->second);
255 EXPECT_EQ(push_resource.body, response->body()); 255 EXPECT_EQ(push_resource.body, response->body());
256 resources.pop_front(); 256 resources.pop_front();
257 } 257 }
258 } 258 }
259 259
260 } // namespace test 260 } // namespace test
261 } // namespace net 261 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_in_memory_cache.cc ('k') | net/tools/quic/quic_simple_server_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698