Index: test/cctest/test-cpu-profiler.cc |
diff --git a/test/cctest/test-cpu-profiler.cc b/test/cctest/test-cpu-profiler.cc |
index 6d3c2ee136ce2d7e8c8291e83e815023086f2597..6d66c5e92b79268cfd25e99c44919b931c7f186c 100644 |
--- a/test/cctest/test-cpu-profiler.cc |
+++ b/test/cctest/test-cpu-profiler.cc |
@@ -44,14 +44,15 @@ using i::ProfileNode; |
using i::ProfilerEventsProcessor; |
using i::ScopedVector; |
using i::SmartPointer; |
+using i::TimeDelta; |
using i::Vector; |
TEST(StartStop) { |
CpuProfilesCollection profiles; |
ProfileGenerator generator(&profiles); |
- SmartPointer<ProfilerEventsProcessor> processor( |
- new ProfilerEventsProcessor(&generator, NULL, 100)); |
+ SmartPointer<ProfilerEventsProcessor> processor(new ProfilerEventsProcessor( |
+ &generator, NULL, TimeDelta::FromMicroseconds(100))); |
processor->Start(); |
processor->StopSynchronously(); |
} |
@@ -142,8 +143,8 @@ TEST(CodeEvents) { |
CpuProfilesCollection* profiles = new CpuProfilesCollection; |
profiles->StartProfiling("", 1, false); |
ProfileGenerator generator(profiles); |
- SmartPointer<ProfilerEventsProcessor> processor( |
- new ProfilerEventsProcessor(&generator, NULL, 100)); |
+ SmartPointer<ProfilerEventsProcessor> processor(new ProfilerEventsProcessor( |
+ &generator, NULL, TimeDelta::FromMicroseconds(100))); |
processor->Start(); |
CpuProfiler profiler(isolate, profiles, &generator, *processor); |
@@ -204,8 +205,8 @@ TEST(TickEvents) { |
CpuProfilesCollection* profiles = new CpuProfilesCollection; |
profiles->StartProfiling("", 1, false); |
ProfileGenerator generator(profiles); |
- SmartPointer<ProfilerEventsProcessor> processor( |
- new ProfilerEventsProcessor(&generator, NULL, 100)); |
+ SmartPointer<ProfilerEventsProcessor> processor(new ProfilerEventsProcessor( |
+ &generator, NULL, TimeDelta::FromMicroseconds(100))); |
processor->Start(); |
CpuProfiler profiler(isolate, profiles, &generator, *processor); |
@@ -273,8 +274,8 @@ TEST(Issue1398) { |
CpuProfilesCollection* profiles = new CpuProfilesCollection; |
profiles->StartProfiling("", 1, false); |
ProfileGenerator generator(profiles); |
- SmartPointer<ProfilerEventsProcessor> processor( |
- new ProfilerEventsProcessor(&generator, NULL, 100)); |
+ SmartPointer<ProfilerEventsProcessor> processor(new ProfilerEventsProcessor( |
+ &generator, NULL, TimeDelta::FromMicroseconds(100))); |
processor->Start(); |
CpuProfiler profiler(isolate, profiles, &generator, *processor); |
@@ -419,13 +420,10 @@ TEST(ProfileStartEndTime) { |
v8::HandleScope scope(env->GetIsolate()); |
v8::CpuProfiler* cpu_profiler = env->GetIsolate()->GetCpuProfiler(); |
- int64_t time_before_profiling = i::OS::Ticks(); |
v8::Local<v8::String> profile_name = v8::String::New("test"); |
cpu_profiler->StartCpuProfiling(profile_name); |
const v8::CpuProfile* profile = cpu_profiler->StopCpuProfiling(profile_name); |
- CHECK(time_before_profiling <= profile->GetStartTime()); |
CHECK(profile->GetStartTime() <= profile->GetEndTime()); |
- CHECK(profile->GetEndTime() <= i::OS::Ticks()); |
} |