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

Side by Side Diff: base/debug/trace_event_unittest.cc

Issue 864943002: Replaces instances of the deprecated TimeTicks::HighResNow() with TimeTicks::Now(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More changes based on review comments. Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « base/debug/trace_event_unittest.h ('k') | base/message_loop/message_pump_perftest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
6
7 #include <math.h> 5 #include <math.h>
8 #include <cstdlib> 6 #include <cstdlib>
9 7
10 #include "base/bind.h" 8 #include "base/bind.h"
11 #include "base/command_line.h" 9 #include "base/command_line.h"
12 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
13 #include "base/debug/trace_event_synthetic_delay.h" 11 #include "base/debug/trace_event_synthetic_delay.h"
14 #include "base/json/json_reader.h" 12 #include "base/json/json_reader.h"
15 #include "base/json/json_writer.h" 13 #include "base/json/json_writer.h"
16 #include "base/memory/ref_counted_memory.h" 14 #include "base/memory/ref_counted_memory.h"
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 EXPECT_FALSE(results[-1][-1]); 862 EXPECT_FALSE(results[-1][-1]);
865 for (int thread = 0; thread < num_threads; thread++) { 863 for (int thread = 0; thread < num_threads; thread++) {
866 for (int event = 0; event < num_events; event++) { 864 for (int event = 0; event < num_events; event++) {
867 EXPECT_TRUE(results[thread][event]); 865 EXPECT_TRUE(results[thread][event]);
868 } 866 }
869 } 867 }
870 } 868 }
871 869
872 } // namespace 870 } // namespace
873 871
874 void HighResSleepForTraceTest(base::TimeDelta elapsed) {
875 base::TimeTicks end_time = base::TimeTicks::HighResNow() + elapsed;
876 do {
877 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(1));
878 } while (base::TimeTicks::HighResNow() < end_time);
879 }
880
881 // Simple Test for emitting data and validating it was received. 872 // Simple Test for emitting data and validating it was received.
882 TEST_F(TraceEventTestFixture, DataCaptured) { 873 TEST_F(TraceEventTestFixture, DataCaptured) {
883 TraceLog::GetInstance()->SetEnabled( 874 TraceLog::GetInstance()->SetEnabled(
884 CategoryFilter("*"), 875 CategoryFilter("*"),
885 TraceLog::RECORDING_MODE, 876 TraceLog::RECORDING_MODE,
886 TraceOptions()); 877 TraceOptions());
887 878
888 TraceWithAllMacroVariants(NULL); 879 TraceWithAllMacroVariants(NULL);
889 880
890 EndTraceAndFlush(); 881 EndTraceAndFlush();
(...skipping 2193 matching lines...) Expand 10 before | Expand all | Expand 10 after
3084 EXPECT_EQ(original_option.enable_sampling, new_options.enable_sampling); 3075 EXPECT_EQ(original_option.enable_sampling, new_options.enable_sampling);
3085 EXPECT_EQ(original_option.enable_systrace, new_options.enable_systrace); 3076 EXPECT_EQ(original_option.enable_systrace, new_options.enable_systrace);
3086 } 3077 }
3087 } 3078 }
3088 } 3079 }
3089 } 3080 }
3090 3081
3091 3082
3092 } // namespace debug 3083 } // namespace debug
3093 } // namespace base 3084 } // namespace base
OLDNEW
« no previous file with comments | « base/debug/trace_event_unittest.h ('k') | base/message_loop/message_pump_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698