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

Unified Diff: chrome/browser/net/passive_log_collector_unittest.cc

Issue 2108003: Add the URLRequest's method and load flags to the NetLog. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix test Created 10 years, 7 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 | « chrome/browser/net/passive_log_collector.cc ('k') | net/base/net_log.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/passive_log_collector_unittest.cc
===================================================================
--- chrome/browser/net/passive_log_collector_unittest.cc (revision 47305)
+++ chrome/browser/net/passive_log_collector_unittest.cc (working copy)
@@ -7,6 +7,7 @@
#include "base/compiler_specific.h"
#include "base/format_macros.h"
#include "base/string_util.h"
+#include "net/url_request/url_request_netlog_params.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
@@ -25,7 +26,7 @@
base::TimeTicks(),
NetLog::Source(kSourceType, source_id),
NetLog::PHASE_BEGIN,
- new net::NetLogStringParameter("url", url));
+ new URLRequestStartEventParameters(GURL(url), "GET", 0));
}
PassiveLogCollector::Entry MakeStartLogEntry(int source_id) {
@@ -49,8 +50,8 @@
NetLog::PHASE_BEGIN, NULL);
collector->OnAddEntry(NetLog::TYPE_URL_REQUEST_START, base::TimeTicks(),
NetLog::Source(NetLog::SOURCE_URL_REQUEST, id),
- NetLog::PHASE_BEGIN, new net::NetLogStringParameter(
- "url", StringPrintf("http://req%d", id)));
+ NetLog::PHASE_BEGIN, new URLRequestStartEventParameters(
+ GURL(StringPrintf("http://req%d", id)), "GET", 0));
}
void AddEndURLRequestEntries(PassiveLogCollector* collector, uint32 id) {
@@ -82,11 +83,11 @@
RequestInfoList live_reqs = tracker.GetLiveRequests();
ASSERT_EQ(5u, live_reqs.size());
- EXPECT_EQ("http://req1", live_reqs[0].GetURL());
- EXPECT_EQ("http://req2", live_reqs[1].GetURL());
- EXPECT_EQ("http://req3", live_reqs[2].GetURL());
- EXPECT_EQ("http://req4", live_reqs[3].GetURL());
- EXPECT_EQ("http://req5", live_reqs[4].GetURL());
+ EXPECT_EQ("http://req1/", live_reqs[0].GetURL());
+ EXPECT_EQ("http://req2/", live_reqs[1].GetURL());
+ EXPECT_EQ("http://req3/", live_reqs[2].GetURL());
+ EXPECT_EQ("http://req4/", live_reqs[3].GetURL());
+ EXPECT_EQ("http://req5/", live_reqs[4].GetURL());
tracker.OnAddEntry(MakeEndLogEntry(1));
tracker.OnAddEntry(MakeEndLogEntry(5));
@@ -97,8 +98,8 @@
live_reqs = tracker.GetLiveRequests();
ASSERT_EQ(2u, live_reqs.size());
- EXPECT_EQ("http://req2", live_reqs[0].GetURL());
- EXPECT_EQ("http://req4", live_reqs[1].GetURL());
+ EXPECT_EQ("http://req2/", live_reqs[0].GetURL());
+ EXPECT_EQ("http://req4/", live_reqs[1].GetURL());
}
TEST(RequestTrackerTest, GraveyardBounded) {
@@ -120,7 +121,7 @@
for (size_t i = 0; i < RequestTracker::kMaxGraveyardSize; ++i) {
size_t req_number = i + RequestTracker::kMaxGraveyardSize;
- std::string url = StringPrintf("http://req%" PRIuS, req_number);
+ std::string url = StringPrintf("http://req%" PRIuS "/", req_number);
EXPECT_EQ(url, recent_reqs[i].GetURL());
}
}
« no previous file with comments | « chrome/browser/net/passive_log_collector.cc ('k') | net/base/net_log.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698