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

Unified Diff: net/base/net_log_unittest.h

Issue 1556018: Add support for attaching custom parameters to NetLog events. (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_event_type_list.h ('k') | net/base/net_log_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/net_log_unittest.h
===================================================================
--- net/base/net_log_unittest.h (revision 44049)
+++ net/base/net_log_unittest.h (working copy)
@@ -30,18 +30,16 @@
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 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 @@
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());
« no previous file with comments | « net/base/net_log_event_type_list.h ('k') | net/base/net_log_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698