summaryrefslogtreecommitdiffstats
path: root/net/base/net_log_unittest.h
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-09 04:34:47 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-09 04:34:47 +0000
commit1f0e32b947057d19c6772587e72799f2644119f1 (patch)
tree57fcee3c417e40c87cb81bf316ccef45a1878e0f /net/base/net_log_unittest.h
parent3ef4bc6355b48c74928feefd8bbaff501bb8d59f (diff)
downloadchromium_src-1f0e32b947057d19c6772587e72799f2644119f1.zip
chromium_src-1f0e32b947057d19c6772587e72799f2644119f1.tar.gz
chromium_src-1f0e32b947057d19c6772587e72799f2644119f1.tar.bz2
Add support for attaching custom parameters to NetLog events.
BUG=37421 Review URL: http://codereview.chromium.org/1556018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44057 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/net_log_unittest.h')
-rw-r--r--net/base/net_log_unittest.h23
1 files changed, 10 insertions, 13 deletions
diff --git a/net/base/net_log_unittest.h b/net/base/net_log_unittest.h
index 39a1f36..b7a6147 100644
--- a/net/base/net_log_unittest.h
+++ b/net/base/net_log_unittest.h
@@ -30,18 +30,16 @@ inline ::testing::AssertionResult LogContainsEventHelper(
size_t j = (i < 0) ? entries.size() + i : i;
if (j >= entries.size())
return ::testing::AssertionFailure() << j << " is out of bounds.";
- const NetLog::Entry& entry = entries[j];
- if (entry.type != NetLog::Entry::TYPE_EVENT)
- return ::testing::AssertionFailure() << "Not a TYPE_EVENT entry";
- if (expected_event != entry.event.type) {
+ const CapturingNetLog::Entry& entry = entries[j];
+ if (expected_event != entry.type) {
return ::testing::AssertionFailure()
- << "Actual event: " << NetLog::EventTypeToString(entry.event.type)
+ << "Actual event: " << NetLog::EventTypeToString(entry.type)
<< ". Expected event: " << NetLog::EventTypeToString(expected_event)
<< ".";
}
- if (expected_phase != entry.event.phase) {
+ if (expected_phase != entry.phase) {
return ::testing::AssertionFailure()
- << "Actual phase: " << entry.event.phase
+ << "Actual phase: " << entry.phase
<< ". Expected phase: " << expected_phase << ".";
}
if (check_time) {
@@ -94,12 +92,12 @@ inline ::testing::AssertionResult LogContainsEndEvent(
inline ::testing::AssertionResult LogContainsEntryWithType(
const CapturingNetLog::EntryList& entries,
int i, // Negative indices are reverse indices.
- NetLog::Entry::Type type) {
+ NetLog::EventType type) {
// Negative indices are reverse indices.
size_t j = (i < 0) ? entries.size() + i : i;
if (j >= entries.size())
return ::testing::AssertionFailure() << j << " is out of bounds.";
- const NetLog::Entry& entry = entries[j];
+ const CapturingNetLog::Entry& entry = entries[j];
if (entry.type != type)
return ::testing::AssertionFailure() << "Type does not match.";
return ::testing::AssertionSuccess();
@@ -116,10 +114,9 @@ inline size_t ExpectLogContainsSomewhere(
NetLog::EventPhase expected_phase) {
size_t i = 0;
for (; i < entries.size(); ++i) {
- const NetLog::Entry& entry = entries[i];
- if (entry.type == NetLog::Entry::TYPE_EVENT &&
- entry.event.type == expected_event &&
- entry.event.phase == expected_phase)
+ const CapturingNetLog::Entry& entry = entries[i];
+ if (entry.type == expected_event &&
+ entry.phase == expected_phase)
break;
}
EXPECT_LT(i, entries.size());