summaryrefslogtreecommitdiffstats
path: root/net/base/net_log_util_unittest.cc
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-27 23:20:45 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-27 23:20:45 +0000
commitd13f51bc832e8e7965e92f5aa4b16b8c10c3f913 (patch)
treed5a1a413bf8716befbae7d056cd8c6194eed5a98 /net/base/net_log_util_unittest.cc
parentf2286c23e17c0012d53800a5ef28975b6e22393a (diff)
downloadchromium_src-d13f51bc832e8e7965e92f5aa4b16b8c10c3f913.zip
chromium_src-d13f51bc832e8e7965e92f5aa4b16b8c10c3f913.tar.gz
chromium_src-d13f51bc832e8e7965e92f5aa4b16b8c10c3f913.tar.bz2
Cleanup: Address some of the todos in net_log.h
- Get rid of the AddString() and AddStringLiteral() methods. - Make EventParameters able to serialize to JSON, instead of a string. BUG=37421 Review URL: http://codereview.chromium.org/1716007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45750 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/net_log_util_unittest.cc')
-rw-r--r--net/base/net_log_util_unittest.cc29
1 files changed, 13 insertions, 16 deletions
diff --git a/net/base/net_log_util_unittest.cc b/net/base/net_log_util_unittest.cc
index 9306fa9..98de4bc 100644
--- a/net/base/net_log_util_unittest.cc
+++ b/net/base/net_log_util_unittest.cc
@@ -20,14 +20,6 @@ CapturingNetLog::Entry MakeEventEntry(int t,
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 @@ TEST(NetLogUtilTest, Basic2) {
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) {