diff options
author | mmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-02 01:00:57 +0000 |
---|---|---|
committer | mmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-02 01:00:57 +0000 |
commit | f3da152dfaa23bf58475e17d5f3d207806ae4705 (patch) | |
tree | bb00680a185d4038731ed16e92e1d16a24f29dd9 /net/base/net_log_unittest.h | |
parent | aa3c64b26eced83e5f7544d7243061e5c39e8d18 (diff) | |
download | chromium_src-f3da152dfaa23bf58475e17d5f3d207806ae4705.zip chromium_src-f3da152dfaa23bf58475e17d5f3d207806ae4705.tar.gz chromium_src-f3da152dfaa23bf58475e17d5f3d207806ae4705.tar.bz2 |
Rename CapturingNetLog::Entry to CapturingNetLog::CaptureEntry,
and have it keep its own copy of a NetLog Entry's parameters.
This is in preparation for a NetLog refactoring that will result
in NetLog parameters lasting no longer than the function call,
to avoid always having to copy all parameters.
This does make CapturingNetLogs much less efficient themselves,
but they should not be used in production code, anyways.
TEST=NONE
BUG=126243
Review URL: https://chromiumcodereview.appspot.com/10442085
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140146 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/net_log_unittest.h')
-rw-r--r-- | net/base/net_log_unittest.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/net/base/net_log_unittest.h b/net/base/net_log_unittest.h index 5e77275..2a4b458 100644 --- a/net/base/net_log_unittest.h +++ b/net/base/net_log_unittest.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -21,7 +21,7 @@ inline base::TimeTicks MakeTime(int t) { } inline ::testing::AssertionResult LogContainsEventHelper( - const CapturingNetLog::EntryList& entries, + const CapturingNetLog::CapturedEntryList& entries, int i, // Negative indices are reverse indices. const base::TimeTicks& expected_time, bool check_time, @@ -33,7 +33,7 @@ inline ::testing::AssertionResult LogContainsEventHelper( static_cast<size_t>(i); if (j >= entries.size()) return ::testing::AssertionFailure() << j << " is out of bounds."; - const CapturingNetLog::Entry& entry = entries[j]; + const CapturingNetLog::CapturedEntry& entry = entries[j]; if (expected_event != entry.type) { return ::testing::AssertionFailure() << "Actual event: " << NetLog::EventTypeToString(entry.type) @@ -57,7 +57,7 @@ inline ::testing::AssertionResult LogContainsEventHelper( } inline ::testing::AssertionResult LogContainsEventAtTime( - const CapturingNetLog::EntryList& log, + const CapturingNetLog::CapturedEntryList& log, int i, // Negative indices are reverse indices. const base::TimeTicks& expected_time, NetLog::EventType expected_event, @@ -68,7 +68,7 @@ inline ::testing::AssertionResult LogContainsEventAtTime( // Version without timestamp. inline ::testing::AssertionResult LogContainsEvent( - const CapturingNetLog::EntryList& log, + const CapturingNetLog::CapturedEntryList& log, int i, // Negative indices are reverse indices. NetLog::EventType expected_event, NetLog::EventPhase expected_phase) { @@ -78,7 +78,7 @@ inline ::testing::AssertionResult LogContainsEvent( // Version for PHASE_BEGIN (and no timestamp). inline ::testing::AssertionResult LogContainsBeginEvent( - const CapturingNetLog::EntryList& log, + const CapturingNetLog::CapturedEntryList& log, int i, // Negative indices are reverse indices. NetLog::EventType expected_event) { return LogContainsEvent(log, i, expected_event, NetLog::PHASE_BEGIN); @@ -86,14 +86,14 @@ inline ::testing::AssertionResult LogContainsBeginEvent( // Version for PHASE_END (and no timestamp). inline ::testing::AssertionResult LogContainsEndEvent( - const CapturingNetLog::EntryList& log, + const CapturingNetLog::CapturedEntryList& log, int i, // Negative indices are reverse indices. NetLog::EventType expected_event) { return LogContainsEvent(log, i, expected_event, NetLog::PHASE_END); } inline ::testing::AssertionResult LogContainsEntryWithType( - const CapturingNetLog::EntryList& entries, + const CapturingNetLog::CapturedEntryList& entries, int i, // Negative indices are reverse indices. NetLog::EventType type) { // Negative indices are reverse indices. @@ -102,7 +102,7 @@ inline ::testing::AssertionResult LogContainsEntryWithType( static_cast<size_t>(i); if (j >= entries.size()) return ::testing::AssertionFailure() << j << " is out of bounds."; - const CapturingNetLog::Entry& entry = entries[j]; + const CapturingNetLog::CapturedEntry& entry = entries[j]; if (entry.type != type) return ::testing::AssertionFailure() << "Type does not match."; return ::testing::AssertionSuccess(); @@ -113,13 +113,13 @@ inline ::testing::AssertionResult LogContainsEntryWithType( // as long as the first index where it is found is at least |min_index|. // Returns the position where the event was found. inline size_t ExpectLogContainsSomewhere( - const CapturingNetLog::EntryList& entries, + const CapturingNetLog::CapturedEntryList& entries, size_t min_index, NetLog::EventType expected_event, NetLog::EventPhase expected_phase) { size_t i = 0; for (; i < entries.size(); ++i) { - const CapturingNetLog::Entry& entry = entries[i]; + const CapturingNetLog::CapturedEntry& entry = entries[i]; if (entry.type == expected_event && entry.phase == expected_phase) break; @@ -133,13 +133,13 @@ inline size_t ExpectLogContainsSomewhere( // as long as one index where it is found is at least |min_index|. // Returns the first such position where the event was found. inline size_t ExpectLogContainsSomewhereAfter( - const CapturingNetLog::EntryList& entries, + const CapturingNetLog::CapturedEntryList& entries, size_t min_index, NetLog::EventType expected_event, NetLog::EventPhase expected_phase) { size_t i = min_index; for (; i < entries.size(); ++i) { - const CapturingNetLog::Entry& entry = entries[i]; + const CapturingNetLog::CapturedEntry& entry = entries[i]; if (entry.type == expected_event && entry.phase == expected_phase) break; |