diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-04 19:46:42 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-04 19:46:42 +0000 |
commit | 6fee4dfc66709548f053aeb6e1e4f10482e514da (patch) | |
tree | f2d4ccb1b1a528306a63e3ba9bf3fb77b950244e /net/base | |
parent | cb29db1ddc8509f5efe359d2f60e14771a2c2bb8 (diff) | |
download | chromium_src-6fee4dfc66709548f053aeb6e1e4f10482e514da.zip chromium_src-6fee4dfc66709548f053aeb6e1e4f10482e514da.tar.gz chromium_src-6fee4dfc66709548f053aeb6e1e4f10482e514da.tar.bz2 |
Making ExpectLogContains inline so that url_request_unittest.cc won't depend on load_log_unittest.cc.
TEST=Compile!
BUG=none
Review URL: http://codereview.chromium.org/198025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25493 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base')
-rw-r--r-- | net/base/load_log_unittest.cc | 26 | ||||
-rw-r--r-- | net/base/load_log_unittest.h | 34 |
2 files changed, 24 insertions, 36 deletions
diff --git a/net/base/load_log_unittest.cc b/net/base/load_log_unittest.cc index 510a5e1..81ccac9 100644 --- a/net/base/load_log_unittest.cc +++ b/net/base/load_log_unittest.cc @@ -7,32 +7,6 @@ namespace net { -base::TimeTicks MakeTime(int t) { - base::TimeTicks ticks; // initialized to 0. - ticks += base::TimeDelta::FromMilliseconds(t); - return ticks; -} - -void ExpectLogContains(const LoadLog* log, - size_t i, - LoadLog::EventType expected_event, - LoadLog::EventPhase expected_phase) { - ASSERT_LT(i, log->events().size()); - EXPECT_EQ(expected_event, log->events()[i].type); - EXPECT_EQ(expected_phase, log->events()[i].phase); -} - -void ExpectLogContains(const LoadLog* log, - size_t i, - base::TimeTicks expected_time, - LoadLog::EventType expected_event, - LoadLog::EventPhase expected_phase) { - ASSERT_LT(i, log->events().size()); - EXPECT_TRUE(expected_time == log->events()[i].time); - EXPECT_EQ(expected_event, log->events()[i].type); - EXPECT_EQ(expected_phase, log->events()[i].phase); -} - namespace { TEST(LoadLogTest, Nullable) { diff --git a/net/base/load_log_unittest.h b/net/base/load_log_unittest.h index f1e386a..da892a0 100644 --- a/net/base/load_log_unittest.h +++ b/net/base/load_log_unittest.h @@ -6,25 +6,39 @@ #define NET_BASE_LOAD_LOG_UNITTEST_H_ #include "net/base/load_log.h" +#include "testing/gtest/include/gtest/gtest.h" namespace net { // Create a timestamp with internal value of |t| milliseconds from the epoch. -base::TimeTicks MakeTime(int t); +inline base::TimeTicks MakeTime(int t) { + base::TimeTicks ticks; // initialized to 0. + ticks += base::TimeDelta::FromMilliseconds(t); + return ticks; +} // Call gtest's EXPECT_* to verify that |log| contains the specified entry // at index |i|. -void ExpectLogContains(const LoadLog* log, - size_t i, - base::TimeTicks expected_time, - LoadLog::EventType expected_event, - LoadLog::EventPhase expected_phase); +inline void ExpectLogContains(const LoadLog* log, + size_t i, + base::TimeTicks expected_time, + LoadLog::EventType expected_event, + LoadLog::EventPhase expected_phase) { + ASSERT_LT(i, log->events().size()); + EXPECT_TRUE(expected_time == log->events()[i].time); + EXPECT_EQ(expected_event, log->events()[i].type); + EXPECT_EQ(expected_phase, log->events()[i].phase); +} // Same as above, but without an expectation for the timestamp. -void ExpectLogContains(const LoadLog* log, - size_t i, - LoadLog::EventType expected_event, - LoadLog::EventPhase expected_phase); +inline void ExpectLogContains(const LoadLog* log, + size_t i, + LoadLog::EventType expected_event, + LoadLog::EventPhase expected_phase) { + ASSERT_LT(i, log->events().size()); + EXPECT_EQ(expected_event, log->events()[i].type); + EXPECT_EQ(expected_phase, log->events()[i].phase); +} } // namespace net |