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

Unified Diff: net/base/net_log_util_unittest.cc

Issue 1716007: Cleanup: Address some of the todos in net_log.h... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Address willchan's comments Created 10 years, 8 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/base/net_log_util.cc ('k') | net/proxy/init_proxy_resolver.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/net_log_util_unittest.cc
===================================================================
--- net/base/net_log_util_unittest.cc (revision 45472)
+++ net/base/net_log_util_unittest.cc (working copy)
@@ -20,14 +20,6 @@
NULL);
}
-CapturingNetLog::Entry MakeStringEntry(int t, const std::string& string) {
- return CapturingNetLog::Entry(NetLog::TYPE_TODO_STRING,
- MakeTime(t),
- NetLog::Source(),
- NetLog::PHASE_NONE,
- new NetLogStringParameter(string));
-}
-
TEST(NetLogUtilTest, Basic) {
CapturingNetLog::EntryList log;
@@ -60,19 +52,24 @@
log.push_back(MakeEventEntry(1, NetLog::TYPE_HOST_RESOLVER_IMPL,
NetLog::PHASE_BEGIN));
- log.push_back(MakeStringEntry(12, "Sup foo"));
- log.push_back(MakeStringEntry(14, "Multiline\nString"));
+ // Attach a string parameter to a CANCELLED event.
+ CapturingNetLog::Entry e =
+ MakeEventEntry(12, NetLog::TYPE_CANCELLED, NetLog::PHASE_NONE);
+ e.extra_parameters =
+ new NetLogStringParameter("string_name", "string_value");
+ log.push_back(e);
log.push_back(MakeEventEntry(131, NetLog::TYPE_HOST_RESOLVER_IMPL,
NetLog::PHASE_END));
EXPECT_EQ(
- "t= 1: +HOST_RESOLVER_IMPL [dt=130]\n"
- "t= 12: \"Sup foo\"\n"
- "t= 14: \"Multiline\n"
- "String\"\n"
- "t=131: -HOST_RESOLVER_IMPL",
- NetLogUtil::PrettyPrintAsEventTree(log, 0));
+ "t= 1: +HOST_RESOLVER_IMPL [dt=130]\n"
+ "t= 12: CANCELLED\n"
+ "{\n"
+ " \"string_name\": \"string_value\"\n"
+ "}\n"
+ "t=131: -HOST_RESOLVER_IMPL",
+ NetLogUtil::PrettyPrintAsEventTree(log, 0));
}
TEST(NetLogUtilTest, UnmatchedOpen) {
« no previous file with comments | « net/base/net_log_util.cc ('k') | net/proxy/init_proxy_resolver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698