diff options
author | elijahtaylor@chromium.org <elijahtaylor@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-31 23:59:59 +0000 |
---|---|---|
committer | elijahtaylor@chromium.org <elijahtaylor@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-31 23:59:59 +0000 |
commit | 60bae1193a8490832c7217c04aad70ebfe179e4b (patch) | |
tree | ffdfc2a88fbdd94a474203641f1e1cbb79da17a5 /base/time | |
parent | d6b00ec8ea27623c7392aad2c86213578be0eed3 (diff) | |
download | chromium_src-60bae1193a8490832c7217c04aad70ebfe179e4b.zip chromium_src-60bae1193a8490832c7217c04aad70ebfe179e4b.tar.gz chromium_src-60bae1193a8490832c7217c04aad70ebfe179e4b.tar.bz2 |
Remove unnecesary work from ThreadNow() unittest.
This removes a dependence on rand_utils from the time unittests.
TEST=unit_tests
BUG=None
Review URL: https://chromiumcodereview.appspot.com/21187007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214870 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/time')
-rw-r--r-- | base/time/time_unittest.cc | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/base/time/time_unittest.cc b/base/time/time_unittest.cc index 29ceff0..7f3fde0 100644 --- a/base/time/time_unittest.cc +++ b/base/time/time_unittest.cc @@ -7,7 +7,6 @@ #include <time.h> #include "base/compiler_specific.h" -#include "base/rand_util.h" #include "base/threading/platform_thread.h" #include "build/build_config.h" #include "testing/gtest/include/gtest/gtest.h" @@ -616,10 +615,6 @@ TEST(TimeTicks, ThreadNow) { if (TimeTicks::IsThreadNowSupported()) { TimeTicks begin = TimeTicks::Now(); TimeTicks begin_thread = TimeTicks::ThreadNow(); - // Do some arbitrary work - double accu = 0.0f; - for (double i = 0; i < 1e4f; i++) - accu += base::RandDouble(); // Sleep for 10 milliseconds to get the thread de-scheduled base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(10)); TimeTicks end_thread = TimeTicks::ThreadNow(); @@ -627,9 +622,6 @@ TEST(TimeTicks, ThreadNow) { TimeDelta delta = end - begin; TimeDelta delta_thread = end_thread - begin_thread; TimeDelta difference = delta - delta_thread; - // Make a decision based on accu's value to prevent the compiler from - // optimizing away its computation (we don't care what the actual value is) - EXPECT_GE(accu, 0.0f); EXPECT_GE(difference.InMicroseconds(), 9000); } } |