OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/debug/trace_event_unittest.h" | 5 #include "base/debug/trace_event_unittest.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 #include <cstdlib> | 8 #include <cstdlib> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
865 for (int thread = 0; thread < num_threads; thread++) { | 865 for (int thread = 0; thread < num_threads; thread++) { |
866 for (int event = 0; event < num_events; event++) { | 866 for (int event = 0; event < num_events; event++) { |
867 EXPECT_TRUE(results[thread][event]); | 867 EXPECT_TRUE(results[thread][event]); |
868 } | 868 } |
869 } | 869 } |
870 } | 870 } |
871 | 871 |
872 } // namespace | 872 } // namespace |
873 | 873 |
874 void HighResSleepForTraceTest(base::TimeDelta elapsed) { | 874 void HighResSleepForTraceTest(base::TimeDelta elapsed) { |
875 base::TimeTicks end_time = base::TimeTicks::HighResNow() + elapsed; | 875 base::TimeTicks end_time = base::TimeTicks::Now() + elapsed; |
miu
2015/01/21 23:52:51
This is identical to the PlatformThread::Sleep() i
charliea_google.com
2015/01/22 15:20:45
Done.
| |
876 do { | 876 do { |
877 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(1)); | 877 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(1)); |
878 } while (base::TimeTicks::HighResNow() < end_time); | 878 } while (base::TimeTicks::Now() < end_time); |
879 } | 879 } |
880 | 880 |
881 // Simple Test for emitting data and validating it was received. | 881 // Simple Test for emitting data and validating it was received. |
882 TEST_F(TraceEventTestFixture, DataCaptured) { | 882 TEST_F(TraceEventTestFixture, DataCaptured) { |
883 TraceLog::GetInstance()->SetEnabled( | 883 TraceLog::GetInstance()->SetEnabled( |
884 CategoryFilter("*"), | 884 CategoryFilter("*"), |
885 TraceLog::RECORDING_MODE, | 885 TraceLog::RECORDING_MODE, |
886 TraceOptions()); | 886 TraceOptions()); |
887 | 887 |
888 TraceWithAllMacroVariants(NULL); | 888 TraceWithAllMacroVariants(NULL); |
(...skipping 2195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3084 EXPECT_EQ(original_option.enable_sampling, new_options.enable_sampling); | 3084 EXPECT_EQ(original_option.enable_sampling, new_options.enable_sampling); |
3085 EXPECT_EQ(original_option.enable_systrace, new_options.enable_systrace); | 3085 EXPECT_EQ(original_option.enable_systrace, new_options.enable_systrace); |
3086 } | 3086 } |
3087 } | 3087 } |
3088 } | 3088 } |
3089 } | 3089 } |
3090 | 3090 |
3091 | 3091 |
3092 } // namespace debug | 3092 } // namespace debug |
3093 } // namespace base | 3093 } // namespace base |
OLD | NEW |