Index: test/cctest/test-cpu-profiler.cc |
diff --git a/test/cctest/test-cpu-profiler.cc b/test/cctest/test-cpu-profiler.cc |
index 6d66c5e92b79268cfd25e99c44919b931c7f186c..6d3c2ee136ce2d7e8c8291e83e815023086f2597 100644 |
--- a/test/cctest/test-cpu-profiler.cc |
+++ b/test/cctest/test-cpu-profiler.cc |
@@ -44,15 +44,14 @@ 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, TimeDelta::FromMicroseconds(100))); |
+ SmartPointer<ProfilerEventsProcessor> processor( |
+ new ProfilerEventsProcessor(&generator, NULL, 100)); |
processor->Start(); |
processor->StopSynchronously(); |
} |
@@ -143,8 +142,8 @@ TEST(CodeEvents) { |
CpuProfilesCollection* profiles = new CpuProfilesCollection; |
profiles->StartProfiling("", 1, false); |
ProfileGenerator generator(profiles); |
- SmartPointer<ProfilerEventsProcessor> processor(new ProfilerEventsProcessor( |
- &generator, NULL, TimeDelta::FromMicroseconds(100))); |
+ SmartPointer<ProfilerEventsProcessor> processor( |
+ new ProfilerEventsProcessor(&generator, NULL, 100)); |
processor->Start(); |
CpuProfiler profiler(isolate, profiles, &generator, *processor); |
@@ -205,8 +204,8 @@ TEST(TickEvents) { |
CpuProfilesCollection* profiles = new CpuProfilesCollection; |
profiles->StartProfiling("", 1, false); |
ProfileGenerator generator(profiles); |
- SmartPointer<ProfilerEventsProcessor> processor(new ProfilerEventsProcessor( |
- &generator, NULL, TimeDelta::FromMicroseconds(100))); |
+ SmartPointer<ProfilerEventsProcessor> processor( |
+ new ProfilerEventsProcessor(&generator, NULL, 100)); |
processor->Start(); |
CpuProfiler profiler(isolate, profiles, &generator, *processor); |
@@ -274,8 +273,8 @@ TEST(Issue1398) { |
CpuProfilesCollection* profiles = new CpuProfilesCollection; |
profiles->StartProfiling("", 1, false); |
ProfileGenerator generator(profiles); |
- SmartPointer<ProfilerEventsProcessor> processor(new ProfilerEventsProcessor( |
- &generator, NULL, TimeDelta::FromMicroseconds(100))); |
+ SmartPointer<ProfilerEventsProcessor> processor( |
+ new ProfilerEventsProcessor(&generator, NULL, 100)); |
processor->Start(); |
CpuProfiler profiler(isolate, profiles, &generator, *processor); |
@@ -420,10 +419,13 @@ 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()); |
} |